Skip to content

Flashing your Sensor

Andres Meira edited this page May 24, 2021 · 1 revision

This guide will show you how to upload code to your OpenEEW sensor board.

Upload the firmware

Prerequisites

  • Install Python
  • Open a command line and run pip install –upgrade esptool
  • Go to the release page and download the latest OpenEEW firmware
  • Unzip the firmware into a folder on your computer

Flash OpenEEW firmware to your device

  1. Connect your sensor to your computer via USB
  2. Navigate to the folder with the unzipped firmware and open a command line
  3. Run the following commands to reset the board and update the firmware using esptool:
esptool.py --chip esp32 --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_size detect 3997696 ./spiffs.bin

then

esptool.py --chip esp32 --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 ./bootloader_dio_40m.bin 0x8000 ./partitions.bin 0xe000 ./boot_app0.bin 0x10000 ./firmware.bin

If the script doesn't detect your board, try adding the correct port just after esptool.py --chip esp32 . If you are using Linux this could be similar to --port "/dev/ttyUSB0", and if you are using Windows this could be similar to --port "COM4"

Once the flashing is done, after a few seconds your board will start to flash a dark blue.

If you have problems with this method, you can also flash your board using PlatformIO.

Install your device

Install your device to a wall following these instructions.

Provision with mobile app

Now you have a device that is

  1. Connected to a wall power socket
  2. Close to a Wi-Fi router, and optionally connected by ethernet
  3. Flashing dark blue and waiting for a connection to a local network

Install the OpenEEW Mobile app:

Connect your phone to a local 2.4Ghz Wi-Fi network (cannot be 5Ghz), and open the OpenEEW mobile app.

Follow the on screen instructions to register your account and device.

Congratulations, you have connected your OpenEEW sensor to the global network!