Closed QiXuanWang closed 5 years ago
Wifibroadcast will do this itself.
I see. Any reason the LED is off? Do I need to configure something?
what is output of sudo journalctl -x -u wifibroadcast@drone
or sudo journalctl -x -u wifibroadcast@gs
?
I didn't start the service actually. I'm testing the video link. Let me try to run the service and report back.
an 25 23:20:38 raspberrypi python[9741]: 2019-01-25 23:20:38+0800 [-] video rx: unable to decrypt packet #0x56201 Jan 25 23:20:38 raspberrypi python[9741]: 2019-01-25 23:20:38+0800 [-] video rx: unable to decrypt packet #0x56202 Jan 25 23:20:38 raspberrypi python[9741]: 2019-01-25 23:20:38+0800 [-] video rx: unable to decrypt packet #0x56203 Jan 25 23:20:38 raspberrypi python[9741]: 2019-01-25 23:20:38+0800 [-] video rx: unable to decrypt packet #0x56204
... So it's actually failed to decrypt. It's weird. I'm using the key pairs generated by TX RPI's wfb_keygen. I'm using scp. Anything that I should pay attention to??
Try to run TX and RX (wifibroadcast@gs and wifibroadcast@done) on the same machile (for example on PC with two wifi card connected) and run test video source and sink through it. tx video:
gst-launch-1.0 videotestsrc ! videoconvert ! video/x-raw,format=NV12,framerate=60/1,width=1280,height=720 ! clockoverlay time-format='%s' ! x264enc tune=zerolatency bitrate=4000 ! rtph264pay config-interval=-1 ! udpsink host=localhost port=5602
rx video:
gst-launch-1.0 udpsrc port=5600 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! vaapih264dec ! clockoverlay halignment=left valignment=bottom time-format='%s' ! vaapisink sync=false
Also try to generate a new keypair.
Attach journalctl full log (from daemon start, not only last lines)
Run wfb-cli gs
to see realtime monitoring
-- Unit wifibroadcast@drone.service has finished starting up. -- -- The start-up result is done. Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] Log opened. Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] # iw reg set BO Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] # ifconfig wlan1 down Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] # iw dev wlan1 set monitor otherbss Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] # ifconfig wlan1 up Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] # iw dev wlan1 set channel 165 HT20 Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] Listen for telem stream 1(RX), 2(TX) on 0.0.0.0:14550 Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] UDPProxyProtocol starting on 14550 Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] UDPProxyProtocol starting on 14700 Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] UDPProxyProtocol starting on 39410 Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] Telem RX: /usr/bin/wfb_rx -p 1 -u 14700 -K /etc/drone.key Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] Telem TX: /usr/bin/wfb_tx -p 2 -u 14701 -K /etc/drone.key Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] Started telem rx Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] Started telem tx Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] Listen for video stream 3 on 0.0.0.0:5600 Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] Started video tx Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] Video: /usr/bin/wfb_tx -p 3 -u 5600 -K /etc/drone.key -B Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] telem tx: Listen on 14701 for wlan1 Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] video tx: Listen on 5600 for wlan1 Jan 27 14:49:08 raspberrypi python[1541]: 2019-01-27 14:49:08+0800 [-] telem rx: wlan1 has DLT_IEEE802_11_RADIO Encap
an 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] Log opened.
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] # iw reg set BO
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] # ifconfig wlan1 down
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] # iw dev wlan1 set monitor otherbss
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] # ifconfig wlan1 up
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] # iw dev wlan1 set channel 165 HT20
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] Connect telem stream 2(RX), 1(TX) to 127.0.0.1:14550
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] UDPProxyProtocol starting on 59801
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] UDPProxyProtocol starting on 14600
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] UDPProxyProtocol starting on 52606
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] Telem RX: /usr/bin/wfb_rx -p 2 -u 14600 -K /etc/gs.key wlan1
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] Telem TX: /usr/bin/wfb_tx -p 1 -u 14601 -K /etc/gs.key -B 20 -G long -S
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] AntennaFactory starting on 8001
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] Started telem rx
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] Started telem tx
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] Send video stream 3 to 127.0.0.1:5600
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] AntennaFactory starting on 8002
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] Started video rx
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] Video: /usr/bin/wfb_rx -p 3 -c 127.0.0.1 -u 5600 -K /etc/gs.key wlan1
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] telem tx: Listen on 14601 for wlan1
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] telem rx: wlan1 has DLT_IEEE802_11_RADIO Encap
Jan 27 14:50:37 raspberrypi python[7791]: 2019-01-27 14:50:37+0800 [-] video rx: wlan1 has DLT_IEEE802_11_RADIO Encap
Jan 27 14:50:39 raspberrypi python[7791]: 2019-01-27 14:50:39+0800 [-] video rx: unable to decrypt packet #0x112b06
Jan 27 14:50:39 raspberrypi python[7791]: 2019-01-27 14:50:39+0800 [-] video rx: unable to decrypt packet #0x112b07
Jan 27 14:50:39 raspberrypi python[7791]: 2019-01-27 14:50:39+0800 [-] video rx: unable to decrypt packet #0x112b08
Jan 27 14:50:39 raspberrypi python[7791]: 2019-01-27 14:50:39+0800 [-] video rx: unable to decrypt packet #0x112b09
Jan 27 14:50:39 raspberrypi python[7791]: 2019-01-27 14:50:39+0800 [-] video rx: unable to decrypt packet #0x112b0a
Jan 27 14:50:39 raspberrypi python[7791]: 2019-01-27 14:50:39+0800 [-] video rx: unable to decrypt packet #0x112b0b
Jan 27 14:50:39 raspberrypi python[7791]: 2019-01-27 14:50:39+0800 [-] video rx: unable to decrypt packet #0x112c01
Jan 27 14:50:39 raspberrypi python[7791]: 2019-01-27 14:50:39+0800 [-] video rx: unable to decrypt packet #0x112c02
Jan 27 14:50:39 raspberrypi python[7791]: 2019-01-27 14:50:39+0800 [-] video rx: unable to decrypt packet #0x112c03
Jan 27 14:50:39 raspberrypi python[7791]: 2019-01-27 14:50:39+0800 [-] video rx: unable to decrypt packet #0x112c04
Jan 27 14:50:39 raspberrypi python[7791]: 2019-01-27 14:50:39+0800 [-] video rx: unable to decrypt packet #0x112c05
Jan 27 14:50:39 raspberrypi python[7791]: 2019-01-27 14:50:39+0800 [-] video rx: unable to decrypt packet #0x112c06
Jan 27 14:50:39 raspberrypi python[7791]: 2019-01-27 14:50:39+0800 [-] video rx: unable to decrypt packet #0x112c07
Jan 27 14:50:39 raspberrypi python[7791]: 2019-01-27 14:50:39+0800 [-] video rx: unable to decrypt packet #0x112c08
...
Jan 27 14:51:08 raspberrypi python[7791]: 2019-01-27 14:51:08+0800 [-] video rx: New session detected
Jan 27 14:51:08 raspberrypi python[7791]: 2019-01-27 14:51:08+0800 [-] video rx: 46359 packets lost
Jan 27 14:51:15 raspberrypi python[7791]: 2019-01-27 14:51:15+0800 [-] video rx: 2776 packets lost
....
Jan 27 14:56:35 raspberrypi python[7791]: 2019-01-27 14:56:35+0800 [-] video rx: override block 0x5390 with 0 fragments
Jan 27 14:56:35 raspberrypi python[7791]: 2019-01-27 14:56:35+0800 [-] video rx: override block 0x5391 with 0 fragments
Jan 27 14:56:35 raspberrypi python[7791]: 2019-01-27 14:56:35+0800 [-] video rx: override block 0x5392 with 0 fragments
Jan 27 14:56:35 raspberrypi python[7791]: 2019-01-27 14:56:35+0800 [-] video rx: override block 0x5393 with 0 fragments
Jan 27 14:56:35 raspberrypi python[7791]: 2019-01-27 14:56:35+0800 [-] video rx: override block 0x5394 with 3 fragments
Jan 27 14:56:35 raspberrypi python[7791]: 2019-01-27 14:56:35+0800 [-] video rx: 14611 packets lost
Jan 27 14:56:42 raspberrypi python[7791]: 2019-01-27 14:56:42+0800 [-] video rx: 2728 packets lost
...
Jan 27 14:57:35 raspberrypi python[7791]: 2019-01-27 14:57:35+0800 [-] video rx: override block 0x5f6a with 6 fragments
Jan 27 14:57:35 raspberrypi python[7791]: 2019-01-27 14:57:35+0800 [-] video rx: override block 0x5fad with 0 fragments
Jan 27 14:57:35 raspberrypi python[7791]: 2019-01-27 14:57:35+0800 [-] video rx: 850 packets lost
Jan 27 14:57:43 raspberrypi python[7791]: 2019-01-27 14:57:43+0800 [-] video rx: 2792 packets lost
Jan 27 14:57:48 raspberrypi python[7791]: 2019-01-27 14:57:48+0800 [-] telem rx: Error: socket error!
Jan 27 14:57:48 raspberrypi python[7791]: 2019-01-27 14:57:48+0800 [-] video rx: Error: socket error!
Jan 27 14:57:48 raspberrypi python[7791]: 2019-01-27 14:57:48+0800 [-] Stopped RX telem rx with code 1
Jan 27 14:57:48 raspberrypi python[7791]: 2019-01-27 14:57:48+0800 [-] Stopping reactor due to fatal error: A process has ended with a probabl
Jan 27 14:57:48 raspberrypi python[7791]: 2019-01-27 14:57:48+0800 [-] (UDP Port 59801 Closed)
Jan 27 14:57:48 raspberrypi python[7791]: 2019-01-27 14:57:48+0800 [-] (UDP Port 14600 Closed)
Jan 27 14:57:48 raspberrypi python[7791]: 2019-01-27 14:57:48+0800 [-] (UDP Port 52606 Closed)
Jan 27 14:57:48 raspberrypi python[7791]: 2019-01-27 14:57:48+0800 [-] Stopped RX video rx with code 1
Jan 27 14:57:48 raspberrypi python[7791]: 2019-01-27 14:57:48+0800 [-] Unhandled error in Deferred:
Jan 27 14:57:48 raspberrypi python[7791]: 2019-01-27 14:57:48+0800 [-] Unhandled Error
Jan 27 14:57:48 raspberrypi python[7791]: Traceback (most recent call last):
Jan 27 14:57:48 raspberrypi python[7791]: Failure: twisted.internet.error.ProcessTerminated: A process has ended with a probable error
Jan 27 14:57:48 raspberrypi python[7791]:
Jan 27 14:57:48 raspberrypi python[7791]: 2019-01-27 14:57:48+0800 [main.AntennaFactory] (TCP Port 8001 Closed)
Jan 27 14:57:48 raspberrypi python[7791]: 2019-01-27 14:57:48+0800 [main.AntennaFactory] (TCP Port 8002 Closed)
Jan 27 14:57:48 raspberrypi python[7791]: 2019-01-27 14:57:48+0800 [-] Main loop terminated.
Jan 27 14:57:48 raspberrypi python[7791]: 2019-01-27 14:57:48+0800 [-] Exiting with code 1
Jan 27 14:57:48 raspberrypi systemd[1]: wifibroadcast@gs.service: Main process exited, code=exited, status=1/FAILURE
Jan 27 14:57:48 raspberrypi systemd[1]: wifibroadcast@gs.service: Unit entered failed state.
Jan 27 14:57:48 raspberrypi systemd[1]: wifibroadcast@gs.service: Failed with result 'exit-code'.
Jan 27 14:57:53 raspberrypi systemd[1]: wifibroadcast@gs.service: Service hold-off time over, scheduling restart.
Jan 27 14:57:53 raspberrypi systemd[1]: Stopped WFB profile gs.
Jan 27 14:57:53 raspberrypi systemd[1]: Started WFB profile gs.
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] Log opened.
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] # iw reg set BO
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] # ifconfig wlan1 down
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] # iw dev wlan1 set monitor otherbss
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] # ifconfig wlan1 up
an 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] # iw dev wlan1 set channel 165 HT20
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] Connect telem stream 2(RX), 1(TX) to 127.0.0.1:14550
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] UDPProxyProtocol starting on 49509
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] UDPProxyProtocol starting on 14600
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] UDPProxyProtocol starting on 40152
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] Telem RX: /usr/bin/wfb_rx -p 2 -u 14600 -K /etc/gs.key wlan1
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] Telem TX: /usr/bin/wfb_tx -p 1 -u 14601 -K /etc/gs.key -B 20 -G long -S
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] AntennaFactory starting on 8001
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] Started telem rx
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] Started telem tx
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] Send video stream 3 to 127.0.0.1:5600
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] AntennaFactory starting on 8002
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] Started video rx
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] Video: /usr/bin/wfb_rx -p 3 -c 127.0.0.1 -u 5600 -K /etc/gs.key wlan1
Jan 27 14:57:55 raspberrypi python[7990]: 2019-01-27 14:57:55+0800 [-] telem tx: Listen on 14601 for wlan1
Jan 27 14:57:56 raspberrypi python[7990]: 2019-01-27 14:57:56+0800 [-] telem rx: wlan1 has DLT_IEEE802_11_RADIO Encap
Jan 27 14:57:56 raspberrypi python[7990]: 2019-01-27 14:57:56+0800 [-] video rx: wlan1 has DLT_IEEE802_11_RADIO Encap
Jan 27 14:57:57 raspberrypi python[7990]: 2019-01-27 14:57:57+0800 [-] video rx: unable to decrypt packet #0x640707
Jan 27 14:57:57 raspberrypi python[7990]: 2019-01-27 14:57:57+0800 [-] video rx: unable to decrypt packet #0x640709
....
============= Other testing will be done when I have another Linux computer running
Run
wfb-cli gs
to see realtime monitoring
This reports link lost every 2 seconds. Probably the driver is not installed correctly?
OK.... I'm glad I bought a testing 9271 wificards :) This one works perfectly fine except for slow refreshing speed for RX. I think which could be improved by gst-launch settings.
So the problem should be 8812au driver. I'll see what's wrong with it...
1. Check link with **both cards** on PC (not on RPI) using videotestsrc with bitrate **4mbps** 2. If WFB on PC works, then check card power (connect directly to +5v, not to USB +5v, becase RPI usb power is too weak)
The second point makes sense though with EZWifi it still works with same testing condition.
By "card power", do you mean power RPI through GPIO power pins or did I misunderstand?
No. USB 2.0 is 0.5A max (by spec). It is ~2.5W. Some arm boards have weak usb power chain and high-power load (like 1w wifi card) can overload it. I recommend to connect its usb +5v pin directly to +5v rail and add low-esr capacitor like ESC has.
Thanks. I read about this problem at EZWifi wiki page but since my ASUS ac56 card worked with the testing image I thought it was OK. The USB on wifi is 3.0 but since RPI USB is 2.0, the power problem should still be there.
I'll close this issue as it's mainly power problem.
It's possible to change the USB modeswitch behaviour. Take a look https://github.com/kimocoder/rtl8188eus/commit/74161a96518ec08741ec7dd6082dab9f92b44e2b on howto
This can be done in runtime via rtw_switch_usb_mode=0
module arg or just use usb2 data cable.
After driver installation, do I need to set the wifi into monitor mode? Or if the wifi is working then everything is done?