- Install the Arduino IDE. You can download it for Mac OS X, Windows and Linux here.
To use the board, you must manually install ESP32 board definitions on your Arduino Ide, you can find the official tutorial for the different operating systems here
If installed, go to here in the tutorial. Otherwise, continue on
- Go to your Arduino IDE's installed directory
- For Windows, it may be
C:/Program Files (x86)/Arduino/hardware
- For Mac, it may be
/Applications/Arduino.app/Contents/Java/hardware
- For Linux it may be
~/Arduino/hardware
- Make an espressif directory and clone the
arduino-esp32
git repository
git clone https://github.com/espressif/arduino-esp32.git esp32
If you don't have git, you can download the zip file from here, make an esp32
directory in the espressif directory e.g. espressif/esp32
then unzip the file.
- Install the code for the ESP32 by:
- For Windows, run the
get.exe
in theesp/tools
folder
- For Mac/Linux run
python get.py
in the esp/tools` folder
- Restart the Arduino IDE
Once you've got it connected to your computer, get the name of your device's port using one of the following steps:
Linux and Mac OS X- Open a terminal window and run the command
ls /dev/tty.*
- Look for a device with the name that begins with
/dev/tty
e.g./dev/tty.usbmodemPy343431
or/dev/ttyUSB0
.
- Download and install the FTDI drivers from here.
- Open the Windows start menu and search for 'Device Manager'
- The COM port for the ESP32 device will be listed as 'USB Serial Device' or something similar
- Keep note of the COM port (e.g. COM4)
- Select the
ESP32 Dev Module
board type by going toTools > Board
- Select the port that matches from above
Check that Upload Speed
is set to 115200
- Click on
File > New
to create a new Sketch.
- Copy and paste the publish event example code below in place of the empty
setup()
andvoid()
functions
Replace the following values of the following variables:
ssid
- with your WiFi network name.
password
- with your WiFi network password.
device_secret_key
with your device secret key from the Wia Dashboard (the one that begins withd_sk
).
Verify/Compile
the code. If it runs correctly then go toSketch > Upload
to send it to your ESP-32 Thing.
You may need to push the RST
(Reset) button to run the code on the board.
- Click on button on the right hand of the screen to view your Serial monitor (Denoted in image below)
- Make sure the baud rate is set to
1152000
(Shown in red rectangle in image below)
Publish an Event to Wia
If the Serial monitor doesn't show you connecting to a WiFi, You may need to push the RST
(Reset) button to run the code on the board.
Now go to your device in the Wia dashboard and you should see the data appearing in the debugger.
Comments