at start i wanted to monitor 2 SOS buttons for seniors. My first idea was to use a rfbridge sonoff programmed with tasmota and a MQTT on mobile, but a MQTT client working full time in a mobile take more than 30% of battery : it is not usable.
second idea was to use a gateway between rfbridge and my mobile. in this case configuration is this one:
the gateway is a MQTT client on ESP8266 built with B4R and it is interface interrogated by this application. (code is in B4R side)
MQTT broker is cloudMQTT.com
on Android side, i built a MQTT client dedicted at SOS buttons monitoring
- MQTT client is a service running 15sec and sleeping 1mn (or more) => in this configuration it take less than 3% of battery
- we have a sound alarm 4sec each minute until alarm is removed
- we can choose one alarm between 8 available
- we have a permanent log with the 20 last alarm status
- we have an activity dedicated at configuration with a password before access
- we can make provisioning for MQTT, subscription, SOS keys and notification sound
- we have a big button moving to red when we have alarm
- we have a button to erase alarm
- we have a button to erase log file
- we have a notification without sound each time service is running
- we have a notification with sound each time we check alarms and if we have alarm (every minutes until reset of alarm)
- period of monitoring can be from 30sec to 5mn, with corresponding impact on battery
- max delay between a SOS button pressed and alarm on mobile is with basic period 1,15mn max
i hope this development done by a beginner on B4A can help others beginners.
second idea was to use a gateway between rfbridge and my mobile. in this case configuration is this one:
the gateway is a MQTT client on ESP8266 built with B4R and it is interface interrogated by this application. (code is in B4R side)
MQTT broker is cloudMQTT.com
on Android side, i built a MQTT client dedicted at SOS buttons monitoring
- MQTT client is a service running 15sec and sleeping 1mn (or more) => in this configuration it take less than 3% of battery
- we have a sound alarm 4sec each minute until alarm is removed
- we can choose one alarm between 8 available
- we have a permanent log with the 20 last alarm status
- we have an activity dedicated at configuration with a password before access
- we can make provisioning for MQTT, subscription, SOS keys and notification sound
- we have a big button moving to red when we have alarm
- we have a button to erase alarm
- we have a button to erase log file
- we have a notification without sound each time service is running
- we have a notification with sound each time we check alarms and if we have alarm (every minutes until reset of alarm)
- period of monitoring can be from 30sec to 5mn, with corresponding impact on battery
- max delay between a SOS button pressed and alarm on mobile is with basic period 1,15mn max
i hope this development done by a beginner on B4A can help others beginners.