Comments on: ESP32/ESP8266 MicroPython Web Server – Control Outputs https://randomnerdtutorials.com/esp32-esp8266-micropython-web-server/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Mon, 04 May 2026 20:44:28 +0000 hourly 1 https://wordpress.org/?v=6.8.5 By: Sara Santos https://randomnerdtutorials.com/esp32-esp8266-micropython-web-server/#comment-1184968 Mon, 04 May 2026 20:44:28 +0000 https://randomnerdtutorials.com/?p=76664#comment-1184968 In reply to jib zak.

The request variable will return something like this:
GET /?led=on HTTP/1.1 …

position 1 is G
position 2 is E

l is position 6 and it’s where the string led_off starts in the request variable

Regards,
Sara

]]>
By: jib zak https://randomnerdtutorials.com/esp32-esp8266-micropython-web-server/#comment-1184557 Sun, 03 May 2026 10:48:05 +0000 https://randomnerdtutorials.com/?p=76664#comment-1184557 In reply to Sara Santos.

nope. im still confuse.
what in position 1? position 2? 3? 4? 5?
can you give example

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-esp8266-micropython-web-server/#comment-1182290 Sun, 26 Apr 2026 20:35:22 +0000 https://randomnerdtutorials.com/?p=76664#comment-1182290 In reply to jib zak.

Hi.
I’m sorry I didn’t specify that.

led_on = request.find(‘/?led=on’)
This line checks if the text /?led=on exists inside the request string variable.

The request variable usually contains the full HTTP request sent by the browser (for example: GET /?led=on HTTP/1.1 …).
The .find() method searches for a substring and returns its position (index) inside the string. It’s located in position 6.
If not found, it returns -1.

So, if led_off = 6 it means the string led_off existis in the request and we want to turn it off.

The same logic applies for the other state.

I hope this is clear.

Regards,
Sara

]]>
By: jib zak https://randomnerdtutorials.com/esp32-esp8266-micropython-web-server/#comment-1181066 Wed, 22 Apr 2026 13:59:44 +0000 https://randomnerdtutorials.com/?p=76664#comment-1181066 if led_off == 6:
why 6????

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-esp8266-micropython-web-server/#comment-1127396 Tue, 25 Nov 2025 14:22:50 +0000 https://randomnerdtutorials.com/?p=76664#comment-1127396 In reply to JLDan.

Hi.
Did you upload both files to the board? I mean actually uploading, not just running?

Regards,
Sara

]]>
By: JLDan https://randomnerdtutorials.com/esp32-esp8266-micropython-web-server/#comment-1127234 Mon, 24 Nov 2025 22:47:07 +0000 https://randomnerdtutorials.com/?p=76664#comment-1127234 Bonjour,

J’ai bien suivi les différents points et versé le main.py et le boot.py sur l’esp8266 mais j’ai au final un dysfonctionnement : je n’ai pas d’action sur la led depuis mon portable et Thonny (mon EDI) m’indique une erreur qui est :

File “main.py”, line 24, in
OSError: [Errno 22] EINVAL

La ligne 24 est ‘conn, addr = s.accept()’
Pouvez vous m’aider?

Merci

]]>
By: p230mc https://randomnerdtutorials.com/esp32-esp8266-micropython-web-server/#comment-1123658 Fri, 14 Nov 2025 03:49:51 +0000 https://randomnerdtutorials.com/?p=76664#comment-1123658 great to start and i modified it to be a control for an rgb led with a color picker on the website

]]>
By: unkonwn https://randomnerdtutorials.com/esp32-esp8266-micropython-web-server/#comment-1123657 Fri, 14 Nov 2025 03:47:22 +0000 https://randomnerdtutorials.com/?p=76664#comment-1123657 In reply to Sara Santos.

try thonny

]]>
By: Alter https://randomnerdtutorials.com/esp32-esp8266-micropython-web-server/#comment-1121385 Sun, 09 Nov 2025 15:35:30 +0000 https://randomnerdtutorials.com/?p=76664#comment-1121385 In reply to Bob Willemen.

thanks Bob, this made my response times much faster

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-esp8266-micropython-web-server/#comment-1083169 Mon, 18 Aug 2025 16:17:55 +0000 https://randomnerdtutorials.com/?p=76664#comment-1083169 In reply to mackrackit.

You’re welcome!

]]>