MSP as receiver input protocol?
« on: June 25, 2017, 04:48:21 pm »
Is it possible to use the MSP protocol over the Flexi Port as input for a kind of receiver(my Raspberry Pi)???
I tried to use PPM or PWM but i always had timing problems so I want to use MSP now but I don't now if I have to flash a new firmware or if I can use the MSP option at the Flexi Port for the command input???
And if it works that I can use the MSP over Flexi Port how does the the CC3D or rather LibrePilot expect the input?
I have 4 integers which are between 0 - 255 and stand for yaw, throttle, roll, pitch.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: MSP as receiver input protocol?
« Reply #1 on: June 25, 2017, 05:03:38 pm »
Current MSP settings for Main/flexi port are only for output, not input.

If you have timing issues you can use as well other "serial" inputs like sbus, dsm, exbus and others.
Go to the Input tab and look at the "Type" list for supported inputs.

Re: MSP as receiver input protocol?
« Reply #2 on: June 25, 2017, 05:13:08 pm »
That means I can use DMS, EX.Bus and IBus as input at the Flexi Port but MSP is just for output?!

Brian

  • *
  • 119
Re: MSP as receiver input protocol?
« Reply #3 on: June 25, 2017, 05:14:25 pm »
MSP is currently just output.  SRXL is a pretty simple protocol that you should be able to send fairly easily.

Re: MSP as receiver input protocol?
« Reply #4 on: June 25, 2017, 05:51:22 pm »
So how i already said I have 4 integers which are between 0 - 255 and stand for yaw, throttle, roll, pitch. They are all a variable in my self programmed python script. Which protocol would be the best to give these parameters from the pi over the GPIO Pins to the CC3D. On the Pi is a real operating system so I have sometimes some timing problems. Because of this things like PWM or PPM doesn't really work for me.

Sorry for my bad english.

Re: MSP as receiver input protocol?
« Reply #5 on: June 25, 2017, 06:55:39 pm »
If you are trying to bit bang GPIO, you probably should run that thread at real time priority.  Oh, a Python script.  Maybe use C or C++?

Better yet, find an OS driver module that can do PPM correctly if such exists...

Brian

  • *
  • 119
Re: MSP as receiver input protocol?
« Reply #6 on: June 25, 2017, 07:23:03 pm »
SRXL is a serial protocol, similar to MSP, so you would communicate using a UART.


f5soh

  • *****
  • 4572
    • LibrePilot
Re: MSP as receiver input protocol?
« Reply #7 on: June 25, 2017, 07:37:39 pm »
Another alternative is use the Python scripts from here:
https://bitbucket.org/librepilot/librepilot/src/ea41e40a4a0cd5447828737c2953bde938453f0e/python/examples/?at=next

Take a look how to setup: https://forum.librepilot.org/index.php?topic=3173.0

You will need to control the ManualControlCommand uavo

Re: MSP as receiver input protocol?
« Reply #8 on: June 26, 2017, 08:24:59 pm »
@TheOtherCliff I think when I raise the nice level of my process I also can handle this with python but I know for thinks like this C or C++ is always a better choice. I'm not that familiar with C++ and C I just know some basic stuff.

@Brian when I use the GPIO from my pi I already have my UART so my biggest problem is I really don't know how the FC expect the data when I try PWM again with a higher nice level of the process I think I could handle the timing problems but I can't send integers like my 4 0-255 integers over PWM so how does the FC except the data???

@f5soh The link you send is to receive data, isn't it? Because when I look at the python code and how to setup it is always about receiving data or I am wrong?

f5soh

  • *****
  • 4572
    • LibrePilot
Re: MSP as receiver input protocol?
« Reply #9 on: June 26, 2017, 08:28:40 pm »
You can find a example driving a servo (so a output command from python), the same can be done for ManualControlCommand.