Hi Robert,
Thanks for taking the time and effort with the projects you've created.
I'm really enjoying tinkering with the Arduino projects. (I'm also building the dew controller)
I have a suggestion for the GPS project,
I noticed it displays the time in UTC format,
so I added a few lines in the OLED code to display "UTC":
However I'm thinking it would be great if you could change a variable for your own timezone, so that the time is displayed (on the oled) in local format.
So you could have a variable as timezone offset ( eg: +8 , or +10) and it would then display the time locally.
and maybe also have a variable for 12/24hr mode.
Would this affect the serial output to ASCOM?
I'm guessing it expects to see the time in UTC format.
edit: After some research it looks like a libary could be included to implement this.
The library also caters for daylight savings changes https://github.com/JChristensen/Timezone
Last edit: Matt 2020-07-13
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The GPS project was a simple device to input GPS data into something like EQMOD or Astroplanner. It was never my intent to make it into something bigger.
As the GPS provides "GPS" data to other programs, the xpectation is that wille be UTC, as that is what is output by all GPS systems.
In terms of "Loc" not that simple. I had looked at Timezone mentioned by your post sometime ago.
To do this correctly is is not just time zone offset but also DLS settings as well.
The newer mySQM+ project does all of this and more, using NTP, GPS and RTC code.
However, the code is all here and anyone can make changes and add/delete what they want. I really do not plan on making any changes to the GPS code.
Kind regards
Robert
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Would this affect the serial output to ASCOM?
Not a good idea as it would break other apps I currently use
I'm guessing it expects to see the time in UTC format.
yes it does
Last edit: brownrb 2020-07-13
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have also attached image of display, (with GPS coordinates blacked out)
( moved 'Fix' and 'Quality' to the same bottom line of the oled screen )
With the library the timezone label AEST should automatically change to ADST when DST takes effect (1st Sunday in October at 2am)
I also configured it so it only calculates the local time when a GPS fix is detected.
None of this affects the serial NMEA output,
only the OLED display and I kept the time format as 24hr time for simplicity.
Happy to share the rest of the code in case anyone else would like this.
(NB: I'm a bit of a newbie with arduino coding so please let me know if my coding can be improved on.)
I'll be using this to feed into my APT software using a Skywatcher EQ6r via EQMod
Hi Matt
I will take a look and thank you for you efforts
I use the GPS as is in UTC to feed into EQMOD and it handles things just fine.
So I did not see a need to impleement a LOC time but ys that might be useful on the OLED display.
I will get back after taking a look at the code.
Cheers
Robert
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Robert,
I'll include my code here for reference.
I'm sure you'll be able to improve on it, this is just what I added to get it working.
Matt
#include<Timezone.h>//https://github.com/JChristensen/Timezone
#include<TimeLib.h>//https://github.com/PaulStoffregen/Time//myTimeZone-usersonlyneedchangethissectionTimeChangeRulemySTD= {"AEST", First, Sun, Apr, 3, 600}; // UTC + 10 hours - standard time starts 'first' 'Sunday' 'April' at '3am' 10hrs = 600minTimeChangeRulemyDST= {"AEDT", First, Sun, Oct, 2, 660}; // UTC + 11 hours - daylight time starts 'first' 'Sunday' 'Oct' at '2am' 11hrs = 660minTimezonemyTZ(myDST, mySTD);TimeChangeRule*tcr; // pointer to the time change rule, use to get timezone abbrev eg: AEST/AEDT - I used this for the oled displaycharlocalTime[] ="00000000"; // used by sprintf to format local timezone displays (this could be improved on as it will display 0's until updated)//thisiswhereIaddedthesectiontogetthegpstime, thensendtothetimezonelibrarytocalculatethelocaltime//thiscouldbeimprovedonorrelocated//ideallydetectwhenGPShasvalidtime-onlyneedsonesatellite//I've seen GPS not have a fix, but still have valid date/timeif(GPS.fix!=1)myoled.Display_Inverse(); elsemyoled.Display_Normal();setTime(GPS.hour, GPS.minute, GPS.seconds, GPS.day, GPS.month, GPS.year+2000); //set the arduino time to GPS (hr,min,sec,day,mnth,yr)time_ttzutc=now();time_ttzlocal=myTZ.toLocal(tzutc, &tcr); // call the library to convert to my timezonesprintf(localTime, "%02d:%02d:%02d", hour(tzlocal), minute(tzlocal), second(tzlocal)); // format local time from conversion//addedthissectionforoledtodisplayUTCandmyTimezone//sectiontodisplayGPSUTCtimemyoled.print(mytime);myoled.println(" UTC"); // added UTC label//sectiontodisplaylocalregionaltimemyoled.print(" : "); // no need to redisplay "Time:" labelmyoled.print(localTime);myoled.print("");myoled.println(tcr->abbrev); // automatically display AEST or ADST//modifiedlastoledlinetoincludebothfixandquality//referpreviousoledimageattachmentsprintf(tmpstr, "Fix : %d", GPS.fix);myoled.print(tmpstr);sprintf(tmpstr, " Qlty: %d", GPS.fixquality);myoled.println(tmpstr);
Last edit: Matt 2020-07-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Matt
5 months have passed and I am now back to revisit this.
very impressed.
Do you mind if this code snippet from you is included in the next update of the firmware?
Regards
Robert
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No probs, you sure can.
The code isn't mine, I merely adapted it from the relevant github pages.
I can confirm the DST time and label kicked over nicely when it came into effect in October.
Hopefully you can improve the code a little in the way it updates and also the initial display before it gets a time sync / sat lock.
I'm finally putting together your dew controller project into a case.
Going to need it before Winter comes around again.
Will post some pics of that in the relevant forum/pages once I finish it.
Thanks
Matt
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Robert,
Thanks for taking the time and effort with the projects you've created.
I'm really enjoying tinkering with the Arduino projects. (I'm also building the dew controller)
I have a suggestion for the GPS project,
I noticed it displays the time in UTC format,
so I added a few lines in the OLED code to display "UTC":
sprintf( mytime, "Time: %02d:%02d:%02d", GPS.hour, GPS.minute, GPS.seconds);
sprintf( mydate, "Date: %02d/%02d/%04d", GPS.day, GPS.month, GPS.year + 2000);
myoled.clear();
myoled.println(mydate);
myoled.print(mytime);
myoled.println(" UTC");
However I'm thinking it would be great if you could change a variable for your own timezone, so that the time is displayed (on the oled) in local format.
So you could have a variable as timezone offset ( eg: +8 , or +10) and it would then display the time locally.
and maybe also have a variable for 12/24hr mode.
Would this affect the serial output to ASCOM?
I'm guessing it expects to see the time in UTC format.
edit: After some research it looks like a libary could be included to implement this.
The library also caters for daylight savings changes
https://github.com/JChristensen/Timezone
Last edit: Matt 2020-07-13
Hi Matt
The GPS project was a simple device to input GPS data into something like EQMOD or Astroplanner. It was never my intent to make it into something bigger.
As the GPS provides "GPS" data to other programs, the xpectation is that wille be UTC, as that is what is output by all GPS systems.
In terms of "Loc" not that simple. I had looked at Timezone mentioned by your post sometime ago.
To do this correctly is is not just time zone offset but also DLS settings as well.
The newer mySQM+ project does all of this and more, using NTP, GPS and RTC code.
However, the code is all here and anyone can make changes and add/delete what they want. I really do not plan on making any changes to the GPS code.
Kind regards
Robert
In answer to
Would this affect the serial output to ASCOM?
Not a good idea as it would break other apps I currently use
I'm guessing it expects to see the time in UTC format.
yes it does
Last edit: brownrb 2020-07-13
Hi Robert
Thanks for the valuable feedback.
I can appreciate that you have time invested in many other projects. : )
I spent some time on this ( mostly for my own learning purposes )
and was able to implement the library from
https://github.com/JChristensen/Timezone
The way I set it up means the local timezone can easily be changed.
( It's a bit like Cisco config
clock timezone AEST 10 0
clock summer-time ADST recurring 1 Sun Oct 2:00 1 Sun Apr 3:00 )
The oled display now has a second line like this:
I have also attached image of display, (with GPS coordinates blacked out)
( moved 'Fix' and 'Quality' to the same bottom line of the oled screen )
With the library the timezone label AEST should automatically change to ADST when DST takes effect (1st Sunday in October at 2am)
I also configured it so it only calculates the local time when a GPS fix is detected.
None of this affects the serial NMEA output,
only the OLED display and I kept the time format as 24hr time for simplicity.
Happy to share the rest of the code in case anyone else would like this.
(NB: I'm a bit of a newbie with arduino coding so please let me know if my coding can be improved on.)
I'll be using this to feed into my APT software using a Skywatcher EQ6r via EQMod
Thanks again
Matt
Last edit: Matt 2020-07-29
Hi Matt
I will take a look and thank you for you efforts
I use the GPS as is in UTC to feed into EQMOD and it handles things just fine.
So I did not see a need to impleement a LOC time but ys that might be useful on the OLED display.
I will get back after taking a look at the code.
Cheers
Robert
Thanks Robert,
I'll include my code here for reference.
I'm sure you'll be able to improve on it, this is just what I added to get it working.
Matt
Last edit: Matt 2020-07-30
Hi Matt
5 months have passed and I am now back to revisit this.
very impressed.
Do you mind if this code snippet from you is included in the next update of the firmware?
Regards
Robert
Hi Robert
No probs, you sure can.
The code isn't mine, I merely adapted it from the relevant github pages.
I can confirm the DST time and label kicked over nicely when it came into effect in October.
Hopefully you can improve the code a little in the way it updates and also the initial display before it gets a time sync / sat lock.
I'm finally putting together your dew controller project into a case.
Going to need it before Winter comes around again.
Will post some pics of that in the relevant forum/pages once I finish it.
Thanks
Matt