[squeak-dev] SerialPort on Raspberry Pi

Jon Hylands jon at huv.com
Mon Jan 18 12:50:46 UTC 2016


You don't need a device to test it - Serial doesn't require a second device
if all you're doing is sending bytes.

The issue I'm having is when I try and open the port - that part is failing.

Tim, not sure if you have Scratch set up to access the underlying Squeak
code, but if you do:

| serialPort |
serialPort := SerialPort new.
serialPort baudrate: 115200.
serialPort openPort: '/dev/ttyAMA0'.
serialPort inspect

the port instance variable in serialPort will be nil if it failed, and
something else if it didn't fail.

Thanks,
Jon


On Sun, Jan 17, 2016 at 6:38 PM, tim Rowledge <tim at rowledge.org> wrote:

>
> > On 14-01-2016, at 5:51 AM, Jon Hylands <jon at huv.com> wrote:
> >
> >
> > Hi everyone,
> >
> > I'm trying to use the SerialPort class on my Raspberry pi 2, to access
> the UART on the pi.
> >
> > I've successfully accessed the port from python, using pyserial. On the
> pi, the port name is '/dev/ttyAMA0’.
>
> The only thing I can offer is that Scratch finds a serial port as
> /dev/ttyAMA0 as well, implying that on at least one Pi it finds the same
> port that python does. I don’t think I have any devices that I could even
> try to connect to. Any suggestions for things that might be around the
> office?
>
> I do faintly recall some discussions about Pi serial stuff and having to
> use the rasp-config utility but that was a long time ago and I don’t seem
> to have any emails referring to it.
>
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Strange OpCodes: EOS: Erase Operating System
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20160118/f331db02/attachment.htm


More information about the Squeak-dev mailing list