Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1234

Python • Re: Bluetooth - Transferring Data from one RPi to another RPi

$
0
0
File transfer from Pi to Pi. Download just one file (filetransfer.py) from here:

https://github.com/petzval/btferret

Run on both machines, but set scan parameters via hciconfig first.

Code:

hciconfig hci0 piscanpython3 filetransfer.py
Start receiver as a server, then start sender as a client. You need to enter the Bluetooth address of the server, but there are instructions for hard-coding it. The code can send a file from the client, or the client can request a file from the server. The transfer does a CRC check. There is a ping option to confirm connection. The same filetransfer.py file will also run on a PC with Python 3.9 or later for transfer to/from other machines. The code can be modified to transfer any kind of data rather than files. The Bluetooth interface on the same site will transfer data via C code, but is more complicated.

Statistics: Posted by petzval — Mon Jan 22, 2024 4:41 pm



Viewing all articles
Browse latest Browse all 1234

Trending Articles