Unless a device actually communicates on USB, there is no way to know whether it is plugged in or not. The Pi has not built-in equipment to measure the power supply current, or current in a given USB port. And, as you rightfully notice, such measurement wouldn't be a reliable indicator of connection, because once the battery is charged, it stops drawing ...
I found the issue why it was not recognized.
Problem was the image file. It did not contain a partition.
I found this in the message file of another rasperry pi when I connected the it, and compared it with the messages from the working stick.
It showed "sda:" only and not "sda: sda1" as with the working one.
Feb 17 11:14:59 raspberrypi ...
Download matchbox-keyboard and matchbox-keyboard-im packages (link for Raspbian, if you have Buster, you need .deb files version 0.2 dated 28-Jun-2020). Write installation commands in a text file, e.g.:
sudo dpkg -i matchbox*
<- don't forget the newline after the last command
Put the packages and the text file on the FAT partition of the SD card ...
I tried two different ones: matchbox-keyboard and florence.
You will need a connected USB keyboard to be able to try them. Otherwise, use an SSH connection.
Open a "Terminal" and type sudo apt install matchbox-keyboard. You will find it installed under "Accessories" with the name "Keyboard".
In my opinion, florence is better and ...
After debugging with tcpdump I realized that the router was sending an advertisement. I have also realized that an IPv6 address was assigned to the Pi when running tcpdump. After asking on another forum, I found out that my ethernet adapter fails to handle multicast correctly. This is why it has worked when using tcpdump because tcpdump turns promiscuous ...
If I understand your objectives correctly, it seems that your idea is generally sound. But, the devil is in the details as they say.
Reviewing your diagram:
It appears that the purpose of the Low Battery Cutoff Switch and the N.O. 12 V Relay is to signal the RPi (via GPIO input) that it should execute a shutdown soon. However, 12.3V seems too high for a low-...
I have figured out the cause of this issue, it seems like when the annotator is called several times in the loop it allocates several resources and doesn't release them between loops. The issue was fixed by avoiding to use Annotator and remove it from inside the loop