Refer: MicroPython Programming with ESP32 and ESP8266 V1_2. Page 169
I’m always receiving a -1 when my program executes request.find(‘/?led=on’) or ‘/?led=off’ meaning led_on or led_off are never == 6. I verified this with a print statement to see exactly what was being returned. It always seems to be -1.
When I connect to my board, the shell shows me the beginning of the content message to be…….”Content = b’GET /?led%20=%20on….” This does not look like I will ever get a match since it looks like the content contains %20 and will never match the /?led=on.
Any help is greatly appreciated. Thanks, Keith
Did you change anything on the code?
It seems like you have two extra spaces in your code. %20 means a space.
Check those spaces in your code.
Let me know if that solves the issue.
Hi Sara – It seems the code on git is different than the code in the ebook. When I loaded the code from git, it all works fine. When I loaded the code from the book it world not work. So going forward, I will load code from git. Thanks for your help. Regards……