Independent Serial Usage

I want to use an independent python file to grab data returned from the controller (wireless) over the serial from my print() calls. I know of the python serial module, but some simple code:

import serial
com = serial.serialwin32.Serial(“COM3”, 115200)
com.open()

won’t allow me to open the port (access denies). I didn’t try closing my VEX environment but I hope that I can do this without doing so, no try too hard as we need to work on our autons. Hoping if this is possible there’s an answer, and if not I won’t waste more time chasing it. My eventual goal is to see if I can get live data monitoring (graphical position displays, real time graphs, and data logging to files on the PC) wirelessly through the controller.

Using VEX vscode extension.

I can’t help with with regards to your serial port not opening (that could be any number of issues), but I will say you will probably run into further trouble if you want reliable live data off the controller:

  1. Unlike the Brain, the controller does not open a dedicated user port for you to read stdio off the brain in plaintext. Instead, there’s a dedicated packet on the controller’s system port that you need to exchange/decode using VEX’s (undocumented) CDC2 packet protocol. Here are three examples in various projects for encoding that packet: [1] [2] [3]
  2. Controller FIFO will be highly unreliable while the radio operates in the pit channel, as the bandwidth is pretty slow. To get reliable transfer, you will have to switch the controller/radio into their respective download channels, which requires another packet. The third example I linked demonstrates this. pros-cli also has a dedicated function in their source. Even on the download channel, you’ll probably run into possibly corrupted data due to bandwidth restrictions.
1 Like

Actually, might look more into that foxglove thing. It seems pretty simple and looks pretty powerful.