IoT Developer Kit Environment Setup

All Losant IoT Developer Kits use an ESP8266 based WiFi development board. Before you can flash the required firmware to these devices, you must setup your environment with the proper development tools. The below instructions will walk you through installing all necessary 3rd party tools. These instructions only need to be followed once, and the same environment can be used for all Losant IoT developer kits.

Install Arduino IDE

Download and install v1.8.7 of the Arduino IDE by following the instructions at:

If you already have the Arduino IDE installed, it is strongly recommend that you download and install 1.8.7. There have been issues with previous versions not working correctly.

Install USB Drivers

The microcontroller boards requires the USB to UART driver to be installed in order to program it. Download and install the driver for your platform by following the instructions at:

Windows Driver Download

Mac Driver Download

On a Mac, the above link downloads a disk image. Double-click the file to mount it, open the disk image, then double-click the .pkg file to install the driver.

Mac Driver Disk Image

Configure Arduino IDE

Launch the Arduino IDE. Linux users typically have to open the IDE under sudo for correct permissions. In order for the board to show up as a board in Arduino, you must add the following to the “Additional Boards Manager URLs” field in the preferences. On a Mac, the preferences can be found at Arduino -> Preferences.

Arduino Preferences

Restart the Arduino IDE.

Open the Board Manager at Tools -> Board -> Boards Manager. Change the Type field to Contributed and enter esp8266 in the Search field. Select the ESP8266 entry in the list, change the version to 2.4.2, and click the Install button.

Install Board

Restart the Arduino IDE again. We can now configure the Arduino IDE to use the board we just installed.

Open the Arduino IDE, select the Tools menu, and change the Board to Generic ESP8266 Module.

Select Board

After selecting the board, additional options will appear in the Tools menu. Ensure the other options are set to the following; the bolded options typically need changed from their defaults.

  1. Flash Mode = QIO
  2. Flash Frequency = 40MHz
  3. CPU Frequency = 80MHz
  4. Flash Size = 4M 1M SPIFFS
  5. Reset Method = nodemcu
  6. Upload Speed = 115200

Tools Menu

Install Libraries

The following workshops require a few dependencies to be installed. The first two libraries can be installed using Arduino’s Library Manager. Open the manager from the Sketch -> Include Library -> Manage Libraries menu.

Manage Libraries

The first required library is PubSubClient. Type that in the filter field, select the entry in the list and install the latest version.

Install PubSubClient

The next library is ArduinoJson. Repeat the the same process again, and install the latest version of ArduinoJson.

Install ArduinoJson

The last library is the Losant Arduino MQTT Client. We’ll include this library as a zip file. Download the zip from the following URL and save it somewhere convenience on your computer. You’ll use this file in the next step.

Next, add the zip you just downloaded to your libraries using the Sketch -> Include Library -> Add .ZIP Library menu.

Add Zip Library

This will open a file browser. Simply select the zip you just downloaded.

Configure Device USB Port

If you don’t have a microcontroller yet, you can skip this step and return to it when you have the device.

Remove the microcontroller from the foam (if needed), and connect it to your computer with the supplied USB cable.

Use the Tools -> Port menu to select the port your device is connected to. This will change depending on your operating system. On a Mac, it’s always named SLAB_USBtoUART. On Windows it will be named Com and then a number, for example Com3.

Select Port

If you don’t see an entry under the port menu, double check the following:

  1. Did you install the USB driver?
  2. Did you connect the microcontroller to your computer with the supplied USB cable?

Your environment is now properly setup to begin programming your dev kits with their needed firmware. Please continue to the instructions for your specific kit.