Sending Data Over UART1 or UART 2: Stuck on URI

Post here to get support
Post Reply
Posts: 2
Joined: Tue Aug 13, 2019 9:28 pm

Sending Data Over UART1 or UART 2: Stuck on URI

Post by gregwilburn »

Hello All,

I am trying to communicate between my Crazyflie and a Raspberry Pi Zero W over UART. I have an attached Flow deck which, to my understanding, uses I2C and SPI. The USB is not an option because it's being used by another component on my Pi. What I'm stuck on is opening a connection between the Pi and drone over UART, specifically how to set the URI. I know I need to use the serial://InterfaceID/InterfaceChannel/Speed format, but I'm new to this and don't quite know what to specify for InterfaceId or InterfaceChannel when using UART. Speed should be the baud rate, either 9600 for UART1 or 115200 for UART2, if I understand it correctly. Anyone able to help me with this URI issue?

Posts: 3
Joined: Thu Oct 10, 2019 1:04 pm

Re: Sending Data Over UART1 or UART 2: Stuck on URI

Post by BlackOakTree »

do you want to use the UART connection to send CRTP packets?
If this is the case, this functionallity is not included in the firmware natively. I actually did this but still experimenting with it. Unfortunately my code is not accessible at the moment, but I plan to make ist accessible in Winter.
My Pi is connectet to UART2 at 1000000 baud as the syslink UART and also using the syslink protocol.
What I did is adding the functionallity to receive syslink packets via uart2 (as a state machine in uart2.c), in syslink.c I added a task for receiving and for sending I redirected the radio packets in syslinkSendPacket (syslink.c).
Then you probably want the library running on the Pi?
I use the cf-lib-python and extended the by a proper connect method using serial://pi as uri, but you could use whatever uri you want, as well as send and receive methods together with respecting threads performing the actions.
I do not know if it is the easiest and it is probably not the nicest solution, but I got it to work, so feel free to ask further questions or I can also inform you, when my code is accessible.
Kind regards
Post Reply