maverick icon indicating copy to clipboard operation
maverick copied to clipboard

Network: Support svpcom wifibroadcast

Open fnoop opened this issue 7 years ago • 19 comments
trafficstars

Broken out from https://github.com/goodrobots/maverick/issues/437

fnoop avatar Apr 23 '18 08:04 fnoop

Main repo: https://github.com/svpcom/wifibroadcast

fnoop avatar Apr 23 '18 08:04 fnoop

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.

fnoop avatar Apr 27 '18 20:04 fnoop

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.

fnoop avatar Apr 27 '18 20:04 fnoop

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?

cglusky avatar Apr 27 '18 22:04 cglusky

Ideally, yes

fnoop avatar Apr 28 '18 17:04 fnoop

Support should be complete, maverick services added: wifibc_tx and wifibc_rx. Config added in ~/config/network/wifibc, keys go in ~/data/network/wifibc.

fnoop avatar Apr 29 '18 15:04 fnoop

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.

fnoop avatar Apr 29 '18 15:04 fnoop

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

cglusky avatar May 01 '18 02:05 cglusky

Looks like an ordering issue, could you attach the log?

fnoop avatar May 01 '18 06:05 fnoop

Ordering fixed

fnoop avatar May 01 '18 09:05 fnoop

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

fnoop avatar May 01 '18 11:05 fnoop

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.

cglusky avatar May 08 '18 02:05 cglusky

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.

cglusky avatar May 08 '18 17:05 cglusky

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.

fnoop avatar May 08 '18 18:05 fnoop

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?

cglusky avatar May 08 '18 19:05 cglusky

Right so there is a config file per interface in ~/config/network/interface-.conf. The settings in there are commented out but if uncommented are supposed to be used by either normal networking or monitor/inject (wifibc) mode. In practice it's quite difficult to get right and I'm not sure how effective they are yet. See #606

fnoop avatar May 08 '18 19:05 fnoop

Also I did some work on netinfo recently, so maverick netinfo should return quite a bit more info about each network interface.

fnoop avatar May 08 '18 19:05 fnoop

Definitely want to do a complete overhaul of video including wbc for 2.0

fnoop avatar May 17 '18 18:05 fnoop

hmm. sorry. not sure how i modified the milestones??? i blame one of my cats.

cglusky avatar May 18 '18 18:05 cglusky