[squeak-dev] Question about serial port communication

Jon Hylands jon at huv.com
Tue Jun 23 12:55:14 UTC 2009


On Tue, 23 Jun 2009 11:06:29 +0200, Víctor C. T. <victorct83 at gmail.com>
wrote:

> Sorry but this code didn't work for me, cause I'm on a Mac and it can't get port numbers, only names.

Actually, given that you're running a form of Unix, you can probably do a
soft link to the actual port in the form that Squeak is expecting. I've
done that with the gumstix (which runs Linux).

So, to make a link for ttyUSB0 so you can reference it as port 4, do this:

ln -s /dev/ttyUSB0 /dev/ttyS4

Then you can pass in 4 as the port number, and it should work.

> Then that's not the problem... I guess that the way I'm sending bytecodes it's not correct, because there's no response from board.

It may end up being an endian problem - Macs and PCs are opposite. I can't
imagine that this would manifest with a ByteArray, but its probably worth a
try just to rule it out.

Try sending a ByteArray with the bytes reversed... The other thing to try
is to send the bytes individually, with a slight (say 1 ms) delay in
between each byte.

Later,
Jon

--------------------------------------------------------------
   Jon Hylands      Jon at huv.com      http://www.huv.com/jon

  Project: Micro Raptor (Small Biped Velociraptor Robot)
           http://www.huv.com/blog



More information about the Squeak-dev mailing list