TXT: date +%d%m%Y doesn't work

Alles rund um TX(T) und RoboPro, mit ft-Hard- und Software
Computing using original ft hard- and software
Forumsregeln
Bitte beachte die Forumsregeln!
Antworten
hvn
Beiträge: 256
Registriert: 20 Feb 2011, 11:15

TXT: date +%d%m%Y doesn't work

Beitrag von hvn » 05 Feb 2016, 21:46

Hi,

I'm trying to get the date printed on the TXT but this format, which works on Ubuntu and gives e.g. 05022016, gives 'invalid date '%d%m%Y'. How can I get this date correctly on the TXT ?

Thanks,

hvn

Benutzeravatar
ski7777
Beiträge: 870
Registriert: 22 Feb 2014, 14:18
Wohnort: Saarwellingen

Re: TXT: date +%d%m%Y doesn't work

Beitrag von ski7777 » 06 Feb 2016, 13:03

Actually the date feature on TXT isnt working. ft (Hartmud Knecht) said to me that it will be fixed in next update.

hvn
Beiträge: 256
Registriert: 20 Feb 2011, 11:15

Re: TXT: date +%d%m%Y doesn't work

Beitrag von hvn » 06 Feb 2016, 13:59

Thanks. Will have to wait then.

richard.kunze
Administrator
Beiträge: 583
Registriert: 26 Dez 2015, 23:49
Wohnort: Rhein-Main-Gebiet

Re: TXT: date +%d%m%Y doesn't work

Beitrag von richard.kunze » 10 Feb 2016, 14:09

Hi hvn,

I just tried "date +%d%m%Y" on a TXT and got the expected output. The date/time is way off, though (that's the problem ski7777 mentioned above - the "real time" clock on the TXT has quite a bit of drift).

My guess is you forgot the '+' in front of the format string. Some version of the "date" utility accept formats without it, but the version on the txt (from busybox) is picky about this.

HTH,

Richard

Benutzeravatar
ski7777
Beiträge: 870
Registriert: 22 Feb 2014, 14:18
Wohnort: Saarwellingen

Re: TXT: date +%d%m%Y doesn't work

Beitrag von ski7777 » 10 Feb 2016, 14:16

Drift and co are no Problem. But I think Ehen you now try to tebbot the TXT by Pressung the powerbutton or disconnecting the power you will see, that date and time are gone.

Raphael

richard.kunze
Administrator
Beiträge: 583
Registriert: 26 Dez 2015, 23:49
Wohnort: Rhein-Main-Gebiet

Re: TXT: date +%d%m%Y doesn't work

Beitrag von richard.kunze » 10 Feb 2016, 15:00

Hi Raphael,

at least on the TXT I have here (bought end of last year, firmware version 4.2.3.0), date and time are kept over both a reboot and disconnecting the power.

Best regards,

Richard

hvn
Beiträge: 256
Registriert: 20 Feb 2011, 11:15

Re: TXT: date +%d%m%Y doesn't work

Beitrag von hvn » 10 Feb 2016, 15:37

Hi,

I now notice that I made a small (but significant) mistake: I accidentally put a space between + and %d%m%Y. Without that space I'm getting the correct result: 10022016

hvn

Markus Burkhardt
Beiträge: 171
Registriert: 12 Jan 2016, 09:13

Re: TXT: date +%d%m%Y doesn't work

Beitrag von Markus Burkhardt » 10 Feb 2016, 15:59

Hi Raphael,

if your TXT resets the clock if you disconnect the power supply, please check the voltage of the button cell. The voltage should be around 3V.

If you want to set the time and date, use the follwoing guideline:
  • Connect to the TXT via ssh as root.
    Set local time and date with

    Code: Alles auswählen

    date -s 2016.02.10-15:55
    Write local time to the hardware clock

    Code: Alles auswählen

    hwclock -wu
Best regards,
Markus

Benutzeravatar
ski7777
Beiträge: 870
Registriert: 22 Feb 2014, 14:18
Wohnort: Saarwellingen

Re: TXT: date +%d%m%Y doesn't work

Beitrag von ski7777 » 10 Feb 2016, 16:01

Hallo Markus,

ich hatte mit Hartdmut telefoniert und sein TXT vergaß Datum u. Uhrzeit auch immer.
Wir hatten aber nur die normale GUI benutzt.

Ich werde das aber gleich mal ausprobieren local am TXT.

Raphael

Markus Burkhardt
Beiträge: 171
Registriert: 12 Jan 2016, 09:13

Re: TXT: date +%d%m%Y doesn't work

Beitrag von Markus Burkhardt » 10 Feb 2016, 16:10

Hallo Raphael,

ich hatte von einem Kunden gehört, der dieses Problem hatte, aber ich wusste nicht, dass du das warst. Das Problem kann zwei Ursachen haben: entweder die Spannung der Knopfzelle ist zu niedrig oder der Knopfzellenhalter hat eine defekte Lötstelle (falls das der Fall bei dir ist: schicke uns den TXT Controller zum kostenlosen Ersatz). Im Allgemeinen bleibt die Uhrzeit jedoch erhalten.

Viele Grüße
Markus

Benutzeravatar
ski7777
Beiträge: 870
Registriert: 22 Feb 2014, 14:18
Wohnort: Saarwellingen

Re: TXT: date +%d%m%Y doesn't work

Beitrag von ski7777 » 10 Feb 2016, 16:11

Also meine Batterie hat glaube ich 2,6v.
Und den TXT habe ich seit Juli 2015.

Raphael

Markus Burkhardt
Beiträge: 171
Registriert: 12 Jan 2016, 09:13

Re: TXT: date +%d%m%Y doesn't work

Beitrag von Markus Burkhardt » 10 Feb 2016, 16:18

Hallo Raphael,

das ist geradeso zu wenig Spannung. Mit einer Austauschbatterie sollte die Uhrzeit sollte die Uhrzeit erhalten bleiben.

Viele Grüße
Markus

Benutzeravatar
ski7777
Beiträge: 870
Registriert: 22 Feb 2014, 14:18
Wohnort: Saarwellingen

Re: TXT: date +%d%m%Y doesn't work

Beitrag von ski7777 » 10 Feb 2016, 16:20

Dann fahr ich gleich mal in eine Filiale der Supermarktkette mit dem gelben E.

Raphael

Benutzeravatar
ski7777
Beiträge: 870
Registriert: 22 Feb 2014, 14:18
Wohnort: Saarwellingen

Re: TXT: date +%d%m%Y doesn't work

Beitrag von ski7777 » 11 Feb 2016, 11:46

Das wechseln der Batterie hat das Problem behoben.
Ich weiß jetzt auch nicht ob Hartmut das gleiche Problem hat.

Raphael

Markus Burkhardt
Beiträge: 171
Registriert: 12 Jan 2016, 09:13

Re: TXT: date +%d%m%Y doesn't work

Beitrag von Markus Burkhardt » 11 Feb 2016, 13:24

Hallo Raphael,

das freut mich zu hören. Bei Hartmut war es das gleiche Problem.

Viele Grüße
Markus

Antworten