RAK3172 microseconds range measurement

Hello all,

We are working on a system to measure the time difference between events at different locations. To describe the hardware briefly, our system is composed of dispersed modules equipped with MCU that manages all the module functionality and communicates through UART with the RAK3172 working in P2P mode. The main principle of these modules is to send information about events (GPIO change at MCU) wirelessly.
Then, there is another module that collects data from the air and calculates the time difference between particular signals. Our goal is to measure tens of seconds with a precision of at least 0.1 ms.
While tuning the performance of the system, we have observed that we can not reliably measure time differences with a precision better than 1 ms, as the RX frames on the air monitoring module arrive in moments rounded to about 1 ms periods. Looks like there is some scheduler managing events in a 1 ms loop but I went through the RUI3 code, and I can not localize anything like that.
Could you please advise me on the following points?

  1. Is it doable with RAK3172 modules to achieve such P2P transmission time repeatability that after its subtraction we can measure time with 100 us precision?
  2. This 1 ms quantization, it is done at the transmitter side, receiver side, or maybe on both ends of the transmission?
  3. Based on your experience, could you please share your idea of where you would start with the custom code to get a 0.1 ms resolution?

Your problem sounds very familiar, I heard similar requirements somewhere else.

I don’t think it is possible to achieve this with RUI3. You do not have access to the lower levels of the RUI3 API and cannot control whether a P2P send command is carried out immediately or if there are any delays due to other tasks that RUI3 is handling.

You might want to look into the STM32Cube examples for the STM32WLE5 if you can get this accuracy using the STM32 SDK directly.

We have a guide how to adjust the STM32 SDK to work with the RAK3172 ==> Low Level Development