Question: Can 2 processes read/write using RFM12Pi module at the same time?

I need to run 2 processes on raspberry pi, both of them need to use RFM12Pi to communicate with Arduino MCUs. 

Those 2 processes read/write data through RFM12Pi module very frequently, will there be any problems? I remember the RFM12Pi module transfer data with Raspberry Pi using GPIO interfaces, and if many processes read/write the serial communication port at the same time, there will be problems.

 

Could anyone answer my question? Any information/link about this question will be appreciated.

 

Thank you!

Jérôme's picture

Re: Question: Can 2 processes read/write using RFM12Pi module at the same time?

I think the serial port can not be shared.

Technically, it could be open/closed for write operations, but I don't think you can have two softwares reading at the same time.

If one of your softs only requires write access, this should be feasible, however.

(I don't know If you use the python standalone gateway. It has a feature that allows an external program to pass it strings to transmit on the RF link.)

DaveLloyd's picture

Re: Question: Can 2 processes read/write using RFM12Pi module at the same time?

I solved this problem by having a python program with two threads using UDP multicasts to allow any number of processes either on the pi or on my local network to read or write to the port.

The program listens on one port and forwards any data to the serial port. Any serial data received is broadcasted on a differnt UDP port.

Dave

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.