Note: If your board has a micro USB port, you can probably skip this step.
Connect your board to laptop/desktop via a USB to TTL cable/adapter. Here's a pinout showing the different connections.
Connections should be like this:
Note: You may need to install FTDI drivers to make your device appear. To do so, go here then download and install the drivers for your operating system.
Setup Your Environment- Install the Arduino IDE. You can download it for Mac OS X, Windows and Linux here.
- Start the Arduino application and open
Preferences.*Enterhttp://arduino.esp8266.com/stable/package_esp8266com_index.jsoninto the Additional Board Manager URLs. If you need more than one, they can be separated with commas.
- Go to
Tools > Board > Boards Manager.
- Search for
esp8266. When found, clickInstall.
Select your ESP8266 board type by going to Tools > Board, then choosing your type. For this example I am using NodeMCU 1.0 (ESP-12E Module).
Note: Check that Upload Speed is set to 115200 and the correct Port is selected.
- Click on
File > Newto create a new Sketch.
- Copy and paste the publish event example code below labeled
PublishEvent.ino. You can also view it on GitHub here. In that directly you will see how to publish both Events and Locations.
Replace the following values of the following variables:
ssid- with your WiFi network name.
password- with your WiFi network password.
device_secret_keywith your device secret key from the Wia Dashboard (the one that begins withd_sk).
Verify/Compilethe code. If it runs correctly then go toSketch > Uploadto send it to your ESP8266.
Go to the Wia dashboard to view the data coming through to your device.



_nfx5uw2aAx.png?auto=compress%2Cformat&w=900&h=675&fit=min)







Comments