ASCII format equivalent of reboot, save_configuration, erase_configuration

Hello Folks,
I am writing O-Drive communication library in C++ using ASCII interface over USB.
I am writing command to save, erase the configuration and reboot also.

But below commands didn’t work:
w reboot()
w erase_configuration()
w save_configuration()

Is there some equivalent command for these operations in ASCII protocol.

Saurabh

Try this
sr
se
ss

I usually use the source directly as documentation

Thanks Alex, it skipped from my mind. But what I can observe from here is that se is working and erasing the configuration, but sr is not working.
Have you used it to reset the controller.

surabhbansal, glad to see you are starting this c++ project.

Any chance you have tested the write commands for velocity recently? I am still getting a serial disconnect while doing this after a couple minutes.

wayneStock

Hello Wayne,
Its a pleasure for me too to see someone working on c++.

I guess you must be trying the commands (p and q), with setting the velocity limits. But I have not tried that.

I am controlling the O-Drive with commands like axis0.controller.config.vel_limit, and with this my serial was not reset.

I am testing this c++ code with my laptop, with USB, and ASCII protocol.
I am not facing any issue while writing, but at the time of reading, sometime it is not able to receive the data.

Can you please tell me how you are using the ASCII protocol, with microcontroller or with some PC?
And if PC, what kind of library you use for serial communication over USB.

Not yet. In practice, erasing and rewriting a permanent configuration may happen from time to time (I basically do this from arduino code so that I do not have to maintain a separate python configuration script and corresponding odrive PC environment).
However, the reboot is something I do by controlling real power coming to the odrive board anyway.

If the reboot is visible from the odrive power LED, then I should be able to confirm whether or not ‘sr’ actually work.

Will report later.

For the record, I remember someone mentioning on the forum here to be writing a c++ client. About a year ago. I remember reading some code about this on GitHub. But I can’t remember if it was for ascii protocol or native protocol.

I am actually trying to use the v command, controlling my system using velocity.

I am using my laptop as well connected directly to the odrive communicating with the ASCII protocol as well. I am using Qt as my IDE which has build in serial libraries (QSerial, QSerialPort, etc).

wayneStock

I tried the 3 ascii commands with my setup. using fw 0.4.0
Save config: ss => works
Erase config: se => works too
Reboot: sr => does not work (nothing happens basically)

@madcowswe looks like a bug to me.

Yes I see, the docs say sr, but the command is implemented as sb. So try sb, and we will fix it to be sr in the next release.

1 Like

Now that you mention it, I feel like an idiot.

Personally, I would rather fix my own code to use ‘sb’ and get reboot functionality now with fw 0.4.0 now and never update my code later on + as a bonus having documentation fixed in 0.4.1

@saurabhbansal90

I stumbled upon the post I was thinking about the other day here => Native USB C++ interface

It seems to be native protocol instead of ascii though.

Hello Alex,

Thanks for sharing it. But I have done some implementation for ASCII protocol, and right now going ahead with that only.
I have 1 more question, the equivalent command for getting Serial Number in ASCII protocol.
As r serial_number is not working.

Sorry for a very late answer. You probably must have found it by now.

I personally use ‘i\n’
It will return 3 strings

  1. hardware version (with voltage variant)
  2. firmware version
  3. serial number

This command works just fine. I personally use it as a sanity check to make sure the board returns a version I consider valid for my know code

  • bonus: when the board answers it means it’s ready to accept commands
    Odrive will not answer while not powered of course + no answer while the board either boots or is still busy executing a previous encoder search => this is what typically happens when you trigger such a command from arduino, then immediately reset the arduino

Pretty handy that ‘i’ command

Hello,
i would be very interested in your library as I want to use C++ with ASCII aswell. Did you uploaded it anywhere by any chance or could you give me a hint how to start to write one myself?
Thank you very much!