在 Raspberry Pi Pico W 上运行网络服务器〉的留言 https://picockpit.com/raspberry-pi/zh/%e8%bf%90%e8%a1%8c%e7%bd%91%e7%bb%9c%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%9d%a5%e6%8e%a7%e5%88%b6%e6%a0%91%e8%8e%93%e6%b4%be%e4%b8%8a%e7%9a%84%e4%b8%bb%e6%9d%bf-pico-w/ Thu, 01 Aug 2024 16:09:07 +0000 每小时 1 https://wordpress.org/?v=6.7.1 留言者:Tonton https://picockpit.com/raspberry-pi/zh/%e8%bf%90%e8%a1%8c%e7%bd%91%e7%bb%9c%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%9d%a5%e6%8e%a7%e5%88%b6%e6%a0%91%e8%8e%93%e6%b4%be%e4%b8%8a%e7%9a%84%e4%b8%bb%e6%9d%bf-pico-w/#comment-22499 Thu, 01 Aug 2024 16:09:07 +0000 https://picockpit.com/raspberry-pi/?p=2693#comment-22499 回覆的對象為「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

]]>
留言者:冈特 https://picockpit.com/raspberry-pi/zh/%e8%bf%90%e8%a1%8c%e7%bd%91%e7%bb%9c%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%9d%a5%e6%8e%a7%e5%88%b6%e6%a0%91%e8%8e%93%e6%b4%be%e4%b8%8a%e7%9a%84%e4%b8%bb%e6%9d%bf-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…

]]>
留言者:冈特 https://picockpit.com/raspberry-pi/zh/%e8%bf%90%e8%a1%8c%e7%bd%91%e7%bb%9c%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%9d%a5%e6%8e%a7%e5%88%b6%e6%a0%91%e8%8e%93%e6%b4%be%e4%b8%8a%e7%9a%84%e4%b8%bb%e6%9d%bf-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.

]]>
留言者:邓小平 https://picockpit.com/raspberry-pi/zh/%e8%bf%90%e8%a1%8c%e7%bd%91%e7%bb%9c%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%9d%a5%e6%8e%a7%e5%88%b6%e6%a0%91%e8%8e%93%e6%b4%be%e4%b8%8a%e7%9a%84%e4%b8%bb%e6%9d%bf-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.

]]>
留言者:尹恩惠 https://picockpit.com/raspberry-pi/zh/%e8%bf%90%e8%a1%8c%e7%bd%91%e7%bb%9c%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%9d%a5%e6%8e%a7%e5%88%b6%e6%a0%91%e8%8e%93%e6%b4%be%e4%b8%8a%e7%9a%84%e4%b8%bb%e6%9d%bf-pico-w/#comment-1296 Sun, 17 Jul 2022 19:15:57 +0000 https://picockpit.com/raspberry-pi/?p=2693#comment-1296 回覆的對象為「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!

]]>
留言者:裴博洛 https://picockpit.com/raspberry-pi/zh/%e8%bf%90%e8%a1%8c%e7%bd%91%e7%bb%9c%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%9d%a5%e6%8e%a7%e5%88%b6%e6%a0%91%e8%8e%93%e6%b4%be%e4%b8%8a%e7%9a%84%e4%b8%bb%e6%9d%bf-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’

]]>