Wifibroadcast 2.3ghz and video streaming with Wifi AP

pre-requisites : you must configure your access point on the Ground Control Station (GCS) here : Ground Station Wifi Access Point Configuration

First solution: Broadcast over wifi network at 2.3GHz & 30dBm (1) from the drone « MyPiDrone » using the AP on the ground station (WiFi Access Point on Ubuntu)

This method allow to transmit video to devices connected to the AP of the ground control station (PC with Ubuntu). Also it’s possible to address several other OS such as:

(1) Configuration of wireless network 2.3GHz under Android is not yet finalized for the moment. However  you can validate this solution at 2.4Ghz with Android Beta Tower or QtGStreamerHUD.apk

Here we use a TP-LINK (wlan0) on the drone and a TP-LINK (wlan0) on the ground control station.

Please note however that solution is less efficient than the Wifibroadcast (lower range and more latency): We have validated this implementation without testing effectiveness.

For Android application you  must select : udp broadcast network (10.0.0.255) ou ip (10.0.0.12)

raspivid -ih -t $TIMEOUT -w $WIDTH -h $HEIGHT -fps $FPS -b $BITRATE -n -g $KEYFRAMERATE -pf high -o - |gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=10 pt=96 ! udpsink port=5000 host=10.0.0.12
Video for Android application

For a VLC client (http, rtsp) :

## mandatory to run cvlc with root user
strings /usr/bin/vlc|egrep "getppid|geteuid"
C=`strings /usr/bin/vlc|grep -c getppid`
if [ $C -eq 1 ]; then
echo "VLC getppid already set"
else
cp /usr/bin/vlc /usr/bin/vlc.ori
sed -i 's/geteuid/getppid/' /usr/bin/vlc
strings /usr/bin/vlc|egrep "getppid|geteuid"
fi
#### http
raspivid -ih -t $TIMEOUT -w $WIDTH -h $HEIGHT -fps $FPS -b $BITRATE -n -g $KEYFRAMERATE -pf high -o - |cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:5000}' :demux=h264
#### rtsp
raspivid -ih -t $TIMEOUT -w $WIDTH -h $HEIGHT -fps $FPS -b $BITRATE -n -g $KEYFRAMERATE -pf high -o - |cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:5000/}' :demux=h264
video for VLC client

Second solution: Transmission Video Wifibroadcast at 2.3GHz from the drone « MyPiDrone » to Ground Control Station (GCS) and  rebroadcast on the 2.4GHz wireless network using the Access Point to the connected equipment.

This solution uses a TP-LINK (wlan1: monitor mode) on the drone and two TP-LINK (wlan0 AP and wlan1: monitor mode) on the ground control station.

On the drone the transmission of video is in Wifibroadcast (wlan1):

raspivid -ih -t $TIMEOUT -w $WIDTH -h $HEIGHT -fps $FPS -b $BITRATE -n -g $KEYFRAMERATE -pf high -o - | tee $VIDEO | ./tx -p $PORT -b $BLOCK_SIZE -r $FECS -f $PACKET_LENGTH $WLAN
wifibroadcast video

Linux on the ground control station receiving video over Wifibroadcast (wlan1)  and rebroadcast video to Android application connected to the AP (wlan0) :

./rx -p $PORT -b $BLOCK_SIZE -r $FECS -f $PACKET_LENGTH $WLAN |gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=10 pt=96 ! udpsink port=5000 host=10.0.0.12
Video streaming for Android application

Or retransmission of video VLC to a client connected to the AP (wlan0) :

./rx -p $PORT -b $BLOCK_SIZE -r $FECS -f $PACKET_LENGTH $WLAN |cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:5000}' :demux=h264
video streaming for VLC client

NOTE : Instead raspivid you can use picamera. See : Overlaying telemetry text on video before Wifibroadcast

Pages

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *