I've been playing with motioneyeos to do some simple status monitoring on the vending machine so you can know what is happening remotely.
You can modify the monitor_<CAM_ID> file to show details based on GPIO status. So, making use of the monitoring header on the PCB I can tell if the PIR has been triggered, if the sensors are on, if the timer is active and if the feed level is low. I still need to log events to a log file, and would like to also log short events like deposit and dispense, which can be missed by the motioneyeos monitor since they are very short duration - I'm working on this.
You can also add "action buttons" that show up on the web interface. I have added a couple to allow manual triggering to turn on the sensors and dispense a peanut.
In the end I will monitor the PIR, sensors, hopper level, deposit and dispense events, and if the timer is enabled. Also will allow manual triggering to turn on the sensors or dispense a peanut. You will be able to download and analyze the log file to determine things like how often the PIR triggers, time between deposit and dispense, how many successful interactions and when they occur, etc.
I've added these file to the GitHub repo
- monitor_1 - shows monitoring information on the video feed
- light_on_1 and down_1 - action button scripts to allow manual triggering of sensors and dispensing peanuts
I think this logging and monitoring will make this more useful as an actual tool for animal behavior researchers.
You can see the monitoring info here (lower left corner)
Sensors Off
Sensors On
Update
Deposit and dispense events are too fast to catch with a script, so I will try out gpio interrupts for this.
I was able to set up everything else. It now displays status for:
- PIR
- Sensors
- Timer
- Feed level
- Deposit sensor jams
- Dispense sensor jams
I also added a couple action buttons to let you remotely trigger
- Dispensing a peanut (down arrow)
- Enabling the sensors (light bulb)
You can see the monitoring in the lower left and buttons in the lower right of this image.
The files related to this are on GitHub. Once I find a way to monitor very short GPIO events on the RPi I think this bit will be finished.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.