Storage % not displaying?

Posted by oldchan 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
Storage % not displaying?
July 24, 2018 11:05AM
After I activate the shared_usb, the data percentage bar on the splash page no longer shows anything other than the upload option.

I'm pretty certain this [sudo touch -t 197001010101 /opt/piratebox/www/diskusage.html] command is supposed to fix it? If it is, then it doesn't work on my RPi3B+.
Re: Storage % not displaying?
July 25, 2018 06:59PM
Hi,
no that command will cause the issue :-(

The reason is an integer overflow in the calculation, which render the difference between now and 1970 as something weired.

Set the date/time to the beginning of the month, after that try to push the refresh button on the frontpage.

If that does not work, you might want to have a look at /opt/piratebox/tmp/break.log /opt/piratebox/tmp/error.log

best regards Matthias
Re: Storage % not displaying?
July 26, 2018 04:49AM
Matthias Wrote:
-------------------------------------------------------
> Hi,
> no that command will cause the issue :-(


Oh, ok x_x I'm not sure where in the mods I found that snippet of code, so unfortunately I can't tell you whether it's worded strangely or I read it in a sleep deprived haze.

Matthias Wrote:
-------------------------------------------------------
> If that does not work, you might want to have a
> look at /opt/piratebox/tmp/break.log
> /opt/piratebox/tmp/error.log


I did this, and it shows a couple of registered errors around Kareha and wakautils. But, while looking at the error and break log, I realized the time isn't actually set on the box (it does give a time and date, but it's several months behind.) I saw the the actual PuTTY display had the command sudo systemctl enable rpi_hwclock, so I tried that (I hadn't actually used that command yet.) However it didn't change either the time/date or fix the display issue.

Matthias Wrote:
-------------------------------------------------------
> Set the date/time to the beginning of the month,
> after that try to push the refresh button on the
> frontpage.


Unfortunately manually setting the time/date seems to be a little out of my grasp, looking around on google didn't help much either so I guess I'll ask you! How does one going about manually setting the time and date? I'm fairly certain (after seeing the rpi_hwclock) that a fresh install and using that command at install will probably fix any errors I'm encounter (if it doesn't, I'll post my results here), but knowing how to manually set the time/date can't hurt at all.

Silly me, in the initial documentation when you SSH in: sudo date -s "20170523 1742"

Also, it appears that either my reading comprehension needs improvement, or I should sleep more. the rpi_hwclock requires another bit of hardware. Alright, so next step is to try to follow the instructions that appear in PuTTY to the letter (which didn't even occur to me, I've just been using the HowTo guide). I KNOW that the % has shown up for the SD card prior modifying any settings in PuTTY, will edit with updates.


Thank you for your time!

EDIT:

So, a complete restore and reinstall didn't end up fixing the problem, neither did manually setting the time. Checking the error.log, this is what shows up:

2018-04-24 00:32:05: (server.c.1423) server started (lighttpd/1.4.49)
2018-04-24 00:32:05: (server.c.1452) WARNING: unknown config-key: url.access-de$

The storage % is displayed properly at install. However, whenever using the SD or USB as storage, the % display breaks.

EDIT: Probably already a known issue, but I've at least narrowed it down to USB_share and SD_share as being the key instigator of the display error. As well, with a fresh install I checked error.log again, and it seems this is an issue built into the install process because error.log still contained the same errors, even though I had yet to turn on USB or SD share:

2018-04-24 00:32:03: (server.c.1423) server started (lighttpd/1.4.49)
2018-04-24 00:32:03: (server.c.1452) WARNING: unknown config-key: url.access-de$

If you have any idea where I can go from here in attempting to resolve the issue let me know, until then I'll be scouring the forums on how to access that area. Of course, even if I do I'm still way out of my element lol/.

EDIT: So I found out how to access lighttpd, couldnt see any issues (because I'm not really sure what I'm looking at lol.) So I decided I'd try from a different approach, and what I've gathered is this:

date: cannot set date: Invalid argument
Thu Jan 1 00:11:00 UTC 1970


sudo date -s "19700101 0012"
Thu Jan 1 00:12:00 UTC 1970


So whatever is causing the issues has something to do with 12 past midnight on Jan 1st, 1970. Anything prior to 12700101 0012 is impossible to change the date to.


SO now it has allowed me to put all the way back to 19700101 0002. Weird.



Edited 15 time(s). Last edit at 07/27/2018 01:18AM by oldchan.
Re: Storage % not displaying?
July 28, 2018 12:08PM
Ok, I am now trying to understand... but I guess it is still not working.
Maybe it is some other weird reason why it isn't working.

Ok, lets do it from the command line and see what happens:

Enable Timesave
# Format is:  MMDDhhmmYYYY
# =>                  2018-07-28  14:00
sudo date 072814002018
#
sudo /opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf  install
sudo systemctl enable cronie.service
sudo systemctl start cronie.service

Ok, now try to have a look at the timesave file:
# Set the date of the file to a time back then current
sudo touch -d 2018-07-01 /opt/piratebox/www/diskusage.html
#Generate the diskusage file by Commandline
sudo  DISK_GEN_HTMLFILE=/opt/piratebox/www/diskusage.html  python /opt/piratebox/python_lib/diskusage.py

Ok, this should work then.
One remark: If you have PLEANTY amount of freespace, then the blue bar won't appear..

best regards Matthias
Re: Storage % not displaying?
July 28, 2018 09:56PM
Matthias Wrote:
-------------------------------------------------------
> One remark: If you have PLEANTY amount of
> freespace, then the blue bar won't appear..
>
> best regards Matthias

D'oh. Well, that may be my issue. Sorry for wasting your time x__x