Qrome / marquee-scroller

Marquee Scroller Clock News Weather and More
https://www.thingiverse.com/thing:2867294
MIT License
324 stars 159 forks source link

Time not working in military time #257

Open finnie2006 opened 1 year ago

finnie2006 commented 1 year ago

I am from the netherlands and we use 24 hour clock, but its not working, as soon as i set the time to 24 hours the time is going to 12:00 midnight and not updating to the correct time, as soon as i set it to am pm time it displays the correct time

Qrome commented 1 year ago

What version of the firmware are you running?

finnie2006 commented 1 year ago

3.01

Qrome commented 1 year ago

Going to need more as I can't replicate it and most of the European users use the 24 hour clock.

costascontis commented 1 year ago

i had the same problem too.I change to AM/PM and it was working.Now after rebooting it still shows January 1 12:00 even with AM/PM ...

finnie2006 commented 1 year ago

Yea

Qrome commented 1 year ago

Check that your time db api key is active and valid. I can't replicate this. https://timezonedb.com/register

Qrome commented 1 year ago

Make sure the timezonedb.com endpoint is accessible and not being blocked on your network. You can also connect to the Serial Monitor in the Arduino IDE and view the log as it attempts to get the time and find out what is going on there.

I am not able to replicate the issue.

peterneuteboom commented 1 year ago

-edit- weather data returns just fine. tried another API key for time, same result: time is retrieved correct from timeserver, but clock starts at 12.00 1/1.

Same sort of issue over here (Netherlands). running v 3.01. after reboot clock starts at 12.00 date: thursday 1st of january. attached clock to serial monitor. correct time is retrieved from time server, but wrong date/time are displayed:

17:49:39.079 -> 17:49:39.079 -> Getting Weather Data 17:49:39.079 -> GET /data/2.5/group?id=2756987&units=metric&cnt=1&APPID=** HTTP/1.1 17:49:39.126 -> Waiting for data 17:49:39.126 -> Response Header: HTTP/1.1 200 OK 17:49:39.126 -> lat: 17:49:39.126 -> lon: 17:49:39.126 -> dt: 17:49:39.126 -> city: * 17:49:39.126 -> country: NL 17:49:39.126 -> temp: 0.31 17:49:39.126 -> humidity: 76 17:49:39.126 -> condition: Clouds 17:49:39.126 -> wind: 1.62 17:49:39.126 -> direction: 77 17:49:39.126 -> weatherId: 801 17:49:39.126 -> description: few clouds 17:49:39.126 -> icon: 02n 17:49:39.126 -> timezone: 1 17:49:39.126 -> 17:49:39.126 -> Updating Time... 17:49:39.126 -> essful! 17:49:39.126 -> Getting Time Data for ** 17:49:39.126 -> GET /v2.1/get-time-zone?key=***&format=json&by=position&lat=&lng= HTTP/1.1 17:49:39.544 -> Waiting for data 17:49:39.544 -> { 17:49:39.544 -> "status": "OK", 17:49:39.544 -> "message": "", 17:49:39.544 -> "countryCode": "NL", 17:49:39.591 -> "countryName": "Netherlands", 17:49:39.591 -> "regionName": "", 17:49:39.591 -> "cityName": "", 17:49:39.591 -> "zoneName": "Europe\/Amsterdam", 17:49:39.591 -> "abbreviation": "CET", 17:49:39.591 -> ⸮ "gmtOffset": 3600, 17:49:39.591 -> "dst": "0", 17:49:39.591 -> "zoneStart": 1667091600, 17:49:39.591 -> "zoneEnd": 1679792400, 17:49:39.591 -> "nextAbbreviation": "CEST", 17:49:39.591 -> "timestamp": 1668880179, 17:49:39.591 -> "formatted": "2022-11-19 17:49:39" 17:49:39.591 -> } 17:49:39.591 -> 17:49:39.591 -> Time update unsuccessful! 17:49:39.591 -> Version: 3.01 17:49:39.591 -> 17:49:39.640 -> Displays: 4 17:49:39.687 -> **** 17:49:39.687 -> Clouds 17:49:39.687 -> few clouds 17:49:39.687 -> 0.3 17:49:39.687 -> Thursday, Jan 1, 12:01 AM 17:49:39.687 -> Signal Strength (RSSI): 56%

finnie2006 commented 1 year ago

Also Netherlands here

Qrome commented 1 year ago
  1. Code didn't change
  2. I am not able to replicate it here in the US.

Is the service endpoint really getting a valid response for time there? EU has blocked news services and other things as well.

This is an open source project -- if someone that has the issue can literally debug or test some changes, that would be helpful.

RetroCare commented 1 year ago

Not sure why but a lot of European cities do not work, i am using cityID 2759879 (Almere Netherlands), what i do is take the cityID from Paris to configure the time because that does work and set it back to my own city after time is updated. I tried, Berlin, Brussels, Amsterdam and none of those cityIDs work somehow. I tried 24h clock on and off, neither gives me any time update.

Qrome commented 1 year ago

There is a call that uses the latitude / longitude values to get the time zone. I am wondering if those values have changed in the response.

mats-nk commented 1 year ago

I can confirm that 24H works for me, I live in Sweden. CityID=2698733

Kungsängen, SE, CityID=2698733 GET /v2.1/get-time-zone?key=XXXXXXXXXXXX&format=json&by=position&lat=59.4786&lng=17.7483 HTTP/1.1

Almere Stad, NL, CityID=2759879 GET /v2.1/get-time-zone?key=XXXXXXXXXXXX&format=json&by=position&lat=52.3703&lng=5.2141 HTTP/1.1

But from what I can see there is some parameters missing from your serial log, :

Getting Time Data for 52.3703,5.2141
GET /v2.1/get-time-zone?key=7ZN65IILOWPS&format=json&by=position&lat=52.3703&lng=5.2141 HTTP/1.1
Waiting for data
{
    "status": "OK",
    "message": "",
    "countryCode": "NL",
    "countryName": "Netherlands",
 -->   "regionName": "Flevoland",
 -->   "cityName": "Almere Stad",
    "zoneName": "Europe\/Amsterdam",
    "abbreviation": "CET",
    "gmtOffset": 3600,
    "dst": "0",
    "zoneStart": 1667091600,
    "zoneEnd": 1679792400,
    "nextAbbreviation": "CEST",
    "timestamp": 1669200835,
    "formatted": "2022-11-23 10:53:55"
}

And then you get an Time update unsuccessful! that I don't get!

RetroCare commented 1 year ago

I noticed something, when i reset the clock will be 00:00 and can take from 5 minutes to an hour till it updates the time at this moment. Also i have tried waiting before and nothing happened and thats why i posted my response here. For now it looks like its working for me without issues but it used to update directly after a reboot without waining at all.

peterneuteboom commented 1 year ago

@RetroCare: i can confirm that after a while the time is displayed correct (took up to 30 minutes).

RetroCare commented 1 year ago

I can say now that after a reset (somehow my unit is freezing now and then :) ) it updates immediately now, maybe there was something on the API side of the service not related to the scroller because there was no change in that area of the code. also tested in AP/PM and military and both work as expected now.

finnie2006 commented 1 year ago

Any update?

FrankHovis commented 9 months ago

I'm getting what I think is the same issue. The clock doesn't seem to be getting set:

Updating Time... essful!

Is the output from serial monitor.

RetroCare commented 9 months ago

I want to update my experience with this (EU-The Netherlands), i still get 00:00 at startup of the clock, only when i wait a minute or 3-5 i refresh data from Web and it will fetch current time. eventually it wil sort itself out after a long wait and for quicker clock set i just wait 5 minutes and refresh my data.

finnie2006 commented 9 months ago

I am having the exact same issue