ESP8266-based boards such as NodeMCU and WeMos D1 Mini are quite popular for projects that require internet connection because of their built-in WiFi capabilities.
xod-dev/esp8266-mcu library that makes connecting to the internet simple. All you need is a
Bind your network SSID and password to
PWD pins and you are good to go.
Let’s build a small patch to verify that connection is successful. First, it will print “Connecting” to the debugger, then (after a little delay) your local IP if connection was successful or “Error” if something went wrong.
xod-dev/esp8266-mcu/lan-ip gets the IP address from
xod/net/format-ip formats the IP as a human-readable string like “192.168.88.101”.
To output the progress to the debugger we use
On Boot to
Upload the patch to your board in debug mode. You should see something like this:
Now that you have a working internet connection, it’s time to do something useful with it. For example, fetching some data with HTTP requests.