Servers by jDrones

APSync + rPiZero + Internet?


(trearick) #1

I have APSync working as a hotspot on a raspberry pi zero wired to a pixhawk hexacopter. I can upload dronekit-python scripts and Mavlink is working great. It is all flying and triggering processes by monitoring switches on my Taranis. Life is good, eh?

No. I want more. Is there some way I can add another wireless dongle and bridge to the internet? I would like to update python 2 to 3 but apt-get is useless without access to the Internet. I can’t even upload python scripts to the rPi Zero and browse the Internet from my development machine at the same time. Am I missing something?

Failing an easy way to bridge to the Internet, is there an easy way to disable the hotspot and perhaps assign a fixed IP address?

It’s not a hotspot if can’t reach the Internet, is it?

Seriously, I am grateful for the work some very smart people have offered up to the likes of me.


(peterbarker) #2

Sure. Try an LTE modem and use zerotier if you like :slight_smile:

Using Ubuntu has advantages…


(Anthony Short) #3

If you’re able to run a USB cable to the aircraft for updates etc, set up an “Ethernet Gadget” on the pi, connect it to a laptop that’s on the Internet and turn on Internet connection sharing on the laptop. I’ve done this (on the bench) with APsync on a pi zero successfully. Works on pi zero only, not a full size pi.


(trearick) #4

Thanks. I will try that.
tom


(Peter Burke) #5

Hi can you explain how you enabled the ethernet gadget.
I tried these directions:


and

My original install was apsync.

Now, I can ping through the ethernet gadget, but it says “connection refused” when I try to SSH in through the ethernet/usb port.

When I log into the local wifi (ardupilot), I can ssh in.

Did you get the pi zero w working with the ethernet gadget using apsync or raspbian?


(Anthony Short) #6

It’s been a year since I worked on this. Unfortunately I don’t recall the exact steps I took. I think the instructions I followed where here, specifically steps 2 and 4. However since you have a working interface for ping it sounds like you’ve successfully passed this point.

I was using the apsync image.

When you say you can “ping through the gadget”, do you mean you can ping the pi gadget interface from your computer?

Do you have Internet connection sharing enabled on your computer for the gadget connection? I’m not sure if that is required in order to get local SSH working, but it would be worth trying just in case that sets up the necessary routing on whatever OS you’re using.

I’d check /etc/ssh/sshd_config on the pi to verify the SSH server is running on all interfaces. Take a look at /var/log/auth.log on the pi to see if there are any interesting error messages from sshd indicating why the connection was refused. Check you don’t have iptables running or anything that might block incoming connections.

I just powered up my pi and it’s still working so if you need any specific information from mine I’m happy to provide it.


(Peter Burke) #7

Thanks!
I did get it to work, following the instructions in my link, but there were some subtleties.
The main thing is the instructions say to login to raspberrypi.local, but that fails because in the apsync distro, you should login to apsync.local.
Once I figured that out, and did the file configurations on the pi as in the instructions, it worked beautifully.

Thanks so much for the idea!!!
It’s great to have a internet access for the pi!

-Peter


(Peter Burke) #8

Anthony-

Are you able to connect from Mission Planner through the Pi Zero running wifi to the flight controller?

I have troubles connecting Mission Planner to AP Sync (on both Pi Zero and Pi 3, see post
APSync cmavnode UDP heartbeat and other packets not accepted by client PC when MAVProxy UDP packets are accepted: why?).


(Peter Burke) #9

Got it to work.
Only worked on 57600 baud for some reason.
Using Omnibus F4 pro V2 with Chibios. Maybe that’s why.