RAK3172 RTCC on P2P mode

I am using RUI3 and arduino API. When using the module on LoRaWAN mode time is synchronized by network. Then the current time can be accessed by lorawan.ltime.get().

How can you set/get the module time when on P2P mode?


Hi @NAS1975 ,

That is not possible on P2P mode. LTime is based on the TimeReq mac of LoRaWAN protocol. LoRa P2P doesn’t have this. Likely you need a dedicated RTC for P2P.

Hi @carlrowan ,

the STM32WLE5 has an RTC module. Have you implemented a driver to access this in arduino API ?

I understand that the LTime is used based on the time requested by the lorawan network however you typically request the time from the network once! and then the time is managed by the RTC module of the cpu. As the RTC time might drift over time, you can request time to be updated by the network once again.

Hi @NAS1975 ,

We do not have an API in RUI3 that allows user to access RTC. We internally use it on some functionalities of RUI3. I understand your concern and it seems you might need an external RTC at the moment.

I’ve an issue while operating it in P2P mode. When the module is set to LoRaWAN mode, time synchronization is automatically done by the network, and I can access the current time using lorawan.ltime.get(). However, in P2P mode, I’m unsure about how to set or retrieve the module’s time.

How I went round this issue in P2P mode.
I use a ESP32 as a wifi gateway for my P2P devices. On every message received by the gateway time is responded as part of the Ack message.

Then use local time keeping to keep track of epoch time. The slaves will typically report a message every 30 min so epoch time is synched frequently

Welcome to forum @BooneOcean ,

ltime.get() uses LoRaWAN MAC which is not used on LoRa P2P.

Few options you can do:

  1. If you operate in both LoRaWAN and LoRa P2P, get the time when you are in LoRaWAN mode, save in flash or external memory then use it in your LoRa P2P.
  2. Use external RTC chip.
  3. If you have ESP32 like @NAS1975 , you can do same approach and get the time via NTP server.