3

I have two different sensors connected to my Raspberry pi and I have to send the data to other device. The transmission of data is through wireless network. I have been asked to send the data in synchronization (i.e. data collected together from sensors must reach/ process at destination together).

I have no prior experience in field of Networking or IoT (I'm currently reading Data Communications and networking by Forouzan for the same). I have searched Google but no relevant website comes up.

*Using LoRa for transmission.

Breakpoint
  • 133
  • 5

2 Answers2

2

This is a programming task. In your code, you can probably read values of the sensors separately. Now you have to write 2 threads(2 equals number of different sensors) that wait for data to be read, and put a mutex that holds the program until both data is read. When both data is read, unlock the mutex, combine your data variables in a JSON(or any other) and send them once.

atakanyenel
  • 477
  • 2
  • 5
1

You can send it to the other device if the other device can be a web server. Another possibility is to create a web server in the Raspberry Pi (RPi). Then, with the other device, you can connect to the RPi when you need to update the data of those sensors.

In both cases, you can collect the data of both sensors and after that, work with it.

CGG
  • 590
  • 1
  • 8
  • 17