Closed GeorgWolter closed 4 years ago
Set TimeSyncInterval to zero in paxcounter.conf, then time display will be suppressed.
If GPS is not working, check
ttgobeam10
.h according to your picture)If you don't get a fix, go outside and wait some minutes.
Board ttgobeam10.h is (was) configured.
GPS is working...red LED is flashing...I kept the T-BEAM outside for 15 minutes: 7 satellites. But still only 01.Jan 1970 on the display.
Just attached the archive config.zip which contains:
You set #define TIME_SYNC_LORAWAN 1
in paxcounter.conf, meaning that primary time source is LORA. Thus, GPS time will only be used as a fallback, and this takes a while. Set to 0 and try again.
Changed to #define TIME_SYNC_LORAWAN 0 accordingly but still 01.Jan 1970 with Sats:05 on the display. Can / will keep it running for 1h or more.
Attached message found during RUN.
Message is normal, has no impact. To enforce a time sync, send rcommand 0x87 on port 2 (see readme.md).
Still 01.Jan 1970. Attached screenshots from the TTN Console.
Then it's a bug, probably in timekeeper.cpp
, timesync.cpp
or gpsread.cpp
.
Can you spot it?
Until now nothing but I'll try...
I'm getting the same issue and think I have found a fix. Will post details later.
This is what happens:
calibrateTime
is called (and no GPS fix is available = GPS time invalid) the code in timekeeper.cpp
sets timeSource = _gps;
, but the time is not setcalibrateTime(void)
fail to get the GPS time at if (timeSource == _unsynced)
Proposed fix:
if (t) {
// only set time source to GPS if GPS time was actually valid - otherwise
// this will never synchronise.
timeSource = _gps;
}
timeSource != _unsynced
// (only!) if we lost time, - or when no other time source is available - we try
// to fallback to local time source RTS or GPS
if (((!TIME_SYNC_LORASERVER) && (!TIME_SYNC_LORAWAN)) ||
(timeSource == _unsynced)) {
On another look, it might be better to set the time source to _gps
and still call setMyTime
even when the time is invalid, because that will do a check if the time is valid anyway and, if not, schedule a retry after TIME_SYNC_INTERVAL_RETRY
. Otherwise the retry will only occur afer TIME_SYNC_INTERVAL
, which can be a lot later.
// no RTC -> fallback to GPS time
#if (HAS_GPS)
t = get_gpstime(&t_msec);
timeSource = _gps;
#endif
setMyTime((uint32_t)t, t_msec, timeSource); // set time
// do we have a valid time?
if (timeIsValid(time_to_set)) {
...
} else {
timesyncer.attach(TIME_SYNC_INTERVAL_RETRY * 60, timeSync);
ESP_LOGI(TAG, "[%0.3f] Timesync failed, invalid time fetched | source: %c",
millis() / 1000.0, timeSetSymbols[mytimesource]);
}
@GeorgWolter could you please test the fix?
Yes, but retest failed. And did somebody remove the "PAX : " from the display?
Please wait 10 minutes, then time should sync. Yes, "PAX:" was removed from display, to allow display of larger counter values.
Can you please check that TIME_SYNC_INTERVAL_RETRY is set to 1 in paxcounter.conf? Then you need to wait for 1-2 minutes after GPS fix and should get the time set. Please post the log from start up to 2 minutes after GPS fix.
TIME_SYNC_INTERVAL_RETRY = 1
is okay for testing and GPS, but we need to be careful not to use short sync cycles for time sync via LORAWAN (duty cycle limitation).
I Set TIME_SYNC_INTERVAL_RETRY = 1 and created the attached logfile by capturing it from serial. I hope this is what you have asked for. Otherwise pls. advise 😊 I am available for a remote session (e.g. Teamviewer).
@GeorgWolter you have LORA timesync enabled, thus using LORA network / LORA server as primary timesoure, not GPS. As explained above, please disable. Otherwise GPS will act as fallback timesource only.
If you do it right...Retest passed: 28. Sep 2020 (Afterwards reset TIME_SYNC_INTERVAL_RETRY = 10)
but... there should be a "G" on the display, behind the time/date row. If not, you're probably using OneBitDisplay Library > v1.5.0; those newer versions have a bug. I corrected it already, but we need to wait until v1.7.2 or greater is out.
Just checked this here in my VSC / Platform.io IDE:
Bug is located in OneBitDisplayLibrary > v1.5.0, not in the Adafruit libs.
I am having here a second T-Team board (v.1.0) where both LEDs blue and red aren't shining anymore. (This is of course no caused by Paxcounter) So the idea is to check / flash latest firmware from TTGO. But do you know the related download URL? I am still waiting for an answer from TTGO support dept.
@GeorgWolter Sounds like a power issue. A possible root cause could be a misconfigured Power Management Chip AXP197. The chip controls all supply voltages on the board, including VDD for the ESP32. The chip has non volatile registers so settings are persistent. If the AXP chip is programmed to set the ESP32 power to off after power on, you have a kind of chicken-and-egg problem, because the I2C bus of AXP chip is controlled by the ESP32...
Other anomalies with this board are:
Q: What would you do? btw.: I have just ordered a T-BEAM v1.1
Display is darker is when AXP192 set wrong voltage for the display VDD (output DCDC1) GPS may not work if AXP192 did not power on voltage for it (outputs LDO3 and LDO1)
Paxcounter software does program the appropriate settings during power on (see ttgobeam10,h), but of course the ESP32 on the board needs power to run the software. If some kind of software sets output DCDC3 to off, the board is bricked, because this is the ESP32 power line.
But Paxcounter is running. I can see the activities on the display. How can this be when ESP32 is w/o power?
Found this: Deep-sleep Regarding deep sleep, except for DCDC3, power off all channels of AXP192, the current consumption is about 580μA
Everything fine but the display permanently shows 01.Jan 1970. Any advise?