1

I need to get a continuous stream of data flowing from a peripheral device, to a raspberry pi, and lastly to my computer (mac).

So far, the data is can make its way continuously (in real time) from the peripheral, to the command line of my raspberry pi. Note that there is no exact "end" to the data stream (assume it continues forever).

I also have a script which can send data continuously by TCP from the raspberry pi to my computer. HOWEVER, I can't connect these two mentioned parts together.

As the data comes into the raspberry pi command line, I need to somehow get it into my send_TCP.py file while it is running, so that the data appears in my computer's terminal in REAL-TIME. I have been trying at this for hours and have had no luck.

I have tried using pipes, redirecting, etc. to get this to work but I can't figure out how to send get the data from the raspberry pi's terminal into the TCP program while it is running, so that everything happens smoothly.

Is there any way, from a python script, to just simply read the values from the command line into a python program so that we can use their data?

Is there an os.read() function or something I could use? Or are pipes the way to do this? In any case, I can't figure it out and could really use some help. Please help if possible, as thoroughly as you can. Thanks very much in advance, it is greatly appreciated! Thanks!

Stephen
  • 43
  • 1
  • 6

0 Answers0