Home Sensors – Software

Surprising how much software is required to support a couple of weather sensors.

So the initial list was;

  • Decoding and processing of data transmitted by sensors
    • Gateway device between Lora and Linux DB server
    • Apache PHP API hosted on DB Server
    • Triggers or scheduled jobs in DB
    • Web page for current status
  • Data Storage
    • MySQL Database
    • Rollup / Summarise
  • LoRa device management (Sensors / Actuators)
    • Battery Levels
    • Record RSSI / Hall sensor
  • The generation of alerts;
    • exceeding a threshold (+40C)
    • Lightning detected
    • Low air quality
  • Interact with outside world via;
    • API
    • APRS
    • Bluetooth broadcast

The current code displays the current data, send updates into APRS and supports basic information as to the devices.

It operational however as always, more to do. Current code is also stable. The instabilities current present are pointing back to battery management as the devices simply go flat and I’m nit checking. I want the database to summarise the data. Currently have a roll-up function in API but can do better. Also suspect there are better reporting tools I can use.

There are components outstanding from initial spec being;

  • Bluetooth. The intent was to broadcast alerts to phones. To achieve this you need client side app. BLE is available with the ESP32 and there is a heap of code out there. The client app will take more investigation. There are examples out the for some knugesbut I would prefer a dedicated app. We use iPhones here so just a case of time with Xcode. Didn’t make the list.
  • Battery level. It is of value just not high enough on the list. The devices can run on a lipo batteries and support charging. Have one with a solar-cell in the window. The gateways are connected to a powered hub so no need. The unit that need to watch the voltage is the external weather station. To accurately measure voltage you need a voltage divider. Worked testing on breadboard but not deployed outside.

Will break into separate pages a write up of each device.

  1. Sensor
    • External Weather
    • Internal sensors
  2. Gateway
    • Heltec
    • FireBeetle
  3. Web / DB server
    • HTML Interface
    • Database Host