XBStation User Guide
[XB Logo] XBStation
xb-uav.com
Date: 21 December, 2018
1.0 How It Works
XBStation is a 4G LTE control system that enables operators to control drones and stream live video via the internet. The system comprises XBFirm software running on a Raspberry Pi to communicate with the Pixhawk flight controller, and XBMissionPlanner software running on a PC to send/receive MAVLink messages and video streaming data to/from XBFirm via the internet.
System Diagram Description: A diagram illustrates the XBStation system. A Raspberry Pi with XBFirm software is shown connected to a Pixhawk. Both are connected via the internet (represented by a cloud icon with Wi-Fi signals) to a PC running XBMissionPlanner software. Arrows indicate data flow: XBFirm communicates with Pixhawk. XBMissionPlanner communicates with XBFirm via the internet for MAVLink messages and video streaming.
2.0 Setup
The XBStation setup is designed to be simple and can be completed in a few steps.
2.1 Materials
- Raspberry Pi: Any version of Raspberry Pi (Zero, Pi 2, Pi 3, 3+) running Debian OS is compatible. Testing and deployment are performed on Raspberry Pi 3+ with Debian OS.
- Micro SD card: Minimum 16GB, Class 10 high speed is recommended for logging video on the Raspberry Pi.
- Camera: Logitech C310 camera is recommended. The system supports other USB cameras like C270, C310, C526, C616, C920. Testing was done with C310 at HD resolution (1280x720). Full HD and 4K cameras may exceed the Raspberry Pi 3 GPU capabilities; improvements are planned for XU4.
- 4G Modem: Huawei E3372 4G modem is recommended due to its auto-connect hilink feature. Other 4G modems with auto-connect functionality can also be used, but auto-connect must be tested before flight.
- Power Supply: A UBEC POWER 5V 5A is recommended to supply power to the Raspberry Pi, camera, and 4G modem, avoiding overload.
Hardware Setup Diagram Description: An illustration shows the main components of the XBStation setup: a red XBStation unit, a Raspberry Pi, a Pixhawk flight controller, a 4G modem, and a camera.
Connection Details:
- Connect the Pixhawk's TELEM2 port to the Raspberry Pi's Ground, TX, and RX pins. Specifically: Pixhawk TX connects to Raspberry Pi RX, Pixhawk RX connects to Raspberry Pi TX, and Pixhawk GND connects to Raspberry Pi GND. Vcc connection is not recommended due to potential voltage differences.
- Pixhawk Parameter Setup: Connect to the Pixhawk with a ground station (e.g., Mission Planner) and set the following parameters:
- SERIAL2_PROTOCOL = 1 (enables MAVLink on the serial port).
- SERIAL2_BAUD = 57 (sets communication baud rate to 57600 for Pixhawk-RPi communication). Note: Incorrect baud rate will cause software malfunction.
- LOG_BACKEND_TYPE = 3 (if using APSync to stream dataflash logs to the Raspberry Pi).
(Note: Telemetry or USB connection to a PC is used for configuration.)
2.2 Setup Raspberry Pi (Optional)
This step involves installing Debian OS on the Raspberry Pi. If your Raspberry Pi is already running Debian OS, you can skip this section.
2.2.1 Components Needed:
- Raspberry Pi
- 5V, 2A adapter with mini USB cable
- HDMI cable
- USB keyboard and mouse
- SD card (minimum 8GB, Class 10 recommended 16GB or 32GB)
- Ethernet cable (optional)
2.2.2 Install Debian OS:
Connect the keyboard and mouse to the Raspberry Pi's USB ports. Connect the Pi to an HDMI-supported TV using the HDMI cable.
Raspberry Pi Setup Diagram Description: A Raspberry Pi 3 Model B board is shown with various ports labeled: USB ports for keyboard/mouse, LAN socket, HDMI for display, Micro USB for power, GPIO Pins, Micro SD card slot. The Pixhawk's TELEM2 port is depicted as connected to the Pi.
You need to download two software tools and the Debian image:
- SD Formatter 4.0: https://www.sdcard.org/downloads/formatter_4/eula_windows/
- Win32diskimager: https://sourceforge.net/projects/win32diskimager/
- Debian image: https://www.raspberrypi.org/downloads/raspberry-pi-desktop/
SD Card Formatting Diagram Description: A screenshot of the SDFormatter V4.0 application window is displayed, showing options for selecting a drive (e.g., 'D:'), setting the volume label to 'Raspberry', and selecting format options like 'QUICK FORMAT, FORMAT SIZE ADJUSTMENT ON'.
SD Card Imaging Diagram Description: A screenshot of the Win32 Disk Imager application window is displayed, showing fields for selecting an image file (e.g., `OSMC_TGT_rbp2_20160306.img`) and a device (e.g., `[F:]`), with a 'Write' button. The process indicates 'And waiting... write successful'.
2.2.3 Run Debian OS on Pi:
Insert the micro SD card into the Raspberry Pi.
Pi with SD Card Diagram Description: A hand holds a Raspberry Pi board with a micro SD card inserted into its slot.
Turn on the power.
Terminal Output and Desktop Diagram Description: A terminal window shows boot messages for the Raspberry Pi, including kernel messages and device detection. It then shows a screenshot of the Raspberry Pi desktop environment with file manager and terminal windows open, indicating a successful boot into the OS.
You have to add some installation steps but very easy. You just read and follow.
2.3 Connect Pixhawk and Raspberry Pi
VERY IMPORTANT
2.3.1 Connect the Pixhawk's TELEM2 port to the RPi's Ground, TX and RX pins as shown in the image.
Pixhawk/RPi Connection Diagram Description: A detailed diagram shows the physical connection between the Pixhawk TELEM2 port and the Raspberry Pi 3 Model B. It highlights the TX, RX, and GND connections. The Pixhawk board and Raspberry Pi board are clearly depicted with their respective ports.
2.3.2 Setting up the Pixhawk:
Connect to the Pixhawk with a ground station (i.e. Mission Planner) and set the following parameters:
- SERIAL2_PROTOCOL = 1 (the default) to enable MAVLink on the serial port.
- SERIAL2_BAUD = 57 so the Pixhawk can communicate with the RPi at 57600 baud. (YOU MUST CHOOSE SERIAL2_BAUD = 57, IF YOU CHOOSE OTHER NUMBER, SOFTWARE IS NOT OPERATION)
- LOG_BACKEND_TYPE = 3 if you are using APSync to stream the dataflash log files to the RPi.
(NOTE: use telemetry or USB connect PC for config)
2.3.3 Setting up the Raspberry Pi:
Open terminal on RASP PI (Ctrl+Alt+T) and type:
sudo raspi-config
Raspi-config Terminal Diagram Description: A terminal window shows the command `sudo raspi-config` being executed.
In the utility, select "Interfacing Options":
Raspi-config Menu Diagram Description: The Raspberry Pi Software Configuration Tool menu is displayed, with options like 'Change User Password', 'Network Options', 'Boot Options', 'Localisation Options', 'Interfacing Options', etc. 'Interfacing Options' is highlighted.
And "Serial":
Raspi-config Serial Diagram Description: Within the `raspi-config` tool, the 'Serial Port' option is highlighted.
Choose "NO" (Disable OS use of the serial connection)
Serial Port Enable Prompt Diagram Description: The `raspi-config` tool displays a prompt 'Would you like a login shell to be accessible over serial?' with 'Yes' and 'No' options.
Select "YES" for enabled serial port hardware:
Serial Port Hardware Enable Diagram Description: The `raspi-config` tool displays a prompt 'Would you like the serial port hardware to be enabled?' with 'Yes' and 'No' options. After selecting 'Yes', a confirmation message states 'The serial login shell is disabled. The serial interface is enabled.'
Reboot the Raspberry Pi when you are done.
ls /dev Output Diagram Description: A terminal window shows the output of the command `ls /dev/`, listing various device files including serial ports like `ttyS0` through `ttyS63`.
Finish setup rasp pi.
2.4 XBFirm
XBFirm is a software that runs on the Raspberry Pi (currently supports Debian OS) to read/write data from/to Pixhawk, capture streaming video from the camera, and send it to the station software.
2.4.1 Download XBFirm software:
Open terminal and type the command:
sudo wget -O - https://sourceforge.net/projects/xbinstall/files/XBFirm-1.0.1-install.txt | bash
2.4.2 Setup:
Move to the XBFirm folder:
cd XBFirm
Run the setup.sh file:
sudo ./setup.sh
Input username and password when prompted.
XBFirm Setup and Completion Diagram Description: A terminal window shows the command `sudo wget -O - [URL] | bash` for downloading and installing XBFirm. It then shows the command `cd XBFirm` to navigate to the directory and `sudo ./setup.sh` to run the setup script. A login prompt for username and password is shown. Following this, the completion message `***Completed` is displayed, indicating successful installation. The command `sudo reboot` is also shown.
Reboot Rasp pi, and XBFirm will start automatically.
sudo reboot
2.5 XBMissionPlanner
XBMissionPlanner is a ground control station compatible with Windows only, used for Plane, Copter, and Rover.
Download link: https://sourceforge.net/projects/xbmissionplanner/files/XBMissionPlanner-1.2.7.rar/
3.0 Getting Started
3.1 Start XBMissionPlanner
Extract the `.rar` file and run `MissionPlanner.exe`.
Mission Planner Interface and Login Diagram Description: The Mission Planner software interface is shown, featuring a map of the Earth, flight status indicators (DISARMED, EKF Vibe, GPS status), telemetry data displays (Altitude, Vertical Speed, Ground Speed, Dist to WP, Yaw), and connection status. A 'CONNECT' button is visible. A login dialog box within Mission Planner prompts for Username and Password, with a 'Login' button.
Choose "XB" connection in the top right and click the Connect button.
Login dialog appears; type your username and password, then hit the Enter button.
Please wait about 2 minutes for loading parameters from pix.
4.3.3 Feature:
The current XBStation version supports features for recording video, changing quality, and showing information data.
- Turn on/off camera: Use the 'Start Camera' and 'Stop Camera' buttons. The camera turns on automatically when the Raspberry Pi starts up.
- Start/Stop recording: Use the 'Start Recording' and 'Stop Recording' buttons. Video recording is saved in the `XBFirm/videos` directory on the Raspberry Pi with the highest quality.
- Reboot/ Shutdown button: Use the 'Reboot' button to reboot the Raspberry Pi or the 'Shutdown' button to shut it down. NOTE: DO NOT CLICK THE SHUTDOWN BUTTON WHEN FLYING, as shutting down the Raspberry Pi can cause disconnection to the station and loss of control.
- Video Type: This function allows you to choose the type of streaming video. Options include:
- RGB Video: Video in RGB format (3 channels).
- Grayscale Video: Video in Grayscale format (1 channel).
NOTE: If your network connection is unstable (weak), use grayscale video for smoother video and lower latency.
- Video quality: This function allows you to choose the quality of streaming video with 4 options:
- Low Quality Video
- Normal quality Video
- High quality Video
- Highest quality Video
NOTE: Higher quality video may increase latency.
Information Datas Display Description: A section displays 'Information Datas' with a table showing 'Time', 'Rcv(MB)', 'Sent(MB)', and 'Expiration' (20-02-19). It also shows the status of 'Camera' (OPENED), 'Recording' (CLOSED), and 'Pix' (CLOSED).
4.0 Video Tutorials
- Setup Hardware: https://www.youtube.com/watch?v=pY0D0c7BCEg&feature=youtu.be
- Setup XBFirm: https://www.youtube.com/watch?v=Es3c3sGtwEU
5.0 Attention
5.1 Check list and error:
If you have problems when using XB Station, you must check the following:
Check list:
# | name | Success status | note |
---|---|---|---|
1 | DCOM 4G ON RPI (you should chose the 4g dcom which have auto connect and check it with rpi, remember turn off wifi when test) | CONNECTED | You can see led stt on dcom 4g. If don't have internet signal, you try: 1:reset, 2: registration, 3: check rpi power enough. |
2 | Internet on computer sation | CONNECTED | |
3 | Pi Connect Pix | OPEN | If Close, check cable |
4 | Pi Connect Camera | OPEN | If Close, check cable |
5 | XBStation Account | Unexpired --/--/-- | You should renew before expiry date |
ERROR:
# | NAME | RESOLVE |
---|---|---|
1 | PI AUTO RESET | Check pi power and cable |
2 | 4G AUTO RESET | Check pi power and cable |
3 | PI don't run | Check SD Full and SD Crash |
4 | Pix status Open but don't have singal | Check baurate config (should be 57) |
5 | Every thing ok and strong internet but stream video look like latency | Maybe your station computer not enough strong. You try test on strong computer. (recommend: core i7, ram 4gb) |
NOTE: If you have problems with XBStation (XBFirm, XBMission planner and hardware config), you can send me via email:
To: creator@xb-uav.com
Subject: Check list and error