Basic client / server on Pico W / windows #13531
Replies: 1 comment
-
Hi, but, hooo, do you connect to your local network? See Pico W Documentation on RaspberryPi.org Ok, I know many others do this as well. But I love to build my on stuff instead of using AhoiDTU or something else. It ii just on my own interest, like yourself I'm now working on a more elaborated version (REST-API). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
Only just getting into microcontrollers but enjoying myself so far. Please forgive the silly questions that will no doubt be aired below.
I'm interested in getting a basic wifi example up and running using Pico W and a windows server, running micropython and python respectively. Pretty simple - I push a button attached to the microcontroller, the server receives a message. However it absolutely has to be sent and received, which led me down the path of resilient client / server libs like this one: which looks great and seems to address any concerns regarding signal drop out. It mostly works ootb too, despite not being authored for windows (select poll is solved with this gist).
However I'm not having any luck connecting to my server. I'm connecting to wifi properly and let my server through the firewall, but output via Thonny is:
Diving into the client code it seems to suggest getting stuck here:
if I print out the value of d it seems like I get a period where it's None (causing server to wait) but then I'll get a a b'' value which then raises the exception above. Am I missing something fundamental here? I'm using the latest firmwhere here for what it's worth.
Trivial client / server examples using the native socket lib work fine, so I know it's not a hardware / config issue. Which brings me to my second question - it using the iot library absolutely necessary? The page mentions ESP8266, ESP32 or other target including the Pyboard D. which would obviously include the Pico W, however it's not explicitly mentioned so just wondering if I'm jumping through these hoops unnecessarily.
Many thanks in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions