Streaming to VLC and controlling drone via skycontroller


#1

Hi all -

I’m following the RTP streaming example of this article : Play Bebop Stream On VLC

Question: How can I control bebop from free flight or skycontroller and receive streams on VLC?

Details:
So I tried the bebop VLC stream and it works fine, however the use case is not clear to me - why would I video stream to VLC, when I cannot control the drone at the same time? The BebopStartStream seems to connect and send a video enable command, then keeps the connection open, however I cannot fly my drone at the same time.

I read in the forum that currently only one connection to the drone is allowed at the time. Okay, this is unusual, as other drones allow multiple clients to interact with a drone. Often secured through a password protected wifi.

However, I also notice that the skycontroller AND the freeflightpro app connect to the drone when connected via the 192.168.43.1 wifi. So skycontroller does allow a second connection - i.e. the phone.
Thanks for your help.


#2

Hi,

If you want to both pilot the drone and receive the video stream on an external RTP client, you basically have two choices:

  1. Modify the BebopStartStream sample to add piloting capabilities. The major downside of this approach is that this sample can not use the libARController API, and thus must use lower level (and harder to use) APIs, because libARController will connect to and consume the video stream.
  2. Connect through a SkyController. As you have seen, the SkyController allow you to have a “secondary” connection to the drone (i.e. the SkyController acts as a proxy, forwarding packets between the drone and the controller application. If your SkyController is already connected to the drone, you should be able to use the sample from the application note by changing the IP address and the port from the .sdp file to 192.168.43.1 and 5004 respectively.

The “easiest” solution would be to use a SkyController 2 with a USB-Ethernet adapter. If you connect your computer through ethernet to the SkyController 2, you just have to launch VLC, and open the network stream http://192.168.43.1:7711/video, and voilà, you have the video on VLC and you can pilot with the SkyController 2 !

Hope this makes the things more clear to you.

Regards,
Nicolas.


#3

Nicolas - thank you so much for the quick response.

I have a Skycontroller 1 and Bebop2 - I tried as per your suggestion:

If your SkyController is already connected to the drone, you should be able to use the sample from the application note by changing the IP address and the port from the .sdp file to 192.168.43.1 and 5004 respectively.
<<

a) I connected Bebop2 to the skycontroller1.

b) I successfully tested video stream to freeflight app and then removed/closed the app on iphone

c) I connected my laptop to Skycontroller wifi on 802.11g, and I can successfully ping the gateway
PING 192.168.43.1 (192.168.43.1): 56 data bytes
64 bytes from 192.168.43.1: icmp_seq=0 ttl=64 time=38.195 ms

d) I started the application:
BebopStreamVLC/BebopDroneStartStream ; exit;
[INF] BebopDroneStartStream | 13:29:38:272 | main:237 - – Bebop Drone Start Stream –
[INF] BebopDroneStartStream | 13:29:38:272 | main:239 - – Starting –
[INF] BebopDroneStartStream | 13:29:38:272 | ardiscoveryConnect:370 - - ARDiscovery Connection
[ERR] ARDISCOVERY_Connection | 13:29:38:274 | ARDISCOVERY_Socket_Connect:752 - connect() failed: 51 Network is unreachable => Try reconnecting after 1 seconds
[ERR] ARDISCOVERY_Connection | 13:29:38:274 | ARDISCOVERY_Socket_Connect:762 - connect() failed: 51 Network is unreachable

[ERR] BebopDroneStartStream | 13:29:53:299 | ardiscoveryConnect:385 - Error while opening discovery connection : timeout error

e) I then connected directly to Bebop2 Wifi from my laptop (skycontroller is still ON) and I get the same error when starting the application.

f) I switched skycontroller OFF and restarted the application from my laptop and immediately everything works well. (but that is the old situation, I can connect video to VLC but then not navigate the drone, this was just to test)

There must be sth blocking the handshake.
Any further suggestions to test? Thank you.


#4

Hi,

In order to use the BebopDroneStartStream sample on a SkyController instead of a Bebop drone, you would also have to tweak 2 lines in the source:

  1. Line 60, change 44444 to 43210
  2. Line 61, change 54321 to 35412

These changes are required because the sample uses hard-coded values instead of dynamically finding them (as FreeFlight does).

I hope I don’t forget anything … :wink:

Nicolas.


#5

We are close I think.

I edited the code the following way:

#define BD_IP_ADDRESS "192.168.**43**.1"
#define BD_DISCOVERY_PORT **43210**
#define BD_C2D_PORT **35412** // should be read from Json
#define BD_D2C_PORT 43210

#define BD_NET_CD_NONACK_ID 10
#define BD_NET_CD_ACK_ID 11
#define BD_NET_CD_EMERGENCY_ID 12
#define BD_NET_DC_NAVDATA_ID 127
#define BD_NET_DC_EVENT_ID 126

#define BD_CLIENT_STREAM_PORT 55004
#define BD_CLIENT_CONTROL_PORT 55005

In addition to what you recommended, I changed the network IP to 192.168.43.1, if I leave it at 42 I get
failed: 51 Network is unreachable

When I do these edits and connect to Skycontroller wifi, start the drone, all lights on skycontroller show up white, run BebopDroneStartStream, I get a successful connection:

[INF] BebopDroneStartStream | 21:07:53:479 | main:237 - -- Bebop Drone Start Stream --
[INF] BebopDroneStartStream | 21:07:53:482 | main:239 - -- Starting --
[INF] BebopDroneStartStream | 21:07:53:482 | ardiscoveryConnect:370 - - ARDiscovery Connection
[INF] BebopDroneStartStream | 21:07:53:553 | ARDISCOVERY_Connection_ReceiveJsonCallback:579 -     - ReceiveJson:{"arstream2_parameter_sets":"TBD","c2d_port":35412,"arstream2_max_bitrate":-1,"arstream2_server_control_port":5005,"arstream2_server_stream_port":5004,"status":0,"arstream_max_ack_interval":-1,"arstream2_max_packet_size":1500,"arstream2_max_network_latency":200,"arstream_fragment_size":65000,"arstream2_max_latency":0,"arstream_fragment_maximum_number":4,"skycontroller_version":"1.6.6"} 
[INF] BebopDroneStartStream | 21:07:53:554 | startNetwork:402 - - Start ARNetwork
[INF] BebopDroneStartStream | 21:07:53:555 | sendBeginStream:512 - - Send Streaming Begin
[ERR] ARNETWORKAL_WifiNetwork | 21:07:53:579 | ARNETWORKAL_WifiNetwork_GetAvailableSendSize:1214 - [0x7fb249f001c0] Error during ioctl 6 (Device not configured)
[INF] ARNETWORKAL_WifiNetwork | 21:07:53:579 | ARNETWORKAL_WifiNetwork_GetAvailableSendSize:1219 - [0x7fb249f001c0] ioctl failed with error ENXIO, stop trying to get available socket buffer size

I load the SDP file:
c=IN IP4 192.168.43.1
m=video 5004 RTP/AVP 96
a=rtpmap:96 H264/90000

Nothing happens in VLC. :frowning:

To test: I go to my other library and connect to Bebop wifi directly, start BebopDroneStartStream and the VLC stream works fine.

So close! But no luck yet.

Any thoughts?


#6

I have the TU2-ET00 eth adapter that did work on a friend of mine’s computer, vlc, skycontroller and bebop2 following these directions. I got the same adapter and it didn’t work. I tried all addresses in vlc from http://192.168.43.1:7711/video to http://192.168.53.1:7711/video. My skycontroller firmware is at 1.0.7. My PC is a windows 10 machine. With an ipconfig, my wireless eth adapter shows up at 192.168.42.44. Any ideas on what I may be doing wrong.