Serial Port (USB) on OS X?

Mac OSX specific forum
Khorus
User
User
Posts: 25
Joined: Sat Nov 13, 2010 11:22 pm

Serial Port (USB) on OS X?

Post by Khorus »

Hello all,

Lately, I've been porting an application from Windows to Mac OS X. I use a USB/Serial cable (Prolific chip) for the serial port. Looks like it's working fine at the OS level. I've got a "/dev/tty.usbserial" that works (did a quick test).

Now, if I try in PureBasic, it doesn't seem to work, here's how I do it:

-> OpenSerialPort(0, "/dev/tty.usbserial", 115200, #PB_SerialPort_NoParity, 8, 1, #PB_SerialPort_NoHandshake, 1024, 1024)

The function returns "0" (so, it's supposed to be successful) but when I try sending something to the opened port (using WriteSerialPortString) nothing happens... No data gets through.

I'm using Lion (10.7.3) and XCode 4.3.1. Anyone here successfully opened a serial port at 115200 Bauds on OS X? Thanks in advance.

Marc Girard aka Khorus
Khorus
User
User
Posts: 25
Joined: Sat Nov 13, 2010 11:22 pm

Re: Serial Port (USB) on OS X?

Post by Khorus »

Hello again all,

I just recently made a test just to make sure it wasn't my configuration causing troubles. I tested my serial line with "screen" (in the Terminal) using 115200 bauds and my tests worked out fine. So, is there a bug in PureBasic that keeps us from using a serial USB adapter in MacOS X? Thank you!

Marc Girard
(aka Khorus)
User avatar
dhouston
Enthusiast
Enthusiast
Posts: 430
Joined: Tue Aug 21, 2007 2:44 pm
Location: USA (Cincinnati)
Contact:

Re: Serial Port (USB) on OS X?

Post by dhouston »

Have you installed the Prolific driver? I don't have Lion but on earlier versions I saw "/dev/tty.usbserial" but still needed the driver to use it.
http://davehouston.org
Mac Mini (Intel) 10.6.8 - iMac G4 (PPC) 10.4.11
Dell Dimension 2400 W98SE,W2K,XP,Vista,W7,Debian,Ubuntu,Kubuntu,Xubuntu,Fedora,Mandriva,Mint
(on swappable HDDs)
Vizio VTAB1008 - Android 3.1
MK808 miniAndroidPC (Android 4.1)
Khorus
User
User
Posts: 25
Joined: Sat Nov 13, 2010 11:22 pm

Re: Serial Port (USB) on OS X?

Post by Khorus »

Yes, I installed the latest Prolific drivers, the /dev/tty.usbserial doesn't appear if it's not installed.
oliv
User
User
Posts: 42
Joined: Sun Aug 24, 2003 10:11 am
Location: France

Re: Serial Port (USB) on OS X?

Post by oliv »

Hi,

It's a 6 months old post but it could be linked to a problem I have, see this post
Could you try at 9600 bds if it works ? Thank you
Post Reply