[Newbies] Serial port write freezes the VM
mactro at gmail.com
Tue Sep 10 06:39:10 UTC 2013
Well, at first I tried using larger numbers, but it seems, that my VM
has maximum priority equal to 8. Processor userBackgroundPriority
prints 3 and Processor userInterruptPriority prints 5.
2013/9/10 Levente Uzonyi <leves at elte.hu>:
> On Mon, 9 Sep 2013, mactro wrote:
>> I'm developing a mod for Scratch that will allow controlling an
>> robot via Bluetooth. I'm using SerialPort2 class that is included in
>> plugin and allows opening ports by name. Everything works fine BUT, when I
>> send commands in a loop, and the connection is lost (i.e. the robot was
>> powered off), the VM freezes. I tried forking the port nextPutAll like
>> timer := Delay forMilliseconds: 1000.
>> port := SerialPort2 new.
>> port openPortNamed:'COM14' baud:57600.
>> process := [port nextPutAll:'test'. Transcript show:'port'.] forkAt: 1.
>> [timer wait. Transcript show:'delay'. process terminate.] forkAt: 7.
>> but with no result. Is there any way to write to a serial port with
> I can't help you with the SerialPort issue, but the process priorities 1 and
> 7 are definitely bad. Since the idle process uses priority 10, your
> processes will never run. Try using something between 11 and 39, or use the
> named priorities:
> Processor userBackgroundPriority
> Processor systemBackgroundPriority
>> View this message in context:
>> Sent from the Squeak - Beginners mailing list archive at Nabble.com.
>> Beginners mailing list
>> Beginners at lists.squeakfoundation.org
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
More information about the Beginners