No working leases in persistent database - sleeping _ RPi Zero

444 views
Skip to first unread message

Fox

unread,
May 16, 2022, 2:20:12 AM5/16/22
to motioneye
Hi motioneye specialists,

I'm using motionEyeOs dev 20200606 on a Raspberry Pi Zero board.
After several hours of operation, if the wifi network to which the board is connected has shut down, MotionEyeOs goes to sleep.

But in the menu, I disabled network connection monitoring : Network link is OFF and Connectivity watch is OFF.

Extract of the messages.log :
May 12 02:00:00 CamGCI_2004-1 cron.info crond[1027]: USER root pid 15376 cmd /usr/sbin/dyndns-update
May 12 02:00:42 CamGCI_2004-1 user.notice throttlewatch: currently: ok, temperature: 37 C
May 12 02:01:33 CamGCI_2004-1 daemon.info dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
May 12 02:01:38 CamGCI_2004-1 daemon.info dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
May 12 02:01:42 CamGCI_2004-1 user.notice throttlewatch: currently: ok, temperature: 36 C
May 12 02:01:47 CamGCI_2004-1 daemon.info dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10
May 12 02:01:57 CamGCI_2004-1 daemon.info dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11
May 12 02:02:08 CamGCI_2004-1 daemon.info dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 16
May 12 02:02:24 CamGCI_2004-1 daemon.info dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
May 12 02:02:32 CamGCI_2004-1 daemon.info dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 2
May 12 02:02:34 CamGCI_2004-1 daemon.info dhclient: No DHCPOFFERS received.
May 12 02:02:34 CamGCI_2004-1 daemon.info dhclient: No working leases in persistent database - sleeping.

With the same settings on an RPI 3 card, I didn't encounter the same problem.

I understand that some of you will ask me why the wifi is lost and offer me to fix this problem, but given the conditions of use, it is impossible.

We are using motioneye os on a Raspberry Pi zero to monitor the nesting of an endangered bird.
We are in the middle of nature. We use the smartphone with mobile data enabled for startup. Then we leave the area for a few days.
If we manage to solve this bug, it is a great potential for motionEyeOs which will allow many advances to protect species of birds or bats in danger.

Thank you so much for your help.

Fox.


StarbaseSSD

unread,
May 16, 2022, 8:33:45 AM5/16/22
to motioneye
Since you won't explain why your WiFi dies, (and it's not a 'bug' in motionEyeOS)
Work-around:
Leave network watch off, and connectivity watch off.
Force dhclient to restart every hour or so to wake it up:
add to
crontab -e
0 * * * * /etc/init.d/S40network restart

Unwanted / unsolicited advice from someone who does daily end user support of motionEye /motionEyeOS and uses it for many things:
In your situation (probably battery dying on cell phone/modem dying or going to sleep. Since you can live without the continuous stream, and apparently have to visit the site regularly, why not set the motionEyeOS PiZero as an Access Point? https://github.com/motioneye-project/motioneyeos/wiki/WiFi-Access-Point
This eliminates the need for the cell modem, allows you to connect to it when you are nearby, removes this issue, etc. Use either a very large MicroSDCard (128GB or bigger) for longer storage time, or an external USB drive (1 TB Thumb Drive, SSD as large as you can afford). You are obviously using some sort of solar/battery combo power for the Pi.

Fox

unread,
May 22, 2022, 5:23:05 AM5/22/22
to motioneye
Thank you StarbaseSSD

The WiFi dies because the camera (with pizero) is installed on a beach to observe the activity of a bird on his nest. We study the comportement of this bird to find what are the sources of failure.
We have'nt acces to any wlan or lan. The bird is on wild beach. We use a battery and external usb drive. Every 2 or 3 days, we just change the battery and usb drive in a minimum of time.

Thank you for your link. I don't know why i did'nt saw it before !!! The WiFi-access-point is really what we need.
I will try it.

StarbaseSSD

unread,
May 22, 2022, 7:36:47 AM5/22/22
to motioneye
In your situation, be sure to connect via the AP, and do a proper shutdown (Settings,  General, Power: Shutdown) to make sure all your settings are preserved correctly. I have a set of example files to set up the Access Point function, if you'd like to see them.

Fox

unread,
May 22, 2022, 8:12:46 AM5/22/22
to motioneye
Effectively, i would like to see the set of example files to set up the Acess Point function.
I try to do now but i think i did a mistake.

During the first booting, the system ping 192.168.1.254, but 0 packets received. 
I'm not sure about what i must to configure into the wpa_supplicant.conf : the SSID of my home for this first booting or the SSID wich was defined into the hostapd.conf (or no wpa_supplicant.conf) ?
Maybe my range of IP adress was not correct because in conflict with my home network ?

Fox

unread,
May 22, 2022, 8:15:23 AM5/22/22
to motioneye
hostapd.conf for this first test :

ssid=myssid
wpa_passphrase=12345678
wpa=2
wpa_key_mgmt=WPA-PSK
interface=ap0
channel=1
driver=nl80211
hw_mode=g
ieee80211n=1
ieee80211ac=1

Fox

unread,
May 22, 2022, 8:16:00 AM5/22/22
to motioneye
dnsmasq.conf for this first test :

interface=ap0
dhcp-range=192.168.27.50,192.168.27.150
dhcp-leasefile=/data/dnsmasq.leases

Fox

unread,
May 22, 2022, 8:18:12 AM5/22/22
to motioneye
in os.conf, should i change : OS_WLAN="wlan0" by OS_WLAN="ap0" ?

StarbaseSSD

unread,
May 22, 2022, 8:28:23 AM5/22/22
to motioneye

In the ConfigFiles.zip is a documentation file: MotionEyeOS_AP.txt with full descriptions and instructions.
ConfigFiles.zip

Fox

unread,
May 22, 2022, 9:16:46 AM5/22/22
to motioneye
Thank you so much StarbasSSD.
In hostapd.conf and dnsmasq.conf, i've just changed wlan0 by ap0 and it was a success.
And it's a lot of progress for our CamGCI...

It 'll rest just to test on few days before to modify the wild-cam on the spot.

Have a nice day.

StarbaseSSD

unread,
May 22, 2022, 9:22:37 AM5/22/22
to motioneye
Please update us as to if this was the better solution for you. 
And good wishes to the birds.

Fox

unread,
Sep 12, 2022, 9:05:09 AM9/12/22
to motioneye
Hi,

Our season of monitoring with motioneyeos the birds with motioneyeos on beach is finished. It was good and rich.
The Access Point method was very a success.

But we've missed many time the real date/time. A lot of pictures and videos are saved with 1970-01-01... and it's definitely impossible to analyse it seriously in good order.

But this week i've received and RTC component (DS1307) and i 've tested it with this method.
+ to take control with putty and use these instructions :
date -s "2013-11-19 15:11:40"
hwclock -w

On a short time, it's a success. Now i will test on a long time.

Thank you

StarbaseSSD

unread,
Sep 12, 2022, 9:23:24 AM9/12/22
to motioneye
Thank you for the update, I'm glad you were able to overcome most of your issues.
Please let us know if the RTC module helps with time/date stamps...

BirdiPiDuino

unread,
Oct 7, 2022, 1:49:58 AM10/7/22
to motioneye
Hi StarbaseSSD and every body,
Yes, the RTOC module is very efficient. This one month, with longs shutdowns and never connect to the network, the time/date is fine !
Reply all
Reply to author
Forward
0 new messages