Hi community,
How can I use the WiFi for the PyBoard SF2. The documentation seems outdated for this board which is a big bummer for me: https://docs.micropython.org/en/latest/ ... ckref.html, or am I just looking at the wrong place here? Could anyone provide me an example code?
I tried the network code for the ESP32, but as I thought (logically) it does not work for the PyBoard.
Any help is welcome
How to use the WiFi on the PyBoard
Re: How to use the WiFi on the PyBoard
I found an old forum post when the Pyboard first came out that referenced this site:https://pybd.io/hw/pybd_sfxw.html#wifi-control and that seems to be the same as the WLAN documentation: https://docs.micropython.org/en/latest/ ... .WLAN.html
Re: How to use the WiFi on the PyBoard
Thank you! Now I can connect to a network, awesome.dhylands wrote: ↑Sun Apr 10, 2022 3:51 amI found an old forum post when the Pyboard first came out that referenced this site:https://pybd.io/hw/pybd_sfxw.html#wifi-control and that seems to be the same as the WLAN documentation: https://docs.micropython.org/en/latest/ ... .WLAN.html
Now the next part.. how can I make (GET, POST) requests? The 'urequest' module doesn't seem to work on the PyBoard. Next to requests I would also like to try websockets. Do you have any idea on how to do this for the PyBoard?
Re: How to use the WiFi on the PyBoard
I'm actually trying to do exactly the same thing.
You can find urequests.py here: https://github.com/micropython/micropyt ... equests.py
So checkout the micropython-lib repository: https://github.com/micropython/micropython-lib/
and set an environment variable MPY_LIB_DIR to point to the micropython-lib directory.
Then go into the micropython/ports/stm32/boards/PYBD_SF2 and edit manifest.py and add this line to the end:
and if you rebuild micropython, it will have urequests.py builtin as a frozen module.
Alternatively, you could just copy urequests.py onto your pyboard.
You can find urequests.py here: https://github.com/micropython/micropyt ... equests.py
So checkout the micropython-lib repository: https://github.com/micropython/micropython-lib/
and set an environment variable MPY_LIB_DIR to point to the micropython-lib directory.
Then go into the micropython/ports/stm32/boards/PYBD_SF2 and edit manifest.py and add this line to the end:
Code: Select all
freeze("$(MPY_LIB_DIR)/python-ecosys/urequests", "urequests.py")
Alternatively, you could just copy urequests.py onto your pyboard.
Re: How to use the WiFi on the PyBoard
I got picoweb running on my pyboard D and I put all of the files together over here: https://github.com/dhylands/picoweb