2

I am currently exploring a project where I want to send data (most likely video) from one raspberry pi to another raspberry pi over two (series 1) xbee radios with some python scripts.

currently I have been successful in sending text from one to the other(code below). so my next step is to send streaming video from one to the other. I know there are other ways to do this, I have already done it via VNC over two WiFi dongles. the reason i want to use the xbees is to achieve a good amount of range. I am not even sure if this is practical or possible, any help would be great.

note(I started looking at sending packets over the radios but was unsure how to do that in python.)

    import serial
    import RPi.GPIO as GPIO

    GPIO.setmode(GPIO.BCM)

    port = serial.Serial('/dev/ttyUSB0', 9600)
    print port

    while True:

        x = raw_input() 
        ser.write(x)
        print("you typed ",x)

this is the code for only one of the raspberry pi's (the sender) I hope this all makes sense, if it doesn't I apologize.

erik.garcia294
  • 103
  • 1
  • 1
  • 5
  • Have you calculated the bandwidth requirements of the video? Expect throughput of about 100kbps using XBee radio modules on 802.15.4. You'll need to bump your serial port speed up to at least 115200, and likely need to use hardware handshaking on the serial port. – tomlogic Aug 07 '14 at 17:46
  • I will look into hardware handshaking, but what is the process of even sending the video. I guess what I am asking for is the actually commands. Does the program just point to a stored video file(file path) and send it? or is it something else? – erik.garcia294 Aug 07 '14 at 19:19
  • What's the source of the video? Is it live or recorded? If it's in a file on the Pi, you'll just open the file and send the bytes. You may want to make use of Transmit Status frames to know when the remote end has received a block and it's OK to send another. You might want to take a look at the [XBee Internet Gateway](http://code.google.com/p/xig/) project as a starting point for a Python-based device communicating with XBee modules. – tomlogic Aug 08 '14 at 17:36
  • the source of the video could be either live or a file. It seems like your recommendation of sending the bytes for the video file is a good way to go. What would be the python command for that? also how would you approach sending a live feed?(if that's possible) – erik.garcia294 Aug 08 '14 at 21:42
  • You should be able to find plenty of sample code for reading a file in Python. Live video is going to depend on what hardware you'll use to capture the video, and how it provides access to the video stream. – tomlogic Aug 11 '14 at 05:57
  • did you get the solution? i need help with this exact same problem :( – Diptangsu Goswami May 20 '17 at 06:46

0 Answers0