matthias-bs / BresserWeatherSensorTTN

Bresser 5-in-1/6-in-1/7-in-1 868 MHz Weather Sensor Radio Receiver based on ESP32 and RFM95W/SX1276 - sends data to a LoRaWAN Network (e.g. The Things Network)
MIT License
22 stars 9 forks source link

Add downlink: Unixtime #20

Closed matthias-bs closed 10 months ago

matthias-bs commented 1 year ago

Implement downlink of Unixtime to set RTC if LoRaWAN cannot provide time

matthias-bs commented 1 year ago

Set Date/Time Command

byte0: 0x88 (CMD_SET_DATETIME)
byte1: unixtime[31:24]
byte2: unixtime[23:16]
byte3: unixtime[15: 8]
byte4: unixtime[ 7: 0]

Unixtime can be retrived from https://www.epochconverter.com/hex Conversion to Base64 can be done with https://base64.guru/converter/encode/hex if required.

To be really useful, a get date/time command has to be added.

matthias-bs commented 1 year ago

Bugfix: https://github.com/matthias-bs/BresserWeatherSensorTTN/commit/4157e437f1b09398ed45381b1c02736f197b15c8