Serial Script Command Issue

All,

I’m have 2 issues with the accessing sub routines via USB serial for my micro Maestro. Maybe there is a better way to do this…

1. I’m not sure if i’ve coded this right but basically all I want to do is send a serial command via USB to enter a sub routine in the script uploaded to the controller (see code). I only have 2 sub routines and I don’t think I need a continuously looped program as I only want to enter that subroutine when the proper serial command is sent.

# Sequence 0
begin
  
repeat

sub index_bin1 
  6003 0 servo
  10 delay
  7800 1 servo
  100 delay
  9984 1 servo
  quit

sub index_bin2
  5800 0 servo
  10 delay
  7800 1 servo
  100 delay
  9984 1 servo
  quit

2. Serial commands sent to the controller don’t respond. Now this could be caused by bad code (above) but just wanted to add this issue just in case I’m doing something else wrong. My micro Maestro settings are as follows: “USB Dual port”, device # is 12. I’m sending the following serial command “0xA7,0x00” which should technically enter into the first subroutine (Compact protocol: 0xA7, subroutine number) but nothing happens…

Serial settings are as follows: Baud 9600, Data bits:8, Stop bits:1, Parity:none

Any suggestions on how to get this to work would be much appreciated.

Thanks,

-Jp-

Hello, Jp.

What COM port are you connecting to and how did you choose it? What kind of software are you using to send those two bytes to the Maestro?

–David

David,

I’ve tried both the TTL and the Command ports with not luck. I am using Roborealm’s Serial module (roborealm.com/help/Serial.php). One thing to note is that when I run the script code above in the maestro control center the red arrow just sits on the “repeat” line and doesn’t move…
Also should my serial command be “0xA7,01” or “0xA7,0x01”?


Hello. The way you represent the command in your source code doesn’t matter as long as the values of the two bytes are correct. I see you selected “Ascii” in the Roborealm serial module. That is almost certainly wrong, because the Maestro does not support any type of character encoding like ASCII. You should probably try “Hexadecimal” or “Binary”. Please see my recent post where I explained this topic to someone else:

–David

David,

I mean’t to have it set to Hex but even when I tried that it didn’t work. Below are the following settings…can you think of any other reason why i’m unable to communicate? I can’t even get any of the basic servo move commands to work either (ex 0x84, 0x00, 0x70, 0x2E from the PDF document) by sending serial commands. Is there another serial communication program or something to make to determine the if communication breakdown is either RoboRealm or the MicroMestro?

Micro Maestro is powered by USB cable hooked to PC
There is (a separate) 5V power supplied to the servos
Script is same code as above (set to run on start up)
Maestro Settings: Set to “USB Dual Port”

In RoboRealm serial module settings:
Port is set to the “Command port” for maestro
Baud 9600, Parity = None, Data Bits = 8, Stop Bits =1
Console is set to Hexadecimal
Command is 0xA7,0x00

I can see the green light blink when RoboRealm sends the serial command but there is no response from the maestro servo module??

Thanks again,

-Jp-

Your settings look fine but you said nothing about the COM port. Again, what COM port are you connecting to and how did you choose it?

I recommend using the Pololu Serial Transmitter to make sure the Maestro is working:
pololu.com/docs/0J23

–David

David,

Thanks for all of your help! The serial Transmitter program helped me determine that the issue was the command separator within RoboRealm. Instead of 0x2A,0x00 i needed to use x2A\x00. If I would only read and pay more attention to
the documentation I could avoid these silly little headaches … Thanks again for your help!

-Jp-