Skip to content

picocalc-extras 2.4

Choose a tag to compare

@ctorkildson-netizen ctorkildson-netizen released this 20 Nov 23:04
· 4 commits to main since this release
64c0487

picocalc-extras 2.4 adds net/, Wi-Fi for your own programs on a Pico 2 W, with a small ping program as its example.

net/

  • Joins the network named in /ntp/ntp.cfg, the file the PicoCalc shell's NTP command already uses (read with the shell's own parser), so Wi-Fi is set up in one place on the card.
  • One TCP connection at a time, name lookups, and ping (net_ping()).
  • net_leave() tells the router the PicoCalc has gone, so the next program joins at once instead of being turned away for a minute.
  • Every call waits, with an optional progress callback ("Joining MyNetwork..."); lwIP runs in the background meanwhile, so nothing that arrives is lost.
  • Bring it in with picocalc_net(path/to/picocalc-shell) after picocalc_fatfs(). A suitable lwipopts.h comes with it. net/README.md has the lines to copy.
  • It's calcterm's telnet networking, made a piece of its own.

ping

Joins your network, shows the PicoCalc's address, then pings whatever you type (an address or a name) four times, as ping does on a PC. q quits.

Copy ping.uf2 to the card's pico2-apps folder.

Tried with

A Pico 2 W PicoCalc on a home network: replies from the local network in 3 to 9 ms and from 1.1.1.1 in 17 to 20 ms, "No reply" from an empty address without hanging, and the next program joining Wi-Fi at once after quitting.