Controlling CC3D using Raspberry Pi 3
« on: July 29, 2017, 06:03:36 am »
Hello Everyone,

I realize that this question has been asked before but I'm having trouble making it work.
My intention is to build an autonomous quadcopter that I can control using python scripts. My intention is to use the Raspberry Pi 3 as an interface between my computer/smartphone and the CC3D or to run the scripts on the RPi3 directly.

  • Many posts I find on this forum utilize serial connection between the RPi3 and CC3D. I'm wondering if its possible to utilize a USB-microUSB port to send the control signals to the CC3D?
  • I thought it'd be a good start to receive telemetry signals from the CC3D. I am able to see those signals when using the LibrePilot GCS, but I'd like to access these values directly so it can be used within a Python script. To this, I attempted to follow the tutorial shown in this post: https://forum.librepilot.org/index.php?topic=749.msg11840#msg11840. I git cloned the librepilot source code, and tried to run the pyuavtalk.py example using port /dev/ttyAMA0 but it doesn't work. I suspect this is because that post is not using the USB connection.

I would really appreciate a little help on making this work.

Thank you very much,
Alan
« Last Edit: July 29, 2017, 12:49:21 pm by f5soh »

f5soh

  • *****
  • 3767
    • LibrePilot
Re: Controlling CC3D using Raspberry Pi 3
« Reply #1 on: July 29, 2017, 12:48:52 pm »
Quote
tried to run the pyuavtalk.py example using port /dev/ttyAMA0 but it doesn't work. I suspect this is because that post is not using the USB connection.

Answer is some posts after, in the same thread:
https://forum.librepilot.org/index.php?topic=749.msg12347#msg12347

In example.py file you will be able to find something driving a servo with ActuatorCommand, the same should be done for ManualControlCommand.

sallyc

  • *
  • 11
Re: Controlling CC3D using Raspberry Pi 3
« Reply #2 on: August 04, 2017, 07:38:47 pm »
I am doing the exactly the same thing, and I didn't have /dev/ttyACM0 port on my Pi 2. So still waiting forever.

Can you tell me if you have any progress? Thank you

f5soh

  • *****
  • 3767
    • LibrePilot
Re: Controlling CC3D using Raspberry Pi 3
« Reply #3 on: August 04, 2017, 11:12:22 pm »
Maybe use the right serial name, search using 'dmesg' for some /dev/ttyXXX added after you connect the device previously configured for telemetry over VCP.

Can be ttyACM0, ttyUSB0, ttyAMA0... depend the Linux system you are running.

sallyc

  • *
  • 11
Re: Controlling CC3D using Raspberry Pi 3
« Reply #4 on: August 05, 2017, 03:39:28 pm »
I think CC3D does not have VCP port, i can only see main port, flexi port, input and output port from my board. So i only configured my main port to telemetry and connect it to pi. Does this work?

Thank you

f5soh

  • *****
  • 3767
    • LibrePilot
Re: Controlling CC3D using Raspberry Pi 3
« Reply #5 on: August 05, 2017, 07:48:11 pm »
VCP mean Virtual Com Port, this provides a serial port over USB connection. (If VCP is configured with Telemetry)
Talking with UavTalk telemetry using Flexi or Main port will work the same.

sallyc

  • *
  • 11
Re: Controlling CC3D using Raspberry Pi 3
« Reply #6 on: August 07, 2017, 07:18:20 pm »
Yes, got it work. Thank you ;)

sallyc

  • *
  • 11
Re: Controlling CC3D using Raspberry Pi 3
« Reply #7 on: August 11, 2017, 09:03:54 pm »
And another question,  in this example code, I can receive the object data. can I somehow set the object data and send back to CC3D?

f5soh

  • *****
  • 3767
    • LibrePilot
Re: Controlling CC3D using Raspberry Pi 3
« Reply #8 on: August 12, 2017, 12:21:40 am »
Quote
In example.py file you will be able to find something driving a servo with ActuatorCommand, the same should be done for ManualControlCommand.

The answer is in first reply ^^