Servers by jDrones

Help installing APSync on RaspPi4 with Raspbian Buster

The documentation says to use a disc image to use APSync with RaspPi3 but there are no instructions on how to set it up manually. I’d like to install it on a RaspPi4 with the latest Raspbian Buster OS. I tried using an image provided by Stephen Dade here New APSync Build for Raspberry Pi but my Pi was non-responsive with that image.
Can anybody guide me through installing APSync manually?
Thanks

For the APSync you referenced above, there’s instructions over at GitHub: https://github.com/stephendade/apsync-Kakute#running

Hi Stephen. I’m trying to follow your instructions. Main1 executes fine and the pi reboots. Main2 fell over at ‘sudo apt upgrade -y’ with the error ‘E: dpkg was interrupted, you must manually run ‘sudo dpkg --configure -a’ to correct the problem.’ Running that command solved that problem. Later in this script I was asked for the password for user ‘pi’ so I entered it and then the script seemed to stop. I ran the script line by line and it seemed to complete. Main3 ran without issues.

I started with a fresh full install of raspbian buster. The ardupilot access point is visible from my phone. Are there any checks I can run to test that all is installed correctly?

Many thanks
Steve

Connect to the ardupilot access point and confirm:

  1. Website is up and running at http://10.0.1.128
  2. Confirm you can connect to the telemetry via UDP IP 10.0.1.128, port 14550

Thanks Stephen. I can view the website but I don’t have the drone at present in order to connect the raspberry pi to - I guess thats why I can’t successfully connect via UDP?

Once this is working correctly I want to be able to connect when the raspberry pi is connected to the internet via a 4G dongle. Are you able to give me any tips on how to achieve this? Will I need to write a server program to act as an intermediary between the pi and my laptop?

Correct

You will need a VPN or similar (such as Zerotier) to network your laptop and Pi together. You should then just be able to connect to the Pi’s IP address on the VPN, port 14550 to get telemetry.

Hi Stephen. I’m back with another question. I previously got apsync working along with my 4G dongle and zerotier. I now need to add a WiFi dongle into the mix so that the Pi can get access to wifi networks (while the onboard wifi is tied up as a WAP). I’ve found that in order to activate my wifi dongle I have to rename wpa_supplicant.conf-unused back to wpa_supplicant.conf. This enables the wifi dongle but also ruins the apsync WAP set up. Are you able to assist in how I might resolve this problem?
I think I somehow need to tell wlan1 to use wpa_supplicant.conf but tell wlan0 to ignore it.
Thanks
Steve

EDIT: I’ve solved this problem by renaming wpa_supplicant.conf to wpa_supplicant-wlan1.conf. Now the WiFi dongle works perfectly and the WAP is still available.

I’ve got my drone now and am trying to connect mission planner to the drone via my raspberry pi companion computer.
The drone has a Holybro Durandal flight controller. The Telem2 port is occupied so I’ve connected the Raspberry Pi up to port Telem3. Is this acceptable?
I connected my mission planner laptop directly to the flight controller and was able to set parameters SERIAL3_BAUD 921 and SERIAL3_PROTOCOL 2. I trust this is correct if I’m using Telem3?

I then SSH into my raspberry pi and run:
mavproxy.py --master=udpout:10.0.1.128:14550

This results in the following output and I’m unable to connect to the Pi from mission planner:
Connect udpout:10.0.1.128:14550 source_system=255
Log Directory:
Telemetry log: mav.tlog
Waiting for heartbeat from 10.0.1.128:14550
MAV> link 1 down

Any help would be appreciated.

EDIT: I now realise that Telem2 was being used to connect to a wireless telemetry module on the drone. I disconnected that and connected the Pi to Telem2. Now MAV produces output instead of saying link 1 down. But mission planner is still unable to connect when I’m connected to the Pi via apsync ardupilot wireless access point. I get an error saying ‘only one usage of each socket address is normally permitted’.
I can browse to http://10.0.1.128/ on my PC and see all of the flight controller parameters, so it seems like things may be OK on the raspberry Pi side. But Mission Planner won’t hook up with it on either my PC or Laptop.

Any chance of some help to get this last bit up and running please Stephen Dade?
I can SSH into the pi and run mavproxy and see the messages being printed in the console. The ardupilot wireless access point is there as produced by installing apsync via your scripts. But when I connect a machine to the ardupilot network and run Mission Planner, I can’t get any connection to the data feed.
Is there any command that I need to run or something?

Are you running MAVProxy and Mission Planner at the same time? Best I can think of is that only one can be connected at a time.

Yes I have been trying to run mavproxy on the raspberry pi and mission planner on my PC. I thought it was necessary to launch maxproxy in order to get the data feed. Or does the apsync installation take care of it all?
Thanks

Hi Stephen. I’ve tried connecting mission planner to the pi without running mavproxy and I still have the same issue that no connection is made. Running mavproxy results in a data feed to the console so I guess that means the pi is communicating fine with the flight controller?
What could be preventing the data being fed out to other machines on the ardupilot WAP or on the local network connection (I connected the pi to my router with ethernet cable to try it)?
Below is the error I get from Mission Planner as soon as I click OK on using port 14550.
I’d really greatly appreciate some help resolving this as I’m currently stuck with my project.
Thanks

image

I also tried this command while connected to the Pi with SSH and got this:

Correct. So it’s most likely a network issue.

You also need to enter the IP address of the Pi (10.0.1.128) via the “UDPCI” connection type in Mission Planner

I think that’s because another process/program is already accessing the serial port.

Thanks Stephen. That’s great. I’ve now been able to connect mission planner to the pi by specifying UDPCI instead of using the auto search feature.
However, I’m only able to access data when connected to the ardupilot WAP broadcast by the apsync setup. I’d like to be able to access the data without connecting to that WAP, i.e. by having the pi connected to another network such as when using zerotier. I’m trying it out first on my local network with the pi connected to my router via ethernet cable. But my PC can see the pi on 10.0.1.128 in that case.
Any suggestions what I need to do to make that work too?
Thanks so much. I’d be in a mess without your help.
Steve

The telemetry will be automatically output on all available network interfaces. All you need to do is specify the Pi’s IP address on Mission Planner.

That’s fantastic. I now have it working both on my home local network and via the ZeroTier cloud based network too. Thanks so much for your help. I may be back with any new problems in the near future.
I’m now itching to take the drone out for a flight remotely controlled by my Laptop/Mission Planner with comms over the 4G network.

Hi again Stephen. Do you know if its possible to output the telemetry stream on port Telem3? I’ve got it all working on Telem2 but ideally need 2 ports outputting the data. My FC is a Holybro Durandal.
I set SERIAL3_BAUD to 921 and SERIAL3_PROTOCOL to 2 but its not working.

That’s all correct.

Looking at the pin configuration for the Durandal (https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_HAL_ChibiOS/hwdef/Durandal/hwdef.dat#L159) it does appear that the TELEM3 TX is disabled. I don’t know why.

If you’re confident editing/building ArduPilot from source code, try uncommenting the # PG14 USART6_TX USART6 line and see if that fixes the issue.

Hi Stephen. I’m not confident with editing/building the source code but perhaps its time to learn. However, I bought the drone pre-built and installed with Ardupilot so I really would need to preserve all the settings. I’m not sure if that’s possible? I don’t want to screw anything up that may result in a fault or crash.
I emailed the drone supplier and they said Telem3 is the GPS port and I should ideally use Telem 4 or 5. I’ve tried 4 but still no data. I can’t see a line in the code link you sent to check whether the same thing is commented out on Telem 4.
Do you have any further suggestion? Thanks

THere may be some confusion between the parameters and TELEM ports:
SERIAL0 = USB Port
SERIAL1 = TELEM1
SERIAL2 = TELEM2
SERIAL3 = GPS1
SERIAL4 = GPS2
SERIAL5 = TELEM3

I haven’t got a Durandal to test where GPS2 is and the Durandal documentation does not appear to have a GPS2 port. You may need to just test each port to figure out where SERIAL4 is.

EDIT:
Telem4 looks is enabled in the source code. I think it’s mapped to SERIAL6

Servers by jDrones