Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Timezone #5

Closed
eusonlito opened this issue Feb 24, 2023 · 15 comments
Closed

Fix Timezone #5

eusonlito opened this issue Feb 24, 2023 · 15 comments
Assignees
Labels
bug Something isn't working

Comments

@eusonlito
Copy link
Owner

eusonlito commented Feb 24, 2023

No description provided.

@eusonlito eusonlito added the enhancement New feature or request label Feb 24, 2023
@eusonlito eusonlito self-assigned this Feb 24, 2023
@eusonlito eusonlito mentioned this issue Feb 24, 2023
@JakeOcean
Copy link

JakeOcean commented Feb 25, 2023

I was able to finally get my st-902 pointed at my own server. I think I was out of service when I attempted it before -- can these settings be changed with a USB cable?

I am seeing data in my logs. I switched from debug-socket back to h02 -- the messages format is the same

HIDDEN

This data is not visible in the backend, so either the protocol is different, my settings are wrong, or perhaps I do not have the tracker ID entered correctly?

@JakeOcean
Copy link

JakeOcean commented Feb 25, 2023

On the backend my Device serial number is correctly set to HIDDEN

@eusonlito
Copy link
Owner Author

Ok, the data is correct to protocol H02. Let me check if there are some additional column or value not parsed by default regular expression 👍🏿

@JakeOcean
Copy link

After parking my car, several hours later a few trips appeared!

The times are wrong, so I think I need to still set my device to use UTC perhaps?

Either way I think the protocol is working, based on the data, but I will let you know tomororw after I test a bit more.

Screen Shot 2023-02-25 at 8 16 35 PM

@JakeOcean
Copy link

Actually, those times are too late to be UTC... It's not 9:55 UTC on 2/26 yet..

@eusonlito
Copy link
Owner Author

@eusonlito
Copy link
Owner Author

Also you can send a message (same text as SMS) from Devices > Messages. But TCP messages need wait to device wake up to apply the change.

@JakeOcean
Copy link

I was able to update my Tracker to UTC -- thank you so much for your help!

I have my Vehicle set to my local timezone of America/New_York and I just started a new drive -- the time seems to be off by 1 hour, so maybe it is a Daylight savings issue? Either way, not a big deal for now.

I will drive around for a few days and test everything out, and then maybe I can contribute a few updates too if you are open to it

@eusonlito
Copy link
Owner Author

Can you check the server logs if device is reporting the correct UTC time?

[UTC_DATETIME] *HQ,DEVICE_ID,V1,UTC_TIME,...

Or in database tables trip and position, the columns xxxxx_utc_at.

Anyway I will do some tests with your same Timezone because I have found other users with a similae issue: https://stackoverflow.com/questions/74588944/getting-the-difference-in-time1-hour-for-daylight-saving-time-timezones-like-a

@JakeOcean
Copy link

JakeOcean commented Feb 27, 2023

When I check the DB, the UTC time is correct.

I started my trip at 11am est today, which is 4pm UTC. Does your timezone selector take into account daylight savings time? In the Spring and Fall we adjust our clocks 1 hour, which can be a pain in PHP, but thankfully Carbon usually handles it

Screen Shot 2023-02-27 at 2 37 34 PM

EDIT: But you can also see that my End time is not correct. The UTC start/end correctly shows my trips was ~44 mins, but the non UTC values make the trip seem 12+ hours

@eusonlito
Copy link
Owner Author

Do you have enabled automatic timezone in vehicle? Can you show the rows columns in your screenshot?

In my case, with Europe/Madrid, PHP is handling fine the utc to timezone conversion with and without daylight savings...

@JakeOcean
Copy link

I do have auto timezone enabled, should I try and disable?

Here is a screenshot showing the columns, but keep in mind the trips above this one were before I correctly set my devices timezone.

Screen Shot 2023-02-27 at 2 57 36 PM

@eusonlito
Copy link
Owner Author

Yes, try to disable the automatic timezone inside vehicle. Anyway I testing timezone conversions using several timezones.

eusonlito added a commit that referenced this issue Feb 27, 2023
@eusonlito
Copy link
Owner Author

Update the source before try disabling the automatic timezone because there was an bug with boolean casting on vehicle.

@JakeOcean
Copy link

The times are correct now after a pull and disabling autotimezone!

@eusonlito eusonlito changed the title Add Huabao protocol (ST-901A+, ST-902, ST-902W) Fix Timezone Mar 1, 2023
@eusonlito eusonlito added bug Something isn't working and removed enhancement New feature or request labels Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants