Skip to content

Rik034/seismocloud-sensor-esp32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SeismoCloud project: http://www.seismocloud.com

Original NodeMCU version: https://github.com/sapienzaapps/seismocloud-sensor-nodemcu

Note: This ESP32 port contains only minimal modifications necessary for ESP32 compatibility. The core seismic detection functionality remains completely untouched from the original version. Due to this unofficial port status, the DONT_UPDATE flag is set by default and must remain enabled to prevent the device from attempting to download NodeMCU firmware updates.

⚠️ Important Note - ESP32 Pin Configuration

The pins for the MPU6050 and LEDs were chosen arbitrarily by me for convenient wiring, feel free to change them to suit your needs.

To change pin assignments, edit the following definitions:

  • LEDs: LED_RED, LED_YELLOW, LED_GREEN in src/common.h (lines 14-16)
  • I2C (MPU6050): WIRE_SDA, WIRE_SCL in src/MPU6050.h (lines 10-11)

Supported boards

  • ESP32 DOIT DevKit v1 (most ESP32-WROOM dev boards should work)

Network requirements

The device will acquire all IPv4 configurations (address, netmask, gateway, DNS) via DHCP.

If you have any firewall in your network, please allow these ports (outgoing, to internet):

  • TCP: 443, 1883

LED status description

LEDs can be in these different states (empty cells means "OFF"):

Green Yellow Red Status
ON Device is idle and listening
ON The device has lost its connection, and it's trying to reconnect
ON A vibration/shake is detected!
ON ON ON The device is connecting to the SeismoCloud network
ON ON Checking for updates or updating
ON Connecting to Wi-Fi network*
ON Calibration in progress

At the end of the boot sequence all three LEDs will blink rapidly to signal that it's OK.

*: If only the yellow LED is ON for more than 10 seconds then the ESP32 is waiting for Wi-Fi network configuration (see the chapter "How to build/upload the software")

How to build the device (hardware)

Requirements

Wiring the Accelerometer MPU6050

Link these pins from Accelerometer MPU6050 to ESP32 board:

  • 3v3: 3.3V
  • GND: GND
  • SDA: GPIO 22
  • SCL: GPIO 23

Wiring LEDs

Remember to put a resistor with LED (after/before is not really important) to limit current flowing, otherwise you may damage the ESP32 board.

By default, LED pins are:

  • GPIO 25 : Green
  • GPIO 33 : Yellow
  • GPIO 32 : Red

How to build/upload the software

Using PlatformIO CLI

  1. Clone or download the source code
  2. Navigate to the project directory
  3. Build the firmware:
    pio run
  4. Upload to ESP32 (make sure the board is connected):
    pio run --target upload
  5. Monitor serial output (optional, for debugging):
    pio device monitor --baud 115200
  6. Connect to SeismoCloud Wi-Fi network and configure Wi-Fi client network parameters. On save, the board reboots and will try to connect to Wi-Fi network. If it fails, you can reconnect to SeismoCloud network and modify/fix network parameters.
  7. Open SeismoCloud app, connect to the same network of the board and register your device. Enjoy!

Other methods are available (PlatoformIO VSCode Extension, using the src directory as an Arduino IDE sketch) but I don't use them. PRs are welcome.

FAQ

My device has only the yellow LED powered on for more than 10 seconds

The sensor failed to connect to the Wi-Fi network. Please follow the instruction in chapter "How to build/upload the software" step 6 (CLI) or step 6 (IDE)

I'm connected to the Wi-Fi network, but no configuration portal appears.

Try to open a browser and navigate to http://192.168.4.1 . If the Wi-Fi portal still not showing, disconnect the board from the power source for few seconds. If it still fails, you may need to erase the flash memory:

esptool --chip esp32 erase-flash

Then re-upload the firmware.

How do I enable debug mode?

Edit src/common.h and uncomment the line:

// #define DEBUG

Then rebuild and upload the firmware. Debug messages will be available on the serial monitor at 115200 baud.

How do I prevent firmware updates during development?

The DONT_UPDATE flag is defined by default in src/common.h:

#define DONT_UPDATE

This prevents the device from checking for updates. Comment this line out for production builds.

License

See LICENSE file

About

Source code for ESP32 seismometers for SeismoCloud project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors