- Connect to raspberry over bluetooth
- Run hciconfig in the raspberry terminal
- Find your laptop's bluetooth address
- Copy that address
- Ensure that you connect to your laptop's bluetooth automatically
- Go to Config.py, and paste that address into
server_bluetooth_address = [Your address here]
- OPTIONAL: Change the write directory to change the folder in which images are stored
No need to install, as all packages used are within python standard library
-
Connect to Raspberry PI over bluetooth
-
Ensure you have some way of SSHing or VNCing into it, and do it
-
Send SatServer.py, FlatSat_student.py, Config.py, Buffer.py, sat_req.txt, and some dummy images over through SSH or VNC: scp /Users/raheyo/CubeSat-2024/sat_req.txt [email protected]:/home/olympians/Olympian/
scp /Users/raheyo/CubeSat-2024/SatServer.py [email protected]:/home/olympians/Olympian/ scp /Users/raheyo/CubeSat-2024/Config.py [email protected]:/home/olympians/Olympian/ scp /Users/raheyo/CubeSat-2024/Buffer.py [email protected]:/home/olympians/Olympian/ scp /Users/raheyo/CubeSat-2024/Nominal.py [email protected]:/home/olympians/Olympian/
If you want dummy images on the Pi just to test out the Bluetooth file transfers, here are some you can use! scp /Users/raheyo/CubeSat-2024/Images/square0.jpeg [email protected]:/home/olympians/Olympian/Images/ scp /Users/raheyo/CubeSat-2024/Images/square1.png [email protected]:/home/olympians/Olympian/Images/s scp /Users/raheyo/CubeSat-2024/Images/square2.jpeg [email protected]:/home/olympians/Olympian/Images/
Suggest not using these ones, file too large to transfer over bluetooth: scp /Users/raheyo/CubeSat-2024/Images/square3.jpg [email protected]:/home/olympians/Olympian/Images/ scp /Users/raheyo/CubeSat-2024/Images/square4.jpg [email protected]:/home/olympians/Olympian/Images/
-
Send the cubesat server environment configurations over scp: scp /Users/raheyo/CubeSat-2024/sat_req.txt [email protected]:/home/olympians/Olympian/
Then run this on the pi: pip install -r sat_req.txt
-
Run Server.py on your host machine (laptop)
-
Run Client.py on PI to start the image transfer
Additional for cubesat server (REQUIRED) - create bluetooth.h header files before installing for pybluez
On your pi, run: sudo apt-get install libbluetooth-dev
pip install git+https://github.com/pybluez/pybluez.git#egg=pybluez
For the cubesat server: download pybluez zip file from https://pybluez.readthedocs.io/en/latest/install.html to your computer:
for me it's in the /user/raheyo/Downloads/ folder on my mac, file location different on Windows
then scp over to the pi: scp /Users/raheyo/Downloads/pybluez-master.zip [email protected]:/home/olympians/Olympian/
lastly on the Pi, in your repo directory unzip the file, cd into the folder and run the setup.py: unzip pybluez-master.zip cd pybluez-master sudo python setup.py install
DON'T FORGET THE "SUDO" IN THE LAST COMMAND OR ELSE IT WOULDN'T WORK
ssh-keygen -R grapefruitpi.local
You forgot to do the REQUIRED part before installing pybluez, refer back to it and don't be lazy~
This means your pybluez package has some error. Reinstall it completely and install it again with the desired command with "egginfo" specified sudo pip uninstall pybluez pip install git+https://github.com/pybluez/pybluez.git#egg=pybluez
Bluetooth error: File "/Users/raheyo/.pyenv/versions/3.9.18/lib/python3.9/site-packages/lightblue/bluetoothsockets.py", line 787, in initWithDelegate: self = super().init(); AttributeError: 'super' object has no attribute 'init'
Bluetooth error: raise _socket.error(result, OSError: [Errno -536870212] Cannot connect to 1 on D8:3A:DD:8E:CE:FA
That just means soemthing is wrong with your code, bad programmer skill issue!!! @_@
Bluetooth error: raise _socket.error(errno.ECONNRESET, os.strerror(errno.ECONNRESET)) ConnectionResetError: [Errno 54] Connection reset by peer
That means you are closing the connection EARLY from one end of the socket (server or client), which cause the other code to fall short and not able to run. TO FIX: Check that there is no error from the other end of the connection that caused the connection to break early. Also check that you don't use the socket.close() function too much in the middle of the code for either the server or the client~
Permission denied on the Pi: [Errno 13] Permission denied: '/usr/local/lib/python3.11/dist-packages/test-easy-install-2831.write-test'
Use "sudo" before your linux command on the Pi. The system doesn't trust you right now because you're remotely controlling it through ssh~
Camera Preview Error: qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
export QT_QPA_PLATFORM=offscreen sudo apt update sudo apt upgrade -y sudo rpi-update pulls/5691s