Comments on: Run a web server on your Raspberry Pi Pico W https://picockpit.com/raspberry-pi/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w/ Thu, 01 Aug 2024 16:09:07 +0000 hourly 1 https://wordpress.org/?v=6.7 By: Tonton https://picockpit.com/raspberry-pi/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w/#comment-22499 Thu, 01 Aug 2024 16:09:07 +0000 https://picockpit.com/raspberry-pi/?p=2693#comment-22499 In reply to Gunther.

J’ai résolu le problème en ajoutant la ligne :
r = r[:50]
avant
led_on = r.find(‘?led=on’)
led_off = r.find(‘?led=off’)

Cela retire les caractères superflus de la requête

]]>
By: Gunther https://picockpit.com/raspberry-pi/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w/#comment-3942 Mon, 28 Nov 2022 00:53:51 +0000 https://picockpit.com/raspberry-pi/?p=2693#comment-3942 I tried to comment, but somehow the comment does not come out correctly…

]]>
By: Gunther https://picockpit.com/raspberry-pi/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w/#comment-3941 Mon, 28 Nov 2022 00:51:05 +0000 https://picockpit.com/raspberry-pi/?p=2693#comment-3941 The search by find function does also return a value if eg. the referrer contains the ‘led=xx’ string. So both led_on and led_off get a positive value at the same time and the LED is switched off again, when it was desired to switch on. To overcome this, the if statement has to be extended to check for a small index value (I used 20 only as a rule of thumb):

if (led_on > -1 and led_on -1 and led_off < 20):
Now it works as expected.

]]>
By: Charles https://picockpit.com/raspberry-pi/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w/#comment-2629 Tue, 25 Oct 2022 20:51:40 +0000 https://picockpit.com/raspberry-pi/?p=2693#comment-2629 In line 100 you use get_html() function. When I run your code I get a ‘get_html’ isn’t defined error.

]]>
By: Ian https://picockpit.com/raspberry-pi/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w/#comment-1296 Sun, 17 Jul 2022 19:15:57 +0000 https://picockpit.com/raspberry-pi/?p=2693#comment-1296 In reply to Pablo.

Hi Pablo – make sure you are using the latest UF2 file for the Pico W (not just the Pico) – found here. https://www.raspberrypi.com/documentation/microcontrollers/micropython.html

The network module is there as standard!

]]>
By: Pablo https://picockpit.com/raspberry-pi/run-web-server-to-control-onboard-led-on-raspberry-pi-pico-w/#comment-1269 Wed, 13 Jul 2022 16:31:56 +0000 https://picockpit.com/raspberry-pi/?p=2693#comment-1269 Error found when i trie it

%Run -c $EDITOR_CONTENT
Traceback (most recent call last):
File “”, line 1, in
ImportError: no module named ‘network’

]]>