Pixhawk Setup
- Update the firmware on PX4Flow using QGroundControl (in the top left menu, click on CONFIG, then on Firmware Upgrade)
- Connect PX4Flow UART3 to any available serial on the Pixhawk, recommended is TELEM2
- Put a file /etc/extras.txt onto the microSD card, with this content:
mavlink start -d /dev/ttyS2 -b 115200 -m custom mavlink stream -d /dev/ttyS1 -s OPTICAL_FLOW -r 2
- TELEM2 is the default port, but any other serial port can be used too. Found here.
Data Output
The PX4FLOW module outputs MAVLink packets on USB and serial port. Use QGroundControl to read data from the module. An I2C interface for sensor data reading is offered as well.
- USART3: MAVLink at 115200, 8N1 baud: OPTICAL_FLOW message, HEARTBEAT message
- USB: Baud rate is not relevant (USB ignores it): OPTICAL_FLOW message, HEARTBEAT message, image.
- I2C1 22 Byte Data Packet (send 0x0 to PX4FLOW module and receive back 22 Bytes data)
7 Bit I2C Address of the Flow Module: Default 0x42 (user selectable bits 0,1,2)
Open the Terminal Connection
Now plug in the USB cable of your adapter.
Use this shell command to start the connection (Mac OS: type
'terminal
' in Finder to start the shell).screen /dev/ttyUSB0 115200 8N1
- screen: The screen program
- /dev/ttyUSB0: The name of the USB to serial adapter (Mac OS: type
'ls /dev/tty.*
' to see the serial ports, FTDI adapters show up as something like/dev/tty.usbserial-A7005rOd
) - 115200: The connection is 115200 baud
- 8N1: 8 data bits, no flow control, 1 stop bit