Previous version of raspbery pi https://downloads.raspberrypi.org/raspios_full_armhf/images/raspios_full_armhf-2021-05-28/
- Connect to Raspberry pi
-
Install RPI software using “Imager” to SD card.
-
Connect Pi SSH using Wi-Fi.
-
Run the Following commands,
sudo apt-get update sudo apt-get upgrade sudo apt-get install python-pip sudo apt-get install python-dev sudo pip install future sudo apt-get install screen sudo apt-get install python-wxgtk4.* sudo apt-get install libxml sudo apt-get install libxml2-dev sudo apt-get install libxslt1-dev pip install lxml sudo pip3 install pyserial sudo pip3 install dronekit sudo pip3 install geopy sudo pip3 install MAVProxy
-
Set up serial connection, type following in ssh
sudo raspi-config
- goto interface options,
- go to serial,
- When prompted, select no to “Would you like a login shell to be accessible over serial?”
- When prompted, select yes to “Would you like the serial port hardware to be enabled?”.
- Reboot the Raspberry Pi when you are done.
- The Raspberry Pi’s serial port will now be usable on
/dev/serial0
.
-
Set following parameters in mission planner,
SERIAL2_PROTOCOL = 2
SERIAL2_BAUD = 921
if required do following also,
LOG_BACKEND_TYPE = 3
-
Power the RPI using BEC module.
- check port,
ls /dev/ttyAMA0
- add below two lines at bottom of file
sudo nano /boot/config.txt
,if not thereenable_uart=1 dtoverlay=disable-bt
- check port,
-
Now type the following to get the telemetry data of pixhawk,
mavproxy.py --master=/dev/serial0 --baudrate 921600 (or) mavproxy.py --master=/dev/ttyAMA0 --baudrate 921600
-
Type the following if you want telemetry data to be displayed in mission planner,
mavproxy.py --master=/dev/serial0 --baudrate 921600 --out udp:127.0.0.1:14552 /*Here, '127.0.0.1' Your PC's IP Adress, Obtained by typing 'ipconfig' in command prompt '14552' is the port to which you need to connect to mission planner using UDP */
-
- To Run Python code type,
python3 demo.py --connect /dev/ttyAMA0