Hi, when i connect the 12 channel maestro to windows and use maestro control center i am able to move the servo.
however, when it is plugged into my debian linux, i try to write the example bytes 0x84, 0x00, 0x70, 0x2E (using php) to set the servo to 1500 uS, the maestro does not respond (though the green solid light starts flashing).
here are the things that i have done:
set serial setting to dual port (using maestro control center), used the PHP serial communication script by remy sanchez.
in php, ive set the byte length to 7 bits. i write bytes into /dev/ttyACM1 by writing chr(byte value). (im sure using chr(byte value) works as i’ve done this with another project.)
this is my script. please tell me what i am doing wrong:
<?php
require("php_serial.class.php");
$serial = new phpSerial();
$serial->deviceSet("/dev/ttyACM1");
$serial->confBaudRate(9600); //Baud rate setting, although apparently not needed
$serial->confParity("none");//partiy, needed?
$serial->confCharacterLength(7); //byte length to 7 bits
$serial->confStopBits(1);//stop bits, needed?
$serial->deviceOpen();
$serial->sendMessage(chr(0x84));
$serial->sendMessage(chr(0x00)); //bytes sent one bye one
$serial->sendMessage(chr(0x70));
$serial->sendMessage(chr(0x2e));
$serial->deviceClose();
?>
Thanks for this code! I got it working for the 24 Channel Maestro, can send instructions but not receive responses. When I “readport” from the connection, after sending the get_position (compact protocol) command, I do get 2 bytes back as expected, but they are both 0. It should be the position of the servo (which is definitely not 0). Here is the code:
Ah, I found out the problem. The speed of the servo needs to be set to equal to or lower than the physical limitation of the servo.
Here are some working functions that work with the code above that use the Compact Serial Protocol that is documeted in the in Pololu Maestro user guide.