Rapsberry Pi to VEX Bidirectional Communication

Hello, I first want to point out that this VEX is for a college Senior Design Project and not at all intended for any competition. We are using the robot as a body for our design needs. I just need some answers for a problem I am having because I lack a massive amount of knowledge on robotics and VEX in general. The premise is as shown below.
We need a Raspberry Pi to give directional command to the VEX Brain and then the VEX Brain to give accurate data of how it moved back to the Raspberry PI. I have no idea how the ports or software work, but I have a decent grasp of Python and basic C++. If given a direction I can work to understand and fulfill my requirements, but any assistance would be greatly appreciated.

Thank you.

1 Like

If you connect the V5 brain to the Pi with a USB cable, you can open a serial connection between them. On the V5 brain you’ll be able to read from and write to that connection using the standard input and standard output.

5 Likes

There is this public doc that I co-authored that can help you with communication using the vex smart ports. http://jftanne.people.clemson.edu/ce.pdf

If making a board doesn’t work for you then there are rs485 breakouts that can be purchased online.

Using the smart ports is better because you can still debug with the usb interface. USB is easier since a raspberry pi can be a usb host but the serial ports is better.

5 Likes

This is what I am looking for, but is there more detail on connecting them and then programming them to perform this way? Are there tutorials on the subject where I can see the process step by step in terms of initially connecting them?

No tutorials that I know of, most customers needing this type of advanced functionality have some familiarity with using stdio for reading and writing already.

There is some code that may help on the V5 side here (look for the V5 demo project, ignore the VEXlink documentation), but it’s way more complicated than you need.

https://kb.vex.com/hc/en-us/articles/360049619171-Coding-the-VEX-AI-Robot-VEX-AI

On the RasPi side, google for opening a serial port and reading and writing to it.

6 Likes

For the PI, I think using the USB port is the better approach. You’ll be able to use pretty standard components, you’ll be able to communicate with the underlying system in addition to the user program (let’s you modify VFS, control program execution, and more).

3 Likes

We chatted with them over in the Vex discord for a while an hour ago. They are trying stuff out and will follow up with specific questions now that they have direction.

USB obviously, given they already have a Raspi

8 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.