I try to use the serial port to communicate with an Arduino. On Linux, no problemo. I can open the serial port with the following code:
| serialPort baudRate comPortNumber |
baudRate := 31250.
comPort := '/dev/ttyACM0'.
serialPort := SerialPort new
"the port is closed to ensure that it will be free"
(serialPort openPort: comPort) isNil
ifTrue: [ ^self error: 'COM port not available' ]
ifFalse: [ serialPort inspect ].
But on MacOS X (10.11.6), the same code used with /dev/cu.usbmodel1411 doesn't run. The error is "Cannot open '/dev/cu.usbmodel1411'". I'm sure that is the correct serial port. If I type "more -f /dev/cu.usbmodel1411" in a terminal, the rx/tx leds of the Arduino are blink.
Someone has an idea about this problem that is not specific of the Arduino but concerns the generic usage of the serial port with Pharo?
ps: I can't test on Windows but I'm interested by a feedback.
Just a few random thoughts...
Can you load an echo program into the Arduino to check comms is not getting corrupted?
Is the problem with a USB3 port?
Try using a USB2 port.
Are you using an FTDI cable?
try disabling Apple's Virtual Com Port and using FTDI's per section 7...
or using a non-FTDI serial adpator.
On Mon, Mar 13, 2017 at 12:21 AM, olivier auverlot <[hidden email]> wrote:
I don't think that the problem concerns the USB port or the cable because:
* I have tested with a simple Perl script (with the Device::SerialPort module) and all is ok.
* In a shell, I can activate the rx/tx leds of the Arduino with the command "more -f /dev/cu.usbmodel1411".
* I can use the Arduino IDE to program the card and send my binaries.
If my Pharo code is correct, I suspect a problem in the serial plugin for MacOS X. I tried unsuccessful with Pharo 5 and Pharo 6.
2017-03-13 8:01 GMT+01:00 Ben Coman <[hidden email]>:
You'd only mentioned the middle one, which I didn't think was sufficient.
But I agree the other two are strong tests indicating the USB is okay.
Sorry I don't have OSX to test further.
But a question for me to learn something, what makes these two ports equivalent test points between your Pharo code and your "more" test.
To be specific, did ttyACM0 with Perl and the IDE ?
On Mon, Mar 13, 2017 at 3:27 PM, olivier auverlot <[hidden email]> wrote:
I don't know how pertinent this is, but to answer my own question...
MacOS: what's the difference between /dev/tty.* and /dev/cu.*?
/dev/tty.* and /dev/cu.* and AppleUSBFTDI
Difference between cu.* and tty.*
On Mon, Mar 13, 2017 at 8:13 PM, Ben Coman <[hidden email]> wrote:
|Free forum by Nabble - Resume Templates||Edit this page|