The use of the ESP8266 in the world of IoT

User avatar
By maxte
#72232 Hello, I'm sending every 60 minutes weight, temp with an esp8266 to a database. I 'm using ESP.deepSleep. Now I when working on the hive you add weight like new frames or you remove them. So I need to know the difference which caused by the maintenance.
In professional products they do it with a key switch. So before opening the hive you set the key to mainantance mode and when finished back to normal operation.
As I know ESP.deepSleep works only when resetting the esp and interrupt on pin change is also missing on the esp.
Do you have any ides how to solve this?
User avatar
By schufti
#72263 unfortunately it is not at all clear what you want to achieve.
Do you want no datagram during maintenance, an indicator that there was maintenance with next datagram, extra datagram to signal maintenance or else ...
User avatar
By rudy
#72267 One solution is to have a switch available that you would switch into the Maintenance mode. Then press a second switch to cause a reset. The esp would wake, see that it is not an hourly periodic wake, and take appropriate actions.

If the maintenance time was short, and power consumption was not a critical issue (battery power with solar charging), then the esp could watch the maintenance switch. When the switch goes off maintenance the esp reads the new weight and sends that data then updates the timer and goes to sleep. I would do a before and after record. Do a weight at the start and end of the maintenance.

There are various ways this can be implemented. Different switch devices and how to generate the reset.
User avatar
By ratfink
#72532
maxte wrote:Hello, I'm sending every 60 minutes weight, temp with an esp8266 to a database. I 'm using ESP.deepSleep. Now I when working on the hive you add weight like new frames or you remove them. So I need to know the difference which caused by the maintenance.
In professional products they do it with a key switch. So before opening the hive you set the key to mainantance mode and when finished back to normal operation.
As I know ESP.deepSleep works only when resetting the esp and interrupt on pin change is also missing on the esp.
Do you have any ides how to solve this?


It sounds like we are working on similar projects but you have got further than me!
One of the tricks I am planning on using is a photocell attached to one of the ESP GPIO pins which will via a couple of components trigger a wake from deep sleep by putting a falling edge on the rst pin and immediately send an 'alarm hive roof removed' (the ESP will be on the crown board) message - I'm guessing you might be able to re-purpose this for getting to maintenance mode...

I would be interested to hear how you are getting on as I am only starting out - I so far have some environmental sensors and an MQTT broker on a Raspberry which will eventually publish everything to a db and web site. I have just got some scales to hack to work out how I will do the weight sensing..