Companion: Pi 2/3/Zero

A discussion page to allow me to add my experiences using a Raspberry Pi 2/3/Zero V1.2/1.3 as a companion computer for Ardupilot/APM/Pixhawk flight boards. I will update my experiences as I learn, feel free to comment and offer tips, it's all free here.

3691291461?profile=original

3691291190?profile=original

I'm building a github for my experiments: https://github.com/benb0jangles/Companion-Pi

Drone Unit: Raspberry Pi Zero V1.3 + Pi Camera Module
img file: https://drive.google.com/open?id=0B1cVb3uX0f0dQTZzSmVISFdYd3M

Ground Unit: Raspberry Pi 2

img file: <to be added>

Goggles Unit: Raspberry Pi Zero V1.3

img file: https://drive.google.com/open?id=0B1cVb3uX0f0dakFpaTAyVF9HV2s

Ardupilot Technical Questions:

Also, if you have any technical code/hardware questions which you feel may take ongoing contributions and help over an extended timeframe, feel free to ask over on Ardupilot.org technical discussion page herehttp://discuss.ardupilot.org/t/companion-pi-2-3-zero/9460

I will update as I get by, please contribute by offering your 'plug & play' wifi adapters using Raspbian Jessie. Also, if you happen to pick up this project, and are working faster than me, then please send us your own .img file experiments. Thanks.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

    • Well, it works on my zero, thank you. Connected my 8Mb Raspberry camera, had a few problems getting it to work. Input 'sudo chmod a+rw /dev/vchiq' it worked then stopped, but after sudo apt-get update & upgrade everything fired on all cylinders.

      I then decided to push the resolution and bit rate to see what happened. Awus051nh v2 usb stick attached to zero via usb hub with signal sent via Nano M5 and wirelessly 5Ghz to an oldish laptop.

      Ignoring lag and breakup of picture. I had the resolution set at 1920x1080 30fps, and increased the bitrate gradually to 20Mbps. I had the Ubiquiti screen display up on my main computer on the main tab where I could see the graph of the RX & TX bitrate. It maxed out at about 13.3Mbps. The zero did get a bit warm. On the camera front I was quite impressed with the white balance. I had a Logitech c920 connected last night on my Pi 2 and it maxed out at about 3.3-3.5Mbps. I take it that the lag and break up of image is more down to my oldish laptop than signal transfer.

      I don't know much about Mavproxy. My next step is to wire my zero to a flight controller and see if I can get telemetry to work.

    • sudo chmod u+s /dev/vchiq

      this works if you need to make the permission permanent (not have to do sudo chmod a+rw /dev/vchiq every time)

    • Hi, adding pi user to video group is a better solution than using setuid on a root file.

      sudo usermod -a -G video pi

    • great to hear you figured out your plan. please tell how you solved your puzzle. was it code/permissions/wiring?

    • It was a mixture of problems.

      1. Raspberry Pi  - solved by changing 'enable_uart=0' to '1' in /boot/config.txt.

      2. APM - In the full parameters list only Serial3_baud displayed, had it set to 57. There was no Serial Protocol, or Serial0/1_baud fields. I did most of my testing on the APM, so it was never going to work.

      3. Pixracer - I still cannot get this to work.

      4. Pixhawk clone - this is what I used early on before identifying problem with the Rasberry configuration. As soon as I connected (after realizing the problem with the APM) it last night it worked. If I had of stayed with this early on a lot of time would have been saved, though a fair bit of time was spent identifying the problem with the Raspberry.

      Thanks for everyones help on this problem.

    • Do you think I need to change anything regarding Raspbian Lite .img? thanks

    • The only adjustments I made to Jessie Lite were 'enable_uart=0' to '1' in /boot/config.txt' to get the ttyAMA0 files back in /dev and 'sudo chmod a+rw /dev/vchiq' to get the Pi camera to work

    • break up seems to be due to UDP protocol, I get slightly bett results on the pi2 than the pi zero. Hope at the end of this long road there will be wifibroadcast or UDT implemented too as they seem to prevent bottlenecking/breakup/reconnection issues.

    • Thanks for the chmod statement.

      I also streamed to my main computer which is a lot more powerful that my laptop. It streamed very well. I haven't range tested yet but it does look as if the pixel breakup is down to the laptop not being powerful enough to process the signal quickly enough

    • Wired the Zero up to a Pixracer via telemetry port.

      After 'sudo -s' and 'mavproxy.py --master=/dev/ttyAMA0 --baudrate 57600 --aircraft MyCopter' I'm getting the error message -

      Connect /dev/ttyAMA0 source_system=255
      Failed to connect to /dev/ttyAMA0 : [Errno 2] could not open port /dev/ttyAMA0: [Errno 2] No such file or directory: '/dev/ttyAMA0'

      Also connected a Pi2 and got the same error message. It's probably something straightforward but at the moment I can't figure it out.

This reply was deleted.