I’ve got a Micro Maestro USB 6 channel Servo controller.
I’ve spent some time porting a Processing Application that controlls Servos from Arduino to Micro Maestro which works fine so far.
One thing that I’m lacking is the ability to actuall identify the Micro Maestro. If I had other Serial devices attached I wouldn’t know if I chose the right COM-Port until I actually tried moving the servos.
Is there a way (maybe via scripts) to have the Micro Maestro send some sort of ID over the Serial Port that I can check for ?
Whenever you plug your Maestro into a given computer, Windows will assign it to the same COM ports. So one solution would be to change the Maestro’s Command Port to, say, COM8 and just rely on it always being on COM8. You could hardcode COM8 into your program and just open COM8 without looking at any of the other ports. The reason this works is because the Maestros have serial numbers built into them, so a given Maestro will always be assigned to the same COM ports no matter where you plug it in to the computer.
I think that will be the easiest way for you, but if you wanted a more general way to identify Maestro COM ports then there are ways to do it using SetupAPI.
Your idea of having the Maestro send an ID to you would also work. The Maestro has several serial commands that result in a serial response (e.g. Get Position) and you could try sending one of those commands. That would allow you to make sure you are talking to a Maestro but it might not be so useful if you have multiple Maestros connected to the computer.
Thank you for your response.
I thinkn your idea with just seeing what Get Postion returns is a good one.
I tried to implement it but it seems that the response is always the same no matter if I choose the correct or a wrong Port.
Here’s my Code:
maestroPort = new Serial(this, Serial.list()[dropdown_comPort.selectedIndex()], 115200);
This will always print 0. I’m usually using MiniSSC Protocoll but since this command appearantly is only availbe in Pololu and Compact i wen’t with this one. The Guide also states that one can jump between protocolls as needed so this should work right ?
Okay, I found a way. It seems that only the correct port will trigger a serialEvent() when Get Position is called. So basically writing a method serialEvent() and setting a variable inside that Method to true will tell me if I successfully connected or not.
Thx again !