Try adding a sleep 1; statement between the commands.
Frequently embedded systems don't have buffers on the serial lines. (In fact, many microcontrollers don't have UARTs in them, and simulate the UART in software.) In many cases like this, the command software simply waits for a command, and once it gets one, it runs off and performs it. When the command is complete, it starts waiting for the next command. So when you send it a command, there'll be a delay before it will start looking for the next command, and anything sent before this will just "fall on the floor".
You're sending 8 bytes, which takes roughly 8*(8+2)/9600 seconds (8.3ms) to send to the controller. Since the serial port in your computer probably *is* buffered, you're probably queueing up the second command before the first one has been fully transmitted! (Unless, of course, you're using a computer with no outbound serial buffer, or a horrendously low clock speed.)
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: Disabling buffering of serial port?
by roboticus
in thread Disabling buffering of serial port?
by JimLS
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |