Connect NuttyFi

Docs / Get started / Connect NuttyFi
Get started

Connect NuttyFi

Set up the Arduino IDE for your NuttyFi board, install the SMEIoT library, flash a sketch and check it connects. The same steps work for any ESP32 or ESP8266 board.

Arduino IDE 2NuttyFi 2.0 · NuttyFi32115200 baud2.4 GHz Wi-Fi

Pick your board

Choose your board. The steps and values below change to match it.

Chip
Boards Manager URL
Board package
Tools → Board
Shows in SME AIoT as

Set up the Arduino IDE

  1. Install the Arduino IDEDownload Arduino IDE 2 from arduino.cc/en/software and install it.
  2. Add the board URLOpen File → Preferences (on macOS: Arduino IDE → Settings). In Additional boards manager URLs, paste and click OK.
  3. Install the board packageOpen Tools → Board → Boards Manager, search for , find and click Install.
  4. Select the boardOpen Tools → Board and pick .
  5. Pick the portPlug the board in with a USB data cable. Open Tools → Port and pick the new port: COM3 or similar on Windows, /dev/cu.usbserial-… on macOS, /dev/ttyUSB0 on Linux.
No port showing?Try another cable: many USB cables only charge. If it still doesn't show, install the driver for the USB chip on your board, often CP210x or CH340, and plug it in again.

Install the SMEIoT library

  1. Download the library
  2. Add it to the IDEOpen Sketch → Include Library → Add .ZIP Library and pick the ZIP you downloaded.
  3. Install the two helper librariesOpen Tools → Manage Libraries. Search for and install PubSubClient (by Nick O'Leary) and ArduinoJson (by Benoit Blanchon).
  4. Check it workedOpen File → Examples → SMEIoT → Basic. If the example opens, the library is installed.
Both helper libraries are neededAdding the ZIP doesn't install PubSubClient and ArduinoJson for you. Without them the sketch stops with an error such as PubSubClient.h: No such file or directory.

Flash and check the connection

Open the first sketch, paste in your credentials and Wi-Fi details, and click Upload. Then open Tools → Serial Monitor and set it to 115200 baud. Try each case below to see what the Serial Monitor shows and what to do.

Serial MonitorLIVE
What happens if...
Serial Monitor · 115200 baud
OfflinePick a case and press Upload.

The Serial Monitor shows what the board is doing. Most problems show up in the first few lines.

Troubleshooting

What you seeWhat to do
No port in Tools → PortUse a USB data cable, try another USB socket, and install the CP210x or CH340 driver for your board.
Upload fails: "Timed out waiting for packet header"ESP32 boards: hold the BOOT button when Connecting... appears, and let go once the upload starts.
Stuck on "Connecting to WiFi..."Check the Wi-Fi name and password (they are case-sensitive), and use a 2.4 GHz network. The board keeps retrying every 10 seconds.
"Register HTTP" is not 200The Dashboard ID or Device token is wrong, or the device was made on the other server. Copy the code from Device Info again.
"MQTT Failed"The board retries on its own. Meanwhile the SDK still sends and receives data over HTTPS, so the device keeps working, just more slowly.
Strange characters in the Serial MonitorSet the Serial Monitor to 115200 baud, the same as Serial.begin(115200) in the sketch.
Online, but the widget does nothingCheck the widget and your sketch use the same Telemetry Point, for example TP0 in both.

Staging or production

The SDK connects to production unless you say otherwise. To test on staging, call SME.setServer() before SME.begin(). Staging and production have separate accounts and devices, so use the credentials of a device made on the server you pick.

void setup()
{
  Serial.begin(115200);
  SME.setServer(SME_STAGING);      // or SME_PRODUCTION (the default)
  SME.begin(DASHBOARD_ID, DEVICE_TOKEN, FIRMWARE_VERSION, WIFI_SSID, WIFI_PASS);
}

At start-up the Serial Monitor prints [SME] Server: ... (shown masked here) so you can check which one the board is using.

Next steps

Was this page helpful?