This page has no translation to 中文 yet. The original English version is below. If you’d like to help, great! See how to translate a documentation page in the contribution guide.
Note This is a web-version of a tutorial chapter embedded right into the XOD IDE. To get a better learning experience we recommend to install the desktop IDE or start the browser-based IDE, and you’ll see the same tutorial there.

Stand-alone Internet

Screenshot of 112-standalone-internet

It’s time to make your device autonomous.

Here is the program from the previous chapter. The program has a tethering-inet node that depends on PC and works only in the debug mode. To make a stand-alone device, replace it with another node that provides the internet using some hardware module, shield, or the native microcontroller features.

For such purposes XOD has a few standard libraries:

  • xod-dev/esp8266-mcu — if you run the program on ESP8266,
  • xod-dev/esp8266 — if you run the program on the microcontroller without onboard WiFi module, but using an ESP8266 as an AT command modem,
  • xod-dev/w5500 — if you have an ethernet shield based on W5500 chipset.

Each of the libraries has a set of some low-level networking nodes. But for the current case, you only need the internet provider node.

Here are these nodes:

  • xod-dev/esp8266-mcu/connect
  • xod-dev/esp8266/connect
  • xod-dev/w5500/ethernet-shield

Excercise #

  1. Replace the tethering-inet node with a suitable one from the list above.
  2. Bind the appropriate values to the node inputs such as the name of your WiFi access point and password.
  3. Bind the PORT value to servo node.
  4. Upload the patch without debug mode.

Note that you need to log in and generate a XOD Cloud API key for the project if you haven’t done it before (hit Edit → Project Preferences).

The servo rotates to the angle that corresponds to the latest “moisture” value. Now you can open the chapter 015-xod-cloud again, run the simulation and control your gauge from XOD IDE over the cloud. Or you can make another device, which updates this value automatically.

In some cases, you might need to make an advanced configuration of the connected module or ethernet-shield. Check out examples in the library or read an article about ethernet-shield advanced configuration.

Found a typo or mistake? Want to improve the text? Edit this page on GitHub and open a pull request. If you have a complex proposal or you want to discuss the content, feel free to start a new thread on XOD forum.