Hi Friedrich, I did not test myself but I will soon. Since the Jenkins is down, you can found the latest VM (with the SerialPlugin modifications that Esteban did) in my dropbox: https://www.dropbox.com/sh/flx2cc8mjszhckg/uZ8sTxSB1k Luc #Luc 2012/11/7 Esteban Lorenzano <estebanlm@gmail.com>
we fixed that with Luc in the sprint last friday :)
problem was:
1) for linux, primitive openByName: was never implemented. 2) for OSX, all the plugin was never implemented, there was just a stub.
So well, we implemented all of that, now... you need the latest VM build. but I'm afraid right now jenkins is experimenting some problems and not online. Just wait a few hours and you will be able to download it :)
Esteban
On Nov 7, 2012, at 3:54 PM, Friedrich Dominicus < frido@q-software-solutions.de> wrote:
I'm stuck. I try to open a serial Port on Linux using Pharo.
The code is as simple as:
port := SerialPort new. portName := '/dev/ttyUSB0'. port openPort: portName.
Now this opening fails for "whatever" reason. Anyway in the console I got the following "messages":
PluggableTextMorph>>handleEdit: in Block: [result := editBlock value] Error while opening the serial port (/dev/ttyUSB0# 4 ). Error: Cannot open '/dev/ttyUSB0'
It seems after the USB0 there is not the "end" of the string but some gibberish.
I tried to extract the code for the SerialPlugin and use it stand-alone in C andwrote the following:
#include <stdio.h> #include "SerialPlugin.h"
int main(void) { char *portName = "/dev/ttyUSB0"; int baudRate = 9600; int stopBitsType = 1; int parityType = 0; int dataBits = 8; int inFlowControlType = 0; int outFlowControlType = 0; int xOnByte = 19; int xOffByte = 24; int iRval;
iRval = serialPortOpenByName (portName, baudRate, stopBitsType, parityType, dataBits, inFlowControlType, outFlowControlType, xOnByte, xOffByte); iRval = serialPortCloseByName (portName); return 0; }
And there is no error while using it this way in C. So what is broken?
Regards Friedrich