This firmware allows an OpenEEW ESP32 sensor to connect to an MQTT broker and send a JSON containing accelerations from the x,y and z axis every second.
Please follow this video to setup your sensor/mqtt/earthquake detection system:
flashsensor.mp4
Add your sensor details in src/secrets.h
:
user
This is a unique name of the sensor network ownernetwork
This is a 2 digit code which identifies the sensor networkstation
This is a 5 digit code which identifies the sensor you are about to flash. Every sensor you flash must have a unique station code.
Add your MQTT broker details also in src/secrets.h
:
MQTT_HOST
This is the network address of your MQTT host such as 192.168.0.10 or mqtt.yourserver.comMQTT_PORT
This is the port of your MQTT host, typically 1883.
Connnect your sensor to your PC's USB, and add the USB port to upload_port
in platformio.ini
.
From the PlatformIO menu, choose Upload
and wait for your device to flash. When done, you will be able to see the output from a serial monitor, such as the one available in PlatformIO.
If you wish to use Ethernet simply plug in the cable before you turn on the sensor. If you wish to use Wifi, then wait until the LEDs flash yellow and open your SmartConfig app to send over your wifi credentials (must be 2.4Ghz wifi only). Apps you can use include (not all have been tested):
The sensor data will now be available from your MQTT broker at the topic <user>/<network>/<deviceID>
, where deviceID
is automatically created from the device's unique Wifi MAC address.
This firmware is based off the excellent ADXL355 library by MarkRad.
___Enjoy! Give us feedback if you have suggestions on how to improve this information.
The community welcomes your involvement and contributions to this project. Please read the OpenEEW contributing document for details on our code of conduct, and the process for submitting pull requests to the community.
The OpenEEW sensor is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 (DCO) and the Apache Software License, Version 2.