Heapless driver for the Wifi+bluetooth integrated circuit on the pico.
Note for Automate Your Home Using Go book readers below!
To run the blinky example:
tinygo flash -target=pico -stack-size=8kb -scheduler=tasks -monitor ./examples/blinky| To run Wifi examples you must first set your wifi credentials: |
|---|
-
Clone this repository
-
Create ssid.text and password.text files in the
examples/commondirectory. Write your SSID into ssid.text and WiFi password into password.text. Do not add final newlines to the files. If the password is empty then an open network is assumed. -
Run any of the examples in the
examplesdirectoryExample of how to run the DHCP example:
tinygo flash -target=pico -stack-size=8kb -scheduler=tasks -monitor ./examples/dhcp
stringer used for enum string representation generation. Automated via running go generate in repo root:
go install golang.org/x/tools/cmd/stringer@latest| Build tag | Source | Effect |
|---|---|---|
debugheaplog |
lneto | Enables verbose logging of networking stack with [ALLOC] tagged log lines on heap allocation detection. |
noslog |
lneto | Omits log/slog package calls within networking library. Useful to cut down on binary size and omit json and fmt package inclusion in resulting binary. |
xnetdebug |
lneto | Enables packet capture logging on all packets received and sent. |
cy43nopio |
cyw43439 |
For setting user defined PIO. Useful for non RP2 targets or if not using TinyGo. See bus.go cmdBus. |
Example:
tinygo flash -target=pico -stack-size=8kb -scheduler=tasks -monitor -tags=debugheaplog,xnetdebug ./examples/dhcpPRs welcome! Please read most recent developments on this issue before contributing.
For Automate Your Home Using Go readers: Welcome! You will find the book examples still work but do note that you will be running a deprecated networking library called seqs. The new examples use lneto and have noticeably diverged from seqs style. The historical reasons for the drift is explained in a FOSDEM talk on youtube.
If you wish to return to the world of seqs and follow the examples in the book verbatim feel free to simply check out the commit right before lneto support was merged:
git checkout 0a1d121ea3