maverick
maverick copied to clipboard
Network: Support svpcom wifibroadcast
Broken out from https://github.com/goodrobots/maverick/issues/437
Main repo: https://github.com/svpcom/wifibroadcast
Referring to the new wifibroadcast as wifibc, to differentiate the projects. Compile/install implemented, but wifibc works differently to wifibroadcast. wifibroadcast takes a byte stream pipe whereas wifibc is hardcoded to take a udp rtp stream on port 5600. So the gstreamer pipeline for wifibc needs to send an rtp encapsulated stream to udpsink, whereas wifibroadcast either pipes raspivid directly or uses fdsink from gstreamer.
So create a separate systemd service manifest for wifibc which can run standalone and listen for packets on port 5600. Network interface post action for network-if-monitor.sh should remain the same.
this is also supporting mavlink telemetry correct? so if you have maverick on robot and maverick with gcs this should support video and telemetry via wifibc?
Ideally, yes
Support should be complete, maverick services added: wifibc_tx and wifibc_rx. Config added in ~/config/network/wifibc, keys go in ~/data/network/wifibc.
Need to document, but to activate, change settings in ~/data/vision/maverick-visiond.conf to:
output = udp
output_dest = 127.0.0.1
output_port = 5600
^^ This tells visiond to output rtp udp stream.
Turn on wifibc in localconf:
"maverick_network::wifibroadcast::tx_active": true,
Then create a wifibroadcast interface in localconf as per network docs (eg. wcast0), and specify the interface in ~/config/network/wifibc/tx.conf
INTERFACE=wcast0
Reboot to activate everything. At this point visiond should be streaming rtp udp to localhost 5600, and wifibc_tx service should be running which picks up the rtp udp stream and broadcasts it over the specified interface.
Todo: document receiver, but is essentially the above in reverse. Need to copy the rx key (~/data/network/wifibc/rx.key) from the sender(tx) computer to the receiver.
Got this on an RPi2. Looks like just keygen and this is for my rx anyway.
Notice: /Stage[main]/Maverick_network::Wifibroadcast/File[/srv/maverick/data/network/wifibc]/ensure: created
Error: Could not find command '/srv/maverick/software/wifibc/bin/keygen'
Error: /Stage[main]/Maverick_network::Wifibroadcast/Exec[wifibc-genkeys]/returns: change from 'notrun' to ['0'] failed: Could not find command '/srv/maverick/software/wifibc/bin/keygen'
Notice: /Stage[main]/Maverick_network::Wifibroadcast/File[/srv/maverick/config/network/wifibc]/ensure: created
Looks like an ordering issue, could you attach the log?
Ordering fixed
Need to add kernel pcap permissions for wifibc_tx/rx:
May 01 12:27:25 maverick-up wifibc.sh[6861]: /srv/maverick/software/wifibc/bin/tx -K /srv/maverick/data/network/wifibc/tx.key -k 8 -n 12 -u 5600 -p 1 wcast0
May 01 12:27:25 maverick-up wifibc.sh[6861]: Error: pcap_activate failed: socket: Operation not permitted
May 01 12:27:25 maverick-up systemd[1]: maverick-wifibc_tx.service: Main process exited, code=exited, status=1/FAILURE
May 01 12:27:25 maverick-up systemd[1]: maverick-wifibc_tx.service: Unit entered failed state.
May 01 12:27:25 maverick-up systemd[1]: maverick-wifibc_tx.service: Failed with result 'exit-code'.
May 01 12:27:39 maverick-up sudo[6968]: mav : TTY=pts/2 ; PWD=/srv/maverick/software/maverick ; USER=root ; COMMAND=/bin/journalctl -xe
Latest self-update on rpi0w went well so I assume ordering is fixed. Not sure how the interface errors from #770 might impact wifibc so I'll wait until you give me the all clear to proceed with testing.
OK, so it looks like #770 is not a critical dependency. I'll give it another try today and report back.
Also want to note here that documentation of the config setting for wifibc will be important. Once I get the prototype working I'll drop an issue over in the svpcom wifibc queue which will ask nicely for a well documented conf file.
There is no conf file for wifibc - I've created a wrapper systemctl/config file system within Maverick. Better documentation of the various settings would be nice to have though.
Got it. My main concern would be things like how to assign channels/freq. That's pretty well documented in the ezwifibroadcst config. I am assuming since this is using UDP vs byte stream there are not as many tweaks to the other settings?
Right so there is a config file per interface in ~/config/network/interface-
Also I did some work on netinfo recently, so maverick netinfo should return quite a bit more info about each network interface.
Definitely want to do a complete overhaul of video including wbc for 2.0
hmm. sorry. not sure how i modified the milestones??? i blame one of my cats.