Box IO

Self-hosted IoT for Arduino and ESP32.

Box IO for Arduino and ESP32

Box IO is a self-hosted IoT server. An Arduino or ESP32 talks to your Linux machine over virtual pins. You watch and control those pins from a web dashboard or from Android, iPhone, and Windows apps. The same sketch can send email, send an SMS, and pulse a pin on the board when a connection drops.

What Box IO can do

Arduino boards it works with

Copy the BoxIO library into Documents/Arduino/libraries/BoxIO and restart the Arduino IDE. Examples are under File → Examples → BoxIO, including PingWatchdog.

The dashboard is https://boxio.krmsproducts.net. The device hub the sketch uses is http://boxio.krmsproducts.net:5923 (HTTP, not HTTPS).

Email and SMS

Both messages leave through the Box IO server. The sketch does not hold the SMTP password or the Twilio token. Those stay in admin Settings. Email and SMS are not counted in the 30 virtualWrite messages per second.

Connect a board

Do this once on the Ubuntu Box IO machine. The Docker steps are in SETUP.txt.

  1. Open the dashboard and sign in as admin. Create a device key. Copy the bx_... value into BOXIO_AUTH in the sketch. Do not commit that key to git.
  2. Create a project and assign that device key to the project.
  3. Open the project, turn on Edit, add widgets, set each virtual pin, then Save layout. A widget that was never saved disappears on refresh.
  4. Open Live to use buttons, sliders, and the input box. Edit mode does not send those clicks.
  5. Flash the sketch with the same host, port 5923, and device key. BoxIO.run() must stay in loop().

Rules that apply to every widget

Widgets

LED V0. A round lamp. The sketch publishes on or off with virtualWrite. The dashboard does not send a click back to the device. Value box V1. Shows the latest text or number the sketch published. It does not send clicks back to the device. Circle meter V2. A round gauge from min to max. The sketch publishes the number. Color stops change the arc as the value rises. Bar meter V3. A vertical bar from min to max. Same color rules as the circle meter. The sketch publishes the number. Input box V4. Someone types on the dashboard and presses Send. The sketch receives that text in BOX_WRITE. Use pins 0–31 so the library can deliver it. Round button V6. A round on/off button. The caption is the label. The word on the face is textOn or textOff. A click sends the on or off value to the sketch. Oval button V7. Same behavior as the round button, drawn as a wide pill. Caption, face text, values, and colors are separate properties. Horizontal slider V8. A left-to-right slider. Dragging it in Live sends the number to the sketch when you release. The sketch can also publish a number to move the thumb. Vertical slider V9. An up-and-down slider. Same min, max, and send rules as the horizontal slider. The sample range includes a negative minimum. Grid V5. A table of cells on one virtual pin. The sketch sends a comma-separated list, row by row. Color rules paint cells from those numbers. Label none until attached. Text on the page. Leave it unattached to keep the words you typed. Attach it to a pin when the sketch should replace the words. Webhook V11. When the sketch virtualWrites this pin, the Box IO server calls a URL. Dashboard edits do not fire it. Comma-separated fields fill the data template. Ping watchdog GPIO 2. The Arduino itself checks a site or IP. If the board loses that connection, it drives one of its own GPIO pins high then low, or low then high, and waits the transition time between those two levels.

Questions

What Arduino boards work with Box IO?

ESP32 boards over Wi-Fi, an ESP32-S3 with a W5500 Ethernet chip, and SAM, SAMD, MegaAVR, and classic AVR boards that can open a WiFiClient or EthernetClient. The board talks to the Box IO server on HTTP port 5923.

How does an Arduino send email with Box IO?

An admin saves SMTP settings on the Box IO server. The sketch then calls BoxIO.email with the address, subject, and message. The board does not store the mail password.

How does an Arduino send an SMS with Box IO?

An admin saves a Twilio account SID, auth token, and from number. The sketch calls BoxIO.sms with the destination number and the message. Twilio is optional. The dashboard works without it.

Where does the Box IO ping watchdog run?

On the Arduino. BoxIO.run checks the site from the board and pulses one of that board's GPIO pins if the connection drops. The dashboard stores the settings and shows the status.