Can't use the example cross platfor code in my micro maestro

Hello guys, i’ve been trying using the code( pololu.com/docs/0J40/5.h.1) with my 6 channel micro maestro, but i can’t make it work.
I’m using the const char * device = “/dev/ttyACM0”; because in the website they say "The Maestro’s two virtual serial ports can be used in Linux without any special driver installation. The virtual serial ports are managed by the cdc-acm kernel module, whose source code you can find in your kernel’s source code drivers/usb/class/cdc-acm.c. When you connect the Maestro to the PC, the two virtual serial ports should appear as devices with names like /dev/ttyACM0 and /dev/ttyACM1 (the number depends on how many other ACM devices you have plugged in). The port with the lower number should be the Command Port, while the port with the higher number should be the TTL Serial Port. You can use any terminal program (such as kermit) to send and receive bytes on those ports."

When it gets to the end of the struct it stops running and nothing else happens. I can move the servo with an arduino but i want to use the micro maestro by itself. Can anyone help ?

Hello.

What Linux system are you using? Can you verify ttyACM0 is the correct port by checking that the port disappears when the Maestro is disconnected and reappears when it is connected? Also, how did you know that the program was unresponsive after declaring struct termios?

- Amanda

Hello.
I’m using Ubuntu 14.04 LTS 64 bits.
I mentioned in my last post this “The Maestro’s two virtual serial ports can be used in Linux without any special driver installation. The virtual serial ports are managed by the cdc-acm kernel module, whose source code you can find in your kernel’s source code drivers/usb/class/cdc-acm.c. When you connect the Maestro to the PC, the two virtual serial ports should appear as devices with names like /dev/ttyACM0 and /dev/ttyACM1 (the number depends on how many other ACM devices you have plugged in). The port with the lower number should be the Command Port, while the port with the higher number should be the TTL Serial Port. You can use any terminal program (such as kermit) to send and receive bytes on those ports.” And this happens with me so, in the code, i choose /dev/ttyACM0 since is the lower number port.

In the image you can see why i’m saying that the program is unresponsive after declaring struct termios.


From your debugging messages, it looks like you modified the original program to find where the code stops. Did you make any other modifications to the code besides the changing the Maestro’s virtual COM port and adding the debugging messages? It would be best if you can attach your try.c file. Also, we noticed that the fourth time you attempt to run your program the output is different from the previous outputs. Did you change anything in your setup before running your program for the fourth time (e.g. disconnecting and reconnecting the Maestro to your computer)?

Can you try running “dmesg|tail -n 15” in the terminal after disconnecting and reconnecting your Maestro to your computer and post the results here?

What serial mode did you set your Maestro to? By default, the Maestro’s serial mode is set to “UART, detect baud rate”, so the Maestro will not listen to commands from the USB virtual COM port. To control the Maestro through its USB, the serial mode setting should be “USB Dual Port” or “USB Chained”. You can use the Maestro Control Center to verify or change that setting on the Maestro. If you have not already set it up, you can download the Control Center for Linux from the “Installing Linux Drivers and Software” section of the Maestro User’s Guide.

- Amanda

Thank you Amanda! I’ve manage to solve my problem by changing the USB mode on your program. So many hours spent and such a simple problem. Again, thank you so much. Have a nice day.