Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send telemetry over usb-ethernet on SkyController2 #4

Closed
lucasdemarchi opened this issue Feb 25, 2020 · 8 comments · Fixed by #19
Closed

Send telemetry over usb-ethernet on SkyController2 #4

lucasdemarchi opened this issue Feb 25, 2020 · 8 comments · Fixed by #19
Labels

Comments

@lucasdemarchi
Copy link
Collaborator

Route network packets from the drone through SkyController2 to the GCS.

@AndKe
Copy link
Collaborator

AndKe commented May 8, 2020

Please: video stream too

@lucasdemarchi
Copy link
Collaborator Author

My intention here is to enable port forwarding in the SkyController2 so this is done automatically by the kernel network stack. For video this should work fine. We only need to fwd one port (888, if I remember correctly). The challenge is to work with the Disco's kernel and its proprietary network driver: we may hit a roadblock of something missing there that we can't workaround.

For telemetry, we will probably need to change how we start arduplane: right now arduplane sends the mavlink heartbeat as broadcast and as soon as someone replies it locks to that address. This works great if the actual GCS is in the same subnet, but it's not the case here. So I think we will probably need a component in the SkyController2 side to do the initial setup (e.g. it connects to Disco and as soon as the real GCS is connected, it sets up the port forwarding) or as an alternative also install mavlink-router on SkyController2. This would allow to traverse the subnet, but with an additional component - the lack of storage space on SkyController2 and requiring one more component to setup there worries me a little bit.

@tridge, since you have much more experience than me on this, if you can comment on that would be nice. Thanks.

@tridge
Copy link

tridge commented May 30, 2020

since you have much more experience than me on this, if you can comment on that would be nice

I've never played with the skycontroller, sorry. Setting up port fwding does sound like the right approach though

@lucasdemarchi
Copy link
Collaborator Author

Playing with it today. I can forward mavlink using iptables, but only if arduplane is started without broadcasting. If it uses broadcast, then it doesn't work.

Bad thing about not using broadcast is:

  1. arduplane would need to know the skycontroller IP
  2. skycontroller would need to know the GCS IP to forward packets to

I think the second is unavoidable, but the first one is troublesome. Trying to figure out if there's an alternative connection mechanism to make this simpler.

@lucasdemarchi
Copy link
Collaborator Author

Humn... Answer is: switch to udpin rather than relying on udp and bcast flag. That means SkyController only needs to know Disco's IP (and that is easy, since it's fixed) and GCS only needs to know the SkyController IP on usb. And those are easy since they are fixed.

On SkyController2:

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p udp --dport 14550 -j DNAT --to-destination 192.168.42.1
iptables -t nat -A POSTROUTING -p udp --dport 14550 -j MASQUERADE

On Disco: change start arguments to: -A udpin:0.0.0.0:14550 -B /dev/ttyPA1

On GCS: set it to use udpin, configuring the IP to 192.168.53.1.

Now I need to add this to install scripts and documentation

@kikislater
Copy link

@AndKe Does udpin works for you ?

@AndKe
Copy link
Collaborator

AndKe commented Sep 1, 2020

@kikislater Yes, I flew what Lucas assembled before the summer vacation, and it all worked.
I remember that QGC on Android was not willing to talk to SC2, but a laptop worked fine.
Otherwise: only pant/tilt of the camera was missing.

@kikislater
Copy link

Ok thank you, strange it doesn't route mavlink packets in my case ...

Pan / Tilt is done with software, it's not mechanic : pixel shifting. I didn't remember but I checked in the past and I thought they used opencv for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants