smurphy
Full Member
Posts: 169
Raspberry Pi: Yes
Other Device: many ...
|
Post by smurphy on Feb 6, 2020 1:33:53 GMT -8
Question to all of you.
Do you actually know that the raspbian is performing data-maintenance runs around 2am, and that it drains, even on the raspberry PI Zero W up to 400mA of power against the regular 150mA? This causes a 650mA power load on the battery, at night, where no support from Solar panels is available.
Question is, do I move the cron.daily to happen to mid-day? or early morning? or late afternoon?
The Pro's for early morning: Not too hot, The Cons Early morning: Battery eventually already drained The pro for midday: Solar array at its full capacity, con: Temperature could be high?
any comments?
|
|
|
Post by SDL on Feb 6, 2020 11:24:14 GMT -8
Smrufy,
I would run it mid-day. That is the best time. I'll have to look up what it is actually doing.
BP
|
|
smurphy
Full Member
Posts: 169
Raspberry Pi: Yes
Other Device: many ...
|
Post by smurphy on Feb 6, 2020 23:39:36 GMT -8
This is what is done by default on a stripped down Raspbian on my raspberry PI W Zero:
pi@raspberrypi:/etc $ ls -l cron.*/* -rw-r--r-- 1 root root 44 Jan 22 11:53 cron.d/skyweather -rwxr-xr-x 1 root root 1478 May 28 2019 cron.daily/apt-compat -rw-r--r-- 1 root root 355 Dec 29 2017 cron.daily/bsdmainutils -rwxr-xr-x 1 root root 1187 Apr 19 2019 cron.daily/dpkg -rwxr-xr-x 1 root root 377 Aug 29 2018 cron.daily/logrotate -rw-r--r-- 1 root root 1123 Feb 10 2019 cron.daily/man-db -rw-r--r-- 1 root root 1403 Mar 21 2019 cron.daily/ntp -rwxr-xr-x 1 root root 249 Sep 27 2017 cron.daily/passwd -rwxr-xr-x 1 root root 191 Feb 22 2012 cron.hourly/fake-hwclock -rwxr-xr-x 1 root root 813 Feb 10 2019 cron.weekly/man-db The man-db is not required. logrotate is a must, bsdmainutils is not required (calendar maintenance script), man-db generate the mandbase Database. Even I as an old linux geek using linux for 26 years now, I barely use the man-db system anymore.
dpkg keeps backups of dpkg databases keep user data. And apt-compat will perform the unattended upgrades. I'll rpobably remove ntp, man-db, bsdmainutils. The rest I'll leave. Keeping IOT systems up to date is very impoartant from experience.
|
|
|
Post by intihuatana on Apr 6, 2020 14:02:11 GMT -8
Hello smurphy, hello BP,
great work with the power consumption! Which jobs can I deactivate and which are mandatory? Also a Pi Zero in use.
Best regards Joe
|
|
smurphy
Full Member
Posts: 169
Raspberry Pi: Yes
Other Device: many ...
|
Post by smurphy on Apr 6, 2020 23:28:56 GMT -8
Hia, you can disable (remove) all the jobs you don't need. I have disabled bsdmainutils, man-db and ntp. Log rotation is required, dpkg too as I update my OS at night, passwd too - it takes a backup of the current password file if it has changed. All the rest - I deactivated (chmod 600 [file] - if the script is not executable, it will not be executed).
|
|
|
Post by intihuatana on Apr 7, 2020 0:34:05 GMT -8
Hello smurphy,
the following jobs are running on my pi zero w:
-rwxr-xr-x 1 root root 539 Apr 5 2018 cron.daily/apache2 -rwxr-xr-x 1 root root 1474 Sep 13 2017 cron.daily/apt-compat -rwxr-xr-x 1 root root 314 Apr 19 2017 cron.daily/aptitude -rwxr-xr-x 1 root root 355 Oct 25 2016 cron.daily/bsdmainutils -rwxr-xr-x 1 root root 1597 Feb 22 2017 cron.daily/dpkg -rwxr-xr-x 1 root root 89 May 6 2015 cron.daily/logrotate -rwxr-xr-x 1 root root 1065 Dec 13 2016 cron.daily/man-db -rwxr-xr-x 1 root root 249 May 17 2017 cron.daily/passwd -rw-r--r-- 1 root root 712 Jan 1 2017 cron.d/php -rwxr-xr-x 1 root root 191 Feb 22 2012 cron.hourly/fake-hwclock -rwxr-xr-x 1 root root 723 Dec 13 2016 cron.weekly/man-db
Which are superfluous? I only use SkyWeather "Solar" on this pi zero. Best regards Joe This is what is done by default on a stripped down Raspbian on my raspberry PI W Zero:
pi@raspberrypi:/etc $ ls -l cron.*/* -rw-r--r-- 1 root root 44 Jan 22 11:53 cron.d/skyweather -rwxr-xr-x 1 root root 1478 May 28 2019 cron.daily/apt-compat -rw-r--r-- 1 root root 355 Dec 29 2017 cron.daily/bsdmainutils -rwxr-xr-x 1 root root 1187 Apr 19 2019 cron.daily/dpkg -rwxr-xr-x 1 root root 377 Aug 29 2018 cron.daily/logrotate -rw-r--r-- 1 root root 1123 Feb 10 2019 cron.daily/man-db -rw-r--r-- 1 root root 1403 Mar 21 2019 cron.daily/ntp -rwxr-xr-x 1 root root 249 Sep 27 2017 cron.daily/passwd -rwxr-xr-x 1 root root 191 Feb 22 2012 cron.hourly/fake-hwclock -rwxr-xr-x 1 root root 813 Feb 10 2019 cron.weekly/man-db The man-db is not required. logrotate is a must, bsdmainutils is not required (calendar maintenance script), man-db generate the mandbase Database. Even I as an old linux geek using linux for 26 years now, I barely use the man-db system anymore.
dpkg keeps backups of dpkg databases keep user data. And apt-compat will perform the unattended upgrades. I'll rpobably remove ntp, man-db, bsdmainutils. The rest I'll leave. Keeping IOT systems up to date is very impoartant from experience.
|
|
smurphy
Full Member
Posts: 169
Raspberry Pi: Yes
Other Device: many ...
|
Post by smurphy on Apr 7, 2020 0:54:31 GMT -8
I see you run a complete installation, and not a stripped down version of the OS. I suppose you can disable man-db (daily/weekly), ntp (it is just for keeping stats anyway), bsdmainutils. I don't know what the apache script does - so can't comment on that.
|
|
|
Post by intihuatana on Apr 7, 2020 1:12:10 GMT -8
It's my first Pi and also my first weather station - so I can't say what the web server does there. Test as well as solution:
|
|
smurphy
Full Member
Posts: 169
Raspberry Pi: Yes
Other Device: many ...
|
Post by smurphy on Apr 7, 2020 23:02:06 GMT -8
|
|
|
Post by intihuatana on Apr 8, 2020 1:08:26 GMT -8
Hello smurphy,
thanks for the summary. I discovered your site yesterday and copied many things already! I removed the Apache2 via purge.
"~#" that means "sudo" right?
With which commands do I get the nice overview of running programs at the bottom of your page including memory usage?
At the moment I have the tensions displayed as text on the graphic every five minutes. Voltage itself is probably useless, I will add the amps or watts.
How do I get the "mytext" at the side of the graphic or how do I insert "Return" there?
My idea is to evaluate the daylight (lux) and switch off the camera until this value is high enough again. storing energy.
Best regards Joe
|
|
smurphy
Full Member
Posts: 169
Raspberry Pi: Yes
Other Device: many ...
|
Post by smurphy on Apr 8, 2020 5:46:19 GMT -8
Hia program I use is "free" and "pstree" - it is on every system. For a real-time refresh, use "top" (use q to exit). You are talking about the pictures taken by the SkyCam right? Probably a \n should include a newline char into the text. IMHO - on LiPo Batteries - the voltage is the better indicator. The amperage will only show you how much current is being used, and don't forget that it is a information over time value. Means, you can draw 1A when the battery is full, and also 1A when the battery is empty. It will however not tell you how much charge is left. The Voltage will be able to tell you more on that. Or just implant the Voltage. I currently have made it like this: stargate.solsys.org/mod.php?mod=weatherIt shows all details. In fact, I'm waiting to put the Weather station to its intended spot. As soon as that is done, I can work on my UI/presentation a little more
|
|
|
Post by intihuatana on Apr 9, 2020 9:14:01 GMT -8
O.k. super! Ich schreibe es kurz auf Deutsch.
Genau so würde es mir bereits ausreichen um weitere Dinge vorzunehmen. Die Spannung des Solarpanels meinte ich, die ist ohne Angabe des Stroms sinnfrei. Bereits kleine Anzeichen von Licht fördert eine hohe Spannung, aber kaum Strom.
Bei der Batterie ist die Spannung natürlich ein sehr guter Indikator, außer wenn sie defekt ist - Innenwiderstand wäre das nächste Projekt ;-)
In deiner guten Anleitung taucht dies hier auf: ~# -> Synonym für sudo, oder?
Das liefert pstree bei meinem System: Was kann davon deinstalliert werden?
pstree systemd─┬─agetty ├─cron ├─dbus-daemon ├─dhcpcd ├─dnsmasq ├─haveged ├─mysqld───26*[{mysqld}] ├─pigpiod───3*[{pigpiod}] ├─rsyslogd─┬─{in:imklog} │ ├─{in:imuxsock} │ └─{rs:main Q:Reg} ├─sshd───sshd───sshd───bash───pstree ├─sudo───python ├─sudo───python─┬─{HCEC Notify} │ ├─{HDispmanx Notif} │ ├─{HTV Notify} │ ├─{VCHIQ completio} │ └─13*[{python}] ├─systemd───(sd-pam) ├─systemd-journal ├─systemd-logind ├─systemd-timesyn───{sd-resolve} ├─systemd-udevd └─2*[wpa_supplicant]
|
|
smurphy
Full Member
Posts: 169
Raspberry Pi: Yes
Other Device: many ...
|
Post by smurphy on Apr 9, 2020 23:44:33 GMT -8
I'll go back in English (so the others understand). In case you need a German chat - PM me and we can sync up You are right. The Solar Panel is just an indication. Actually, you will have very smallcurrents flowing. But these can be ignored. If you check my Solar panel graphs (end of the page) - stargate.solsys.org/mod.php?mod=systat&op=list&host=11 - and compare the time with the illumination - I state to have enough light to power the Weather station when It reaches 4500 Lux. But then, the battery is not being charged. We are only powering the weather station. Reason that for charging the battery we need at least 12000 Lux to provide a charge for the next night and eventual Day (At least, with my 7800 mAh battery)
Regading the mysql-db you run on you PI. The reason I do hold the mysqldb off-weather station is that mysql wears out the SD-Card very fast. Having 5 Media centers at home, I did test it through time. With a mysqldb and a heavily used media center, the SD-Card did hold around 2 years. I made sure that this weather station SD Card should hold around 5 years by offloading and minimising all disk-writes.
But in general, from you pstree, I think you have most of what is not required, removed.
|
|
|
Post by intihuatana on Apr 10, 2020 13:55:00 GMT -8
If you check my Solar panel graphs (end of the page) - stargate.solsys.org/mod.php?mod=systat&op=list&host=11 - and compare the time with the illumination - I state to have enough light to power the Weather station when It reaches 4500 Lux. But then, the battery is not being charged. We are only powering the weather station. Reason that for charging the battery we need at least 12000 Lux to provide a charge for the next night and eventual Day (At least, with my 7800 mAh battery)
I took a look at your data. Tomorrow I will have completely collected mine in the video every 5 minutes over 24 hours. What I can see so far is that the system needs continuously more than 1.5 Watt. The base load in your graphic is 0.8 watts before 0.8W/5V=160mA. Because I don't want to manipulate the data via the database directly in the weather station, I stopped the dB service for now.
Which services are still superfluous so that I save as much energy as possible?
systemd─┬─agetty ├─cron ├─dbus-daemon ├─dhcpcd ├─dnsmasq ├─haveged ├─pigpiod───7*[{pigpiod}] ├─rsyslogd─┬─{in:imklog} │ ├─{in:imuxsock} │ └─{rs:main Q:Reg} ├─sshd───sshd───sshd───bash───pstree ├─sudo───python ├─sudo───python─┬─{HCEC Notify} │ ├─{HDispmanx Notif} │ ├─{HTV Notify} │ ├─{VCHIQ completio} │ └─14*[{python}] ├─systemd───(sd-pam) ├─systemd-journal ├─systemd-logind ├─systemd-timesyn───{sd-resolve} ├─systemd-udevd └─2*[wpa_supplicant]
|
|
smurphy
Full Member
Posts: 169
Raspberry Pi: Yes
Other Device: many ...
|
Post by smurphy on Apr 12, 2020 1:15:44 GMT -8
├─sudo───python─┬─{HCEC Notify} │ ├─{HDispmanx Notif} │ ├─{HTV Notify} │ ├─{VCHIQ completio} │ └─14*[{python}] Definitely this one. CEC ius multimedia communicaiton that is not required me thinks. 1.5W is definitely way too much for the PI Zero. This is my Power Usage:
Note however that the power usage here does not take into account the losses induced by elecrtonics for the solar panels etc. Try running a "top" to see which process is using up your cpu resources.
|
|