Control Myxa with UART

Hi,
I’m trying to control the Myxa with an Arduino over serial. Is there a document somewhere that explains how to format the serial packets and what parameters can be read/written? I couldn’t find what I needed in the knowledge base.

Currently, the best we can offer is this:

but we are working on supporting UAVCAN v1 in Myxa, which will be available not only as UAVCAN/CAN but also as UAVCAN/serial via UART and USB.

Hi Pavel,
I was able to control the motor and get telemetry over UART by copying the parsers in messages.py in Kucher. However, I can’t find the part where we find part at the very beginning when you get the hardware/firmware version after connecting. Can you point me to the right location to find the correct packet structure?

1 Like

It’s here:

Is there a table somewhere to look up the “frame type code”?

For standard messages there is only one frame type code:

https://github.com/Zubax/popcop/blob/f45deea2486fa1d5f18d575c7eba7197bbd22e32/python/popcop/_\_init__.py#L33

For application-specific:

Thanks, I got it working.

If anyone else needs to control Myxa with an Arduino over UART, I uploaded my code here:

My MCU was the Teensy4.0.

Hi Mah, would you kindly be able to share your python script to control and monitor myxa?

sorry, I never made a python script. the code in the git repo linked is all I have.

Hi, mah

Do you use UART using a pin of dronecode probe?
I am using dronecode probe’s 2(Rx) and 3(Tx). problem is your code could not parse the messsage through the pin but I think the message from USB connection is no problem…

AM I something wrong?

Check the serial port settings, they should be 115200 8N1.

Thanks, Pavel

My board is not teensy 4.0 used by man but it is lolin nodemcu v3 esp8266.

I think I should change something to work in my board, but I don’t know what exactly what I do. I am not professional.

Could you let me know what and how to change?

Thanks,

I can’t help with “how” but the “what” is to set the baud rate to 115200, 8 bit word, no parity, one stop bit.

Thanks, I order teensy 4.0.

Hi Denny,
I don’t use the dronecode probe, the debug port is connected directly to the microcontroller. Make sure the settings are like Pavel said and that Rx<->Tx for both lines. Also, when you make an instance of the object you need to indicate the serial ports you want to use. In the example code I was using Serial3 and Serial5 for command/logging, so you need to edit this to make it correspond with the serial port on your device.
For the NodeMCU V3, I think you cna try using Serial0 (GPIO1/3) and Serial2 (GPIO13/15).

Hi mah,

Thanks for your reply.

NodeMCU V3 doesn’t have 2 hardware serial(googling, somebody said it does not have 2 serial). So, I changed to ESP32 NodeMCU.

Before I posted here, I could check serial monitor something broken.

So, I have checked the setting and find some weird. why is the result in serial monitor different?

Firmware : 0.4

Below code is just modified.

MyxaESC myxa(&Serial2, 115200, &Serial, 115200,MYXA_STATUS_CMD_HOLDUP_MS,MYXA_RUN_TASK_HOLDUP_MS);
  1. NodeMCU + Myxa(microUSB connect)

  2. NodeMCU + Myxa(DC-Power/14v)

  3. NodeMCU + Myxa(DC-Power/14v) + BLDC motor(not running) :

is there way to downgrad the firmware from 4.0 to 3.0??

Yes. Older firmware revisions are still available upon mere request, but we no longer distribute them publicly. Your request is unusual, however, because normally, there should be no reason to downgrade. Could you please clarify what you are trying to achieve? If you require any older firmware version, please either PM me or send a message to support@zubax.com.

Can you post some photos of your setup?

For firmware 4.0, something changed.
I check the byte order comparing to kajuwise’s code.

byte controlModeBytes[4] = {myxaUnescapedMsg[97], myxaUnescapedMsg[98], myxaUnescapedMsg[99], myxaUnescapedMsg[100]};

above line should be chaged like this.

byte controlModeBytes[4] = {myxaUnescapedMsg[101], myxaUnescapedMsg[102], myxaUnescapedMsg[103], myxaUnescapedMsg[104]};

mah : your code is difficult to me. So I couldn’t modify. However, very thannks!!!