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

Questions about loragw_sx1302_timestamp.c #135

Open
ECherr opened this issue Jan 13, 2025 · 5 comments
Open

Questions about loragw_sx1302_timestamp.c #135

ECherr opened this issue Jan 13, 2025 · 5 comments

Comments

@ECherr
Copy link

ECherr commented Jan 13, 2025

Hi, my gateway use basicstation mode with class b enable. But recently I get some questions.

I gaint pps_xticks with 0 return sometime, and old value(same as last) sometime.

I chek the code about this, find that end with write/read to usb fd.

So, I wander to know, how the sx1302 use the counters to save pps signal?

In timestamp_counter_get function which locate in loragw_sx1302_timestamp.c, read two counters value, one for freerun counter, another for pps counter, so , in sx1302, maintain two counters?

If call timestamp_counter_get function, sx1302 will hang up until pps is up edge, then return?

Could u tell me how they work?

Best Regards.

@ECherr
Copy link
Author

ECherr commented Jan 13, 2025

this return 0

4ca217f58b12644cc6fed6600caef10

and this return same value as last
5cfe657652a809ad1e8b76e7a35a596

@mcoracin
Copy link
Contributor

Hello,
The sx1302 has 1 internal counter from which we can get 2 values:

  • the current free running value
  • the value the counter was at last PPS
    The sx1302_hal allows to read both values. But if the PPS is lost due to bad GPS signal quality, the sx1302 counter value latched on PPS will keep the same value, until a PPS comes in.
    Best regards,
    Michael

@ECherr
Copy link
Author

ECherr commented Jan 13, 2025

Thanks for your replay.

When we call some function, like timestapm_counter_get, will it make an interrupt on sx1302? And I foud that, sx1302 clock source from sx1250.

I test once again just now. In which condition, sx1302 will return 0? Does it mean that the PPS had lost before sx1302 power up?
If restart action on sx1302(lgw_stop and lgw_start), will it clean the internal counter values?

@mcoracin
Copy link
Contributor

No, there is no interrupt. When timestamp_counter_get() is called it just read registers from sx1302 where the current value of the internal counter is stored, and the value of this same counter at last PPS.

The sx1250 radio will give the 32M clock to the sx1302. If the sx1250 is not powered and started, the sx1302 free run counter will be 0. If the free run counter is not 0, but the PPS counter is 0, it means that there is no PPS signal sent to the sx1302.

lgw_stop/lgw_start will not clean the internal counter, the sx1302 needs to be reset.

Which hardware are you using ? Is it a SPI or USB sx1302 board ?

@ECherr
Copy link
Author

ECherr commented Jan 13, 2025

Ooo, many thanks.

I use RAK7289CV2, I think it is USB sx1302 board.

I met that pps_xticks is zero or old value, so I try to understand how the internal counter works in basicstation mode.

I have another question, if startup with good gps signal, work for a time, and lost gps signal for a long time, such as late about 30mins, then gain gps signal again, will sx1302 recovery the gps drift?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants