0

I've a Raspberry Pi 3 Model B. I want to send a file from Raspberry to Laptop. I configured my xBee (Zigbee) devices and i can send ASCII text between each other on XCTU.

I want to transfer a file (1 MB) without XCTU. Can you suggest me a source for this? How can i do this?

1 Answers1

0

You will need to come up with some sort of protocol for the Pi to tell the laptop how large the file is before it starts sending. You could start really simple and send a single line with the name of the file, its size, and a newline before writing the file contents out on the serial port. On the receiving end, parse out the filename and size, and then start reading bytes until you reach the end.

A more complicated protocol would allow for either end to abort the transfer. You don't have to worry about error correction since you're probably using a USB interface that won't have line noise between the FTDI controller and the XBee, and the over-the-air transmission is error corrected for you.

Be sure to configure the XBee modules on both ends to use flow control and expect the transfer to take a long time. You want to make sure you're sending bytes into the XBee on the Pi at a rate it can handle. Flow control on the laptop is probably less important. Set ATBD to 7 (115200 bps) or 8 (230400 bps) to minimize the transmit time between each device and the XBee module, but be prepared for over-the-air transfers to go at about 10KB/s. 1MB/10KB/s = 100 seconds.

tomlogic
  • 11,489
  • 3
  • 33
  • 59