Howdy, I’m trying to get my SCC-32 to work on some of the new lab computers so I don’t have to haul my laptop around to work on my robotics projects. I was really surprised that the normal:
echo -ne “#0P1500\r” > /dev/ttS0 didn’t work.
My first thought was that the machine’s serial port was bad, or not set right. So I installed minicom (hyperterminal equivalent for Linux) and got the SCC-32 working just fine saying it was sending to /dev/ttS0. I was root so there was no permissions issues.
I’m absolutely stumped as to what might be the issue.
What’s worse is it means I can’t use shell scripts to run gaits.
What shell are you using? I don’t think most of the shells will process the “\r” escape sequence. Remember, UNIX/Linux requires LF (not CR as with Windows) as a line terminator, so this will be the default.
Minicom and other Open Source comm software will just pass your keyboard strokes straight though, so pressing works to terminate your line for the SSC-32. This is not necessarilly the case when using scripts. Use “\n” in shell scripts instead and it should work.
Thanks for the quick response. I should clarify that \r is the echo carriage return. The man echo pages even says so. You’re right it doesn’t process the by default, which is why I turned the -e option on. I tried with the \n (the default, non -n option sends a return) so I’m doubtful. I’ll try again with an extra \n. Also, this is bash on Debian, though my laptop is Sarge. It’s doubtful, but this might be an Etch issue. Let me repeat, the same command works on my other computer. That’s why I’m really puzzled.
EDIT: Just gave things a try. No luck. I tried \n, \r, with all permutations of -n and -e. The light stays on the whole time, it’s like echo isn’t even directing the output to the serial port. I guess I need to hook up the scope to see if it really is sending out pulses since the lcd can’t go at 115K.
You may actually have to use “\n\r” or “\r\n” to get things working from scripts. I am just starting to fiddle with stuff like this because I am hoping to be able to use Python scripts to control an SSC-32. A guy from Open Servo, who is very interested in my Walk 'N Roll project, is sending me another brand new SSC-32 completely free!
For serious scripting, I prefer Python. I have it installed for Windows also, with the parallel and serial I/O addon modules.
It was a combination of two things. The first was an Etch issue. The version of echo had a bug. Regular updates solved the problem. I also now have working C code which will output to the serial port and control the SCC-32, so its not an issue.