TL-MR3020 timesave - doesn't work

Posted by Smipes 
TL-MR3020 timesave - doesn't work
June 14, 2014 11:21AM
Hi,

so I have trouble getting the timesave to work. I build my box on wednesday as explained in the guide.
Only problem I have is at point 3 under Post-Installation
Quote
3. Activate the “timesave functionality” once:
/etc/init.d/piratebox timesave


After that it says
Quote
Placing Timerecover on Startup
Activating cron-service...
done


But when I turn off my box and later turn it on again, the date is Thu Jan 1 00:00:00 UTC 1970 again and I have to set the correct date and time manually again.

I have a TP-Link TL-MR3020 and a SanDisk USB STICK CRUZER 32GB Extreme USB 3.0.

So, what did I do wrong? Please help smiling smiley

Also: I'm new to this kind of stuff and english isn't my first language.

edit by Matthias: made sticky



Edited 1 time(s). Last edit at 06/16/2014 02:32PM by Matthias.
Re: TL-MR3020 timesave - doesn't work
June 14, 2014 11:02PM
Hi smipes,
no worries about the language.

Can you please check & post the content of the timesave
cat /opt/piratebox/share/timesave_file

And I need the content of the rc.local file

cat /etc/rc.local

Thanks Matthias
Re: TL-MR3020 timesave - doesn't work
June 15, 2014 09:05AM
Mh, that's weird. There is no "timesave_file"

root@piratebox:~# date
Thu Jan  1 00:03:55 UTC 1970
root@piratebox:~# cat /opt/piratebox/share/timesave_file
cat: can't open '/opt/piratebox/share/timesave_file': No such file or directory
root@piratebox:~# cat /etc/rc.local
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

######exit 0
/bin/box_installer_start.sh
 /opt/piratebox/conf/piratebox.conf /opt/piratebox/bin/timesave.sh recover
 /opt/piratebox/conf/piratebox.conf /opt/piratebox/bin/timesave.sh recover
 /opt/piratebox/conf/piratebox.conf /opt/piratebox/bin/timesave.sh recover
 /opt/piratebox/conf/piratebox.conf /opt/piratebox/bin/timesave.sh recover
 /opt/piratebox/conf/piratebox.conf /opt/piratebox/bin/timesave.sh recover

Re: TL-MR3020 timesave - doesn't work
June 15, 2014 10:20AM
I was just looking around to try and find the answer to exactly the same problem ...

My PirateBox is an TL-MR3040. Outputs to both those shell commands are identical to Smipes' above.

I also tried:

root@piratebox:~# hwclock -w
hwclock: can't open '/dev/misc/rtc': No such file or directory

..after I'd set system time.

Otherwise my new PB is working just fine.

Andrew
Re: TL-MR3020 timesave - doesn't work
June 15, 2014 09:18PM
Hi,
I think I just got the idea of the problem:

The initial timesave did not work, because the box itself hasn't set a date&time.
I created a fix a while ago, that the Box only creates the timesave file, if it is beyond a date, that we are sure the date was set once.
Because in the post-installation steps, we haven't described to set the date+time once, the setup of the timesave incomplete.

please run the following command:

date CCYYMMDDhhmm

Where you exchange the characters with date+time letters.

Like the 1st July 2014 , 14:05 ( 02 pm):

date 201407011405

after this run:

/opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf save

Then it should work after the next reboot.

Can you please verify this?

Thanks

Matthias
Re: TL-MR3020 timesave - doesn't work
June 16, 2014 09:12AM
Hi Matthias,

I got this:

root@piratebox:/mnt/usb/PirateBox/Shared# date
Thu Jan  1 00:09:33 UTC 1970
root@piratebox:/mnt/usb/PirateBox/Shared# date 201406162053
Mon Jun 16 20:53:00 UTC 2014
root@piratebox:/mnt/usb/PirateBox/Shared# /opt/piratebox/bin/timesave.sh /opt/pi
ratebox/conf/piratebox.conf save
-ash: /opt/piratebox/bin/timesave.sh: not found

So I guess it won't work. confused smiley

Regards

Andrew
Re: TL-MR3020 timesave - doesn't work
June 16, 2014 02:28PM
It saved the date but didn't set it.
root@piratebox:~# date
Thu Jan  1 00:06:23 UTC 1970
root@piratebox:~# cat /opt/piratebox/share/timesave_file
201406160645
root@piratebox:~# cat /etc/rc.local
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

######exit 0
/bin/box_installer_start.sh
 /opt/piratebox/conf/piratebox.conf /opt/piratebox/bin/timesave.sh recover
 /opt/piratebox/conf/piratebox.conf /opt/piratebox/bin/timesave.sh recover
 /opt/piratebox/conf/piratebox.conf /opt/piratebox/bin/timesave.sh recover
 /opt/piratebox/conf/piratebox.conf /opt/piratebox/bin/timesave.sh recover
 /opt/piratebox/conf/piratebox.conf /opt/piratebox/bin/timesave.sh recover
root@piratebox:~#
Re: TL-MR3020 timesave - doesn't work
June 16, 2014 02:32PM
Hi Andrew!

Is you piratebox working correctly? On my box, that worked out. I just checked.

But anyway. I just found out that with 1.0 I broke that functionality.

1. There is a missing "then" in the timesave.sh file, that causes to fail the recovere, when i havn't made a mistake in
2. The package creating the entries in /etc/rc.local is wrong. That script flipped the parameters. As Andrew posted above
Quote

/opt/piratebox/conf/piratebox.conf /opt/piratebox/bin/timesave.sh recover
should be
Quote

/opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf recover

I'll do a closer look later this day and prepare a fix release. I already found issue 1 (missing then), when i started with the RPi version.

Sorry for the inconvenience.

Matthias
Re: TL-MR3020 timesave - doesn't work
June 17, 2014 05:31AM
Hi Matthias,

No inconvenience, don't worry about it.

But yes, my PirateBox is a little flakey. It doesn't boot up into a usable state every time.

Sometimes the wifi SSID is there, but although other devices can acquire the wireless signal, the PB won't serve the Home page and I can't ssh in even with an ethernet connection. So I have to reboot it.

Sometimes it boots and wifi works AND I can ssh in and all the files are there; but while the Home page is served, the link to Browse Files goes straight back to the Home page again. So I reboot it and ...

At the moment it's up and running apparently normally. I don't want to turn it off now. winking smiley

Kind Regards

Andrew
Re: TL-MR3020 timesave - doesn't work
June 17, 2014 07:17PM
Hi Andrew,
this has nothing to do with that timesave thing.
Maybe you should open a 2nd thread and point out your hardware u are using.

For me sometimes, I need to reboot my box for myself... but It is mostly about that crappy hardware winking smiley

Matthias


I'm sorry for long response times, it is still my free time project.
About Matthias ; Flattr
Re: TL-MR3020 timesave - doesn't work
June 30, 2014 06:35AM
Confirm. timesave.sh line73 Syntax error unexpected "else" (expecting "then"winking smiley
Re: TL-MR3020 timesave - doesn't work
June 30, 2014 04:27PM
exact, and the command in /etc/rc.local is flipped wrongly .... -.-

I'm still working on patch instructions and testing around (adding more patches)


I'm sorry for long response times, it is still my free time project.
About Matthias ; Flattr
Hi Matthias,

any update on the time save glitch?


Thanks

Joel
Re: TL-MR3020 timesave - doesn't work
July 05, 2014 07:19AM
Hi Joel,
the bug itself is fixed on github and I already packed a beta version together.
While writing update instructions, I found some other bugs I needed to fix... and then test.

Beside all the support requests and prepares for the camp, I don't find much time for code right now sad smiley

Sorry.

Matthias
Hi Mathias,

No worries! I was just too excited for the update on piratebox. smileys with beer
Anyway great work and more power to you and the piratebox team!

Regards

Joel
Re: TL-MR3020 timesave - doesn't work
July 11, 2014 10:22AM
I just spent a maddeningly long time trying to fix this. I really should check sticky threads more often. lol

Let us know when that bigfix is ready, man. Thank you for all your hard work! You're kinda awesome. smiling smiley
Re: TL-MR3020 timesave - doesn't work
July 16, 2014 06:08PM
Thank you, we already tested the fix at the Camp. I need to adjust one tiny thing, then we can go to public testing of 1.0.x

Matthias


I'm sorry for long response times, it is still my free time project.
About Matthias ; Flattr
Re: TL-MR3020 timesave - doesn't work
August 22, 2014 04:36AM
For Fix see here: [forum.piratebox.cc]
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: