Software apps and online services
I made this project just for fun, as my daughter asked to take a photo of Santa Claus.I already explained to her Santa Claus is magic, and will not be possible, but give it a try.Hardware
I started from what I found useful on my box,
- M5stack, just the core from the Faces kit
- Motion sensor (PIR)
- Some grove cable
- Prototype board
- A custom shell with Lego Pin to fix the units (stl file in attachment)
On the prototype board, I soldered two grove connectors to the main bus, in order to have additional port B (for motion sensor) and port C (originally for the M5Camera). Nothing more than following this map:
Will start describing the M5Camera.
As I deployed some software on it, on the camera there is not the original firmware. I wanted to restore it to use as UIFlow unit but I could not find how to do, then I installed this software: https://github.com/bnbe-club/rtsp-video-streamer-diy-14.
This allows to use the M5Camera as remote camera via HTTP.
I had to just set my Wi-Fi credentials, define the right camera model (see below), get the IP address from serial console, and I can call the JPG endpoint (192.168.2.113/jpg, always the same on my router) to get a photo.If I call directly "/" on the HTTP endpoint, I get a RTSP stream, not needed on my project.
The M5Camera it's connected to port C only to get power, while there is no serial communication between the camera and the M5 coreUIFlow
Every second, if the motion sensor is triggered, via HTTP command I download the current photo from the camera and store it on the SD card.
I had to execute some python code inside UIFLOW, as the HTTP command can return only the text from the call, while I require the content.
Because of that, I used directly fs.write to store the data on the card.I use NTP on the beginning to use timestamp as part of the name
I added also some explicit close to de-allocate some memory, as I had problems with memory allocations during the development.
It was possible to use also my HEX RGB LED Board to make some more light, but actually it's busy with my Christmas BallDisclaimer
No Santa Claus was harmed during the realization of the project
I hope you enjoy this simple project, my daughter does.