patience4711 / RPI-APS-inverters

a software for a raspberry pi zero to read the production of aps inverters yc600 and qs1
47 stars 4 forks source link

New version 4.1 system information issues #124

Open autourdupc opened 3 weeks ago

autourdupc commented 3 weeks ago

Hello patience.

Burned today a new SD-CARD (just out-of-the-box). I was able to set the Wifi according to my access point.

Next boot is very very long compared to V3.x (> 90 sec)

After a few attemps the system seems to work but there are some things not working as expexted.

Regards, Laurent

patience4711 commented 3 weeks ago

I installed that image often enough to trust that it works ok. At least one other user installed it without problems. So the software seems ok Maybe the network connection didn't succeed the first time and you overlooked that. When it didn't boot normally but in the AP mode, it will reboot automatically after 5min. A normal boot means that the onboard red led is off.

autourdupc commented 3 weeks ago

On rpi-zero2 i still have loopback command issue...

running script sendZigbee.pl... argument is 2710AABBCC sudo /usr/lib/cgi-bin/ecu/testZigbee.cgi 2710AABBCC Content-type:text/html running testZigbee.cgi version 2024-jan-12 script testZigbee running with arg 2710AABBCC sendZigbee write FE032710AABBCCDA nothing on serial0 after 2000 milisec readZigbee inMessage = no answer command processed HTTP:1/1 200 OK

-> This command made the zigbee coordinator crash so now no more values displayed

Not better after a reboot

-> had to "Start coordinator for normal" to get back a working system.

autourdupc commented 3 weeks ago

And finally, after restoring settings, it takes the version number of previous backuped data (it was V4.1 and now showed 3.1)... image

and also - And even for storage place... Thoses values are coming from restored backuped datas image

even after reboot image

patience4711 commented 2 weeks ago

I see that you didn't expand your filesystem. (or do you use a 4Gb sdcard) That is the first and important step to do after first boot-up (please see wiki). If you don't do this, there may be not enough disk space for the system which can lead to malfunction.

Then reboot. Normally the zigbee system should be up now.

If you restored a databas backup, indeed there is a problem here as this backup is a backup of the databases and the settings. So when you restore your backup, you get the version of your backup which is 3_10. This is is a shortcoming in the total concept of the software. Sadly the only thing i can do about this, is issue a software update to correct this. I'l do that soon. But before that i need to be sure that there are no other issues.

At boot the system tries to start the zigbee coordinator. If this failes it will try again every night at 4hr. I don't know why in your case it didn't start but when you can start it via console there is nothing wrong. The zigbee however can get in an "undefined state" when you send it an invalid message.

patience4711 commented 2 weeks ago

After first boot, your filesystem is surely less then 6 gb (the size of the image).

When you restore your backup, you get the version of your backup which is 3_10.

About the custom zigbee command (the loopback test 2710AABBCC) I see that the checksum is not the same as mine, (i have E9) looks like we have an old problem back. I have to investigate what happend here.

patience4711 commented 2 weeks ago

And about expanding the fs or not: The fs info is written once the fs is expanded. So if you don't do that, this info will be incorrect. Via a database restore you inherit this value from your old system (which could be right or wrong). If you not expand, you could run into troubles as your database is growing, logfiles growing, upload of software-upgrade tarballs, databasebackups etc. The minimum size is (on the save side) 8 Gb. Storage size is cheap these days...

I made a softwareupdate RPI-ECU-v4_2 This relocates the infofiles for the version and the fs expand, so that this info is not overwritten by a database restore. At every reboot the filesystem is checked and the filesizeinfo written. Furthermore i changed the testZigbee.cgi so that it uses the sLen function again, so it should work now on your system. I just tested the following:

If you just install the upgrade (without expanding) you will get wrong sdcard info but that should be correct after a reboot. Also the expand button will appear, you can only get that away by clicking it and expand the fs system.

autourdupc commented 2 weeks ago

I did some calculations about quantity of writes on an sd card. My Freepbx running on a sd-card write all on sd... Due to nb cycles available>1000 and wear liveling on sd cards, it can support up to 10 years writing everydays

autourdupc commented 1 week ago

Hello.

I did the 4_2a update, without rebooting.

Got this now... image

And of course, I get the "sys" infos like that (because no reboot) image

In the chart page, got this (always rotating on the left side) image

patience4711 commented 1 week ago

Oke so the loopback issue is gone, you tried it also via the console? Click help in the infopage. You can start coordinator for normal, it checks first if the coordinator is running, if so it skips the start but will write the fs info..

The spinner is new and shown when the chart is slowly loading. In my system i never see it. It should be in the center but it's not, because you probably have to reload the stylesheet (remove browser settings and refresh the page).

There was a problem with calling a script from the chartpage (see issues). Please install update v4_2b

autourdupc commented 1 week ago

Hello.

This morning, the "SYS" menu displays all the data ! image

It seems that it is working correctly and update once a day the SD-CARD occupation... Nice job !

As you can see, there is still 1,2 Gb available, large enought to work a very very long time (and I did not expand - the size is by default).

patience4711 commented 1 week ago

That is already outdated haha. I found a way to get the info page to retrieve real-time info about the disk space. No more file writing/reading and always up-to-date. Available within the next update... If you can't wait then, in the file /var/www/html/protected/info.php you can replace the part * disk info ** (between the bold lines) wit the code below.

". $vrij . "\
"\";

// *********************   disk info ******************
$disk = shell_exec("df -h | grep /dev/mmcblk0p2");
echo "<br>current sd-card usage:<br> ";
echo"<table><tr><td>filesystem<td>size <td>used <td>available <td>use %";
$items = explode(" ", $disk);
$removed = array_pop($items); // remove the last element
echo "</td><tr>";
// print the array items, skip when empty
foreach($items as $v){
if ($v != '') { echo "<td> ". $v . "</td>";}
}
echo "</table>";
echo "<br>";
// **************  end disk info **********************

$filename = '/var/www/ecu_data/startstop.txt';

and remove this line or comment it (no help button needed anymore <!--<a id='fleft' href='#' onclick='helpfunctie()'>help</a>-->

Btw the amount of available space is a coincident. When i publish an image (original 16Gb), i shrink it as much as possible to just a little of free space, for obvious reasons. This time you got lucky... I would advice to monitor the free space, then you still can expand before you run into problems. I dont know how large the database can grow, especially with multiple inverters.

If you don't mind i will change the redaction and remove some unsignifficant posts form this issue, because it may be discouraging for others. And to prevent that visitors don't have to read things that are not valuable to them.

autourdupc commented 1 week ago

Installed 4_2b -> "b" do not appear in the installed version. Only 4_2 ! image

Also tested loopback -> Great ! image

Remains only one bug... Memory display image

Memory -> False ! Free -> False Used -> False ! image

patience4711 commented 1 week ago

Could you replace the memory part in info.php to see if it fits your needs?

// *********************   memory ******************
$mem = shell_exec("free --mega | grep Mem");
$memitems = explode(" ", $mem);
echo"<table><tr><td style='width:190px;'>Memory usage<td>Total<td>used <td>Free</td></tr><tr><td>Mb's";
$hits = 0;
foreach($memitems as $v){
if ($v != '' && $v != 'Mem:' && $hits <3) { 
   echo "<td> ". $v . "</td>";
   $hits += 1;
   }
}
echo "</table>";
echo "<br>";
autourdupc commented 1 week ago

Could you replace the memory part in info.php to see if it fits your needs?

Its better, and correct now ! image

patience4711 commented 1 week ago

Oke, nobody never noticed that there was something wrong with that. Apparently nobody uses it. I always trusted the method was oke while it uses a linux system command. This method extracts the values in another way. This change is reflected in update v4_2c and yes the version stays v4_2.

autourdupc commented 1 week ago

If you can't wait then

I did... Its perfect ! image

autourdupc commented 1 week ago

Apparently nobody uses it

Not my case... If there is a functionnality available, I try it :) This is why I find so many bugs !

patience4711 commented 1 week ago

If only you find them, i wouldn't call it bugs haha. But i am happy with your approach, it really helps to improve the system.

autourdupc commented 1 week ago

If only you find them, i wouldn't call it bugs haha. But i am happy with your approach, it really helps to improve the system

Its your fault... You told me to expand... So I focused on storage... So info page, so incorrects values... ahahah !

Thank you very much for the job, and your "patience", as always !

autourdupc commented 1 day ago

Hello patience4711.

I did a very little enhancement on the "sys" page (/var/www/html/protected/info.php) I just put a refresh meta in the head of the page so it refreshs every seconds.

It do not charge anymore the processor...

image

image

Regards,