Difference between revisions of "Explorer/RaspberryPi/Wifibroadcast/Integration"

From PaparazziUAV
Jump to navigation Jump to search
Line 34: Line 34:
     ! udpsink host=127.0.0.1 port=5600 &
     ! udpsink host=127.0.0.1 port=5600 &


  #GroundPi: locally UDP port 5600
  #GroundPi: locally UDP port 5600, and fpv_video displays to HDMI
  rm /tmp/camera*; \
  rm /tmp/camera*; \
  gst-launch-1.0 udpsrc port=5600 \
  gst-launch-1.0 udpsrc port=5600 \
Line 46: Line 46:
   | /home/pi/wifibroadcast_osd/fpv_video/fpv_video &
   | /home/pi/wifibroadcast_osd/fpv_video/fpv_video &


"fpv_video" displays to HDMI


Telemetry stream:
Telemetry stream:

Revision as of 09:04, 23 June 2020

Wifibroadcast streams:

  • channel 1: downlink camera live video
  • channel 2: downlink autopilot telemetry
  • channel 3: uplink autopilot telemetry
  • channel 4: uplink UDP tunnel
  • channel 5: downlink UDP tunnel
Airpi
/home/pi/wifibroadcast-svpcom/wfb_tx -K /home/pi/wifibroadcast-svpcom/drone.key -p 1 -u 5600 wlan1
/home/pi/wifibroadcast-svpcom/wfb_tx -K /home/pi/wifibroadcast-svpcom/drone.key -p 2 -u 4242 wlan1
/home/pi/wifibroadcast-svpcom/wfb_rx -K /home/pi/wifibroadcast-svpcom/drone.key -p 3 -u 4243 -c 127.0.0.1 wlan1
/home/pi/wifibroadcast-svpcom/wfb_tx -K /home/pi/wifibroadcast-svpcom/drone.key -p 5 -u 14900 -k 1 -n 2 wlan1
/home/pi/wifibroadcast-svpcom/wfb_rx -K /home/pi/wifibroadcast-svpcom/drone.key -p 4 -u 14901 -c 127.0.0.1 -k 1 -n 2 wlan1

Groundpi
/home/pi/wifibroadcast-svpcom/wfb_rx -K /home/pi/wifibroadcast-svpcom/drone.key -p 1 -c 127.0.0.1 -u 5600 wlan1
/home/pi/wifibroadcast-svpcom/wfb_rx -K /home/pi/wifibroadcast-svpcom/drone.key -p 2 -u 4242 -c GCS_IP wlan1
/home/pi/wifibroadcast-svpcom/wfb_tx -K /home/pi/wifibroadcast-svpcom/drone.key -p 3 -u 4243 wlan1
/home/pi/wifibroadcast-svpcom/wfb_tx -K /home/pi/wifibroadcast-svpcom/drone.key -p 4 -u 14800 -k 1 -n 2 wlan1
/home/pi/wifibroadcast-svpcom/wfb_rx -K /home/pi/wifibroadcast-svpcom/drone.key -p 5 -u 14801 -c 127.0.0.1 -k 1 -n 2 wlan1

Camera stream:

#Airpi: locally UDP port 5600
rm /tmp/camera*; \
/usr/bin/raspivid -t 0 -w 640 -h 480 -fps 30/1 -b 3000000 -g 5 -cd H264 -n -fl -ih -pf high -if both -ex sports -mm average -awb horizon -a ENAC -ae 22 -o - \
 | gst-launch-1.0 fdsrc \
   ! h264parse \
   ! video/x-h264,stream-format=byte-stream \
   ! shmsink socket-path=/tmp/camera1 wait-for-connection=false sync=false &
 gst-launch-1.0 shmsrc socket-path=/tmp/camera1 do-timestamp=true \
   ! video/x-h264,stream-format=byte-stream,alignment=au \
   ! rtph264pay name=pay0 pt=96 config-interval=1 \
   ! udpsink host=127.0.0.1 port=5600 &
#GroundPi: locally UDP port 5600, and fpv_video displays to HDMI
rm /tmp/camera*; \
gst-launch-1.0 udpsrc port=5600 \
   ! application/x-rtp, encoding-name=H264,payload=96 \
   ! rtph264depay \
   ! video/x-h264,stream-format=byte-stream \
   ! shmsink socket-path=/tmp/camera1 wait-for-connection=false sync=false &
gst-launch-1.0 shmsrc socket-path=/tmp/camera1 do-timestamp=true \
   ! video/x-h264,stream-format=byte-stream,alignment=au \
   ! fdsink \
 | /home/pi/wifibroadcast_osd/fpv_video/fpv_video &


Telemetry stream:

#Airpi: send to autopilot from port 4243, get from autopilot to port 4242 locally
socat -u udp-listen:4243,reuseaddr,fork /dev/ttyAMA0,raw,echo=0,b115200 &
socat -u /dev/ttyAMA0,raw,echo=0,b115200 udp-sendto:127.0.0.1:4242 &
#GroundPi: inputs on port 4242, outputs on 4243
#default pprlink ports