I would like to execute Dronecode SDK examples on Pixhawk4.
I saw there are some suggestions to execute examples like this: ./takeoff_land udp://:14540, ./takeoff_land serial://path/
I connected Pixhawk4 and Raspberry Pi by TELEM2 and USB2TTL pins.
What should i do give the URL parameter?
I even don’t know they were actually connected. There is nothing new device when i type a lsusb command on raspberry pi.
@DaeunGod, to identify the tty port name/number, you can also use the linux command “dmesg -wHT”. Press enter, then connect the USB2TTL device… the next message on screen should tell you the name of the port
I found the tty port name and number. It is /dev/ttyUSB0.
but, Still they doesn’t look connected. i try to check anything arriving by using screen /dev/ttyUSB0 57600.
It doesn’t show anything. I think i had some mistake when set Pixhawk’s parameters.
That is i can’t find these parameters on QGroundControl.
MAV_1_CONFIG = TELEM 2 (MAV_1_CONFIG is often used to map the TELEM 2 port)
If you find them instead of the other ones, it means that you have the ArduPilot firmware running and not the PX4.
You can also check if the ArduPilot label is present near the top right corner of the QGroundControl (see picture here: https://docs.qgroundcontrol.com/assets/setup/flight_modes_copter_ardupilot.jpg)
And this is what i found after connected each other. @elBarto There is a px4 pro label on the top right corner of the QGroundControl. So i think i’m using PX4.
You’re right, they changed the name. Look for SYS_COMPANION and change its value to “Companion Link (921600 baud, 8N1)”, then set the baudrate accordingly (e.g. “screen /dev/ttyUSB0 921600”). It should work!
I really appreciate your help.
I found the parameter you said and changed the baudrate. But it does not work yet.
There’s one thing unusual. The Tx LED blinks when the USB2TTL module is plugged into the laptop, but it does not blink when plugged into the Raspberry pi.(Rx LED does not blink both. Also there is no message on screen command) Maybe USB2TTL module has a problem?
The power of the raspberry pi is connected by the adapter, and the Pixhawk is powered by the battery.
I am sorry to hear that.
Does it work on your laptop? I mean, if you connect the USB2TTL device to your laptop, can you get any message? You can use screen as well if you have any Linux distribution or Putty if you have Windows installed.
No, It does not. Only Tx LED blinks and no message from Pixhawk. The laptop uses Linux 14.04.
I tried to connect from raspberry pi on Linux mate and Raspbian. but still it doesn’t connected.
I used MAVProxy to Check connection. but it said nothing neither. I think Pixhawk doesn’t send a message via TELEM2 or I should give a permission to send or receive messages.
I checked USB2TTL and TELEM2’s male port(6 pin cable) connection using digital multimeter. it was well connected. So I really don’t have idea why they aren’t connected.
Actually I am running short of ideas, but… you can still try this:
connect the USB2TTL device to TELEM1 (you have to disconnect the telemetry radio);
THEN
set the baudrate to 57600 on the RaspberryPi/Laptop side (screen /dev/ttyUSB0 57600)
OR
launch QGroundControl and see if it can connect to the Pixhawk using the cable instead of the radio.
This way you can check that the USB2TTL device is working properly and the cable is fine. Are you sure that the cable pinout is correct? Maybe TX and RX are swapped
Thank you so much. I couldn’t have done this without you.
I’m really stupid. Yes, TX and RX are swapped also I should change the baudrate 57600. Then I can get some kind of messages from Pixhawk4.
But still, Raspberry Pi does not find the Pixhawk.
When I type a command as ./takeoff_land serial:///dev/ttyUSB0:57600. Then It said No system found, exiting.
I tried this on offboard mode, manual mode, stabilize mode.