wildlifeai / wildlife-watcher-mobile-app

Mobile app to communicate with the Wildlife Watchers
MIT License
3 stars 1 forks source link

Draft requirements for LoraWan comms #49

Open victor-wildlife opened 2 months ago

victor-wildlife commented 2 months ago

Victor and Charles to draft:

@acutetech and @Burzo am I missing anything else?

victor-wildlife commented 2 months ago

@acutetech This will include the "Device database table" you mentioned, right? copied below for reference.

"last seen time i.e. the time messages arrive. (useful to display info about the health of a device). battery voltage (percent) radio signal strength (I collect RSSI and SNR) Ping Period (an integer) and Ping Units (an enumeration for seconds, minutes, hours, days) - taken together this is the interval between heartbeat messages I have fields for LoRaWAN credentials, even though I am not using these at present. These are DevEui, AppEUI and AppKey. This info needs to be stored somewhere, but perhaps not in the Devices table. Also, this is LoRaWAN-specific, and perhaps we will have devices with different comms (e.g. WiFi or GSM)."

acutetech commented 2 months ago

Sorry Victor I am not sure I understand your question. Rajendar uses the term "devices Collection" whereas in my irrigation controller, where I am using mySQL, I use the term "Devices database table". Same thing.

IMHO some other attributes should be recorded for each device, and I listed some that I am using above.

Trap.nz are taking a different approach, and I can see this has some merit. They have a fairly minimal number of fields for each "Sensor" - see here: https://api2.trap.nz/docs#tag/Sensors/operation/getSensor - I don't know what is in the "meta" attribute. Then they record every message that the sensor sends - and this is where they record RSSI, SNR, battery voltage etc: https://api2.trap.nz/docs#tag/Sensors/operation/getSensorRecords.

Actually, I am conducting a battery life test with two of the WW120 devices. They send messages every 20-30s and have been doing this for months. Last time I looked there were c. 200,000 records for each device. That is a lot of storage. In practice, most of the time only the most recent RSSI, battery voltage value etc is of interest so these could be recorded in the Device record. On the other hand, if every message the device sends is to be saved then it makes sense to place changing values such as RSSI and battery voltage in "Sensor Record" entries - in which case we need a "Sensor Record Collection" in our database.

What do people think?