the driverNames not finding usb to serial controller on Big Sur

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
n.allan
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Mon Mar 12, 2007 12:06 pm

the driverNames not finding usb to serial controller on Big Sur

Post by n.allan » Wed Dec 15, 2021 6:47 pm

I was quite happily reading and writing to usb serial ports up until upgrading to Big Sur. The usb to serial devices use the FTDI chipset.
You could query the driverNames and it would list the serial ports no problem.

After the upgrade to Big Sur the USB to serial drivers were known to be broken broken. I believe Apple moved from KEXT to DEXT for the drivers so the old ones wouldn't work.

FTDI have since released a new version of the driver (DEXT type) which seems to have fixed the issue for other developers but in livecode, the drivers are still not listed using the driverNames.

Is there any way to list these types of devices other than the driverNames in MacOS?

I can see the devices listed using

Code: Select all

shell("ls /dev/cu.*")
but if I try

Code: Select all

read from file "/dev/cu.usbserial-XXXXX" the stack crashes
I assume I don't have the correct permissions to read from "/dev/..." etc

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: the driverNames not finding usb to serial controller on Big Sur

Post by bn » Wed Dec 15, 2021 9:34 pm

I assume I don't have the correct permissions to read from "/dev/..." etc
I just ran into a permission problem with "revCopyFiles" on MacOs Mojave (10.14.6)
After granting LC all kinds of permissions in "Security" settings in system settings it worked.
Especially "Harddisk" and "Automation" since "revCopyFiles" uses AppleScript.
I think the permission problem is getting bigger with each new OS release.

Could you try to enable those permissions that you think are needed?

This is just a comment on permissions. I have no idea about serial devices etc.

Kind regards
Bernd

n.allan
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Mon Mar 12, 2007 12:06 pm

Re: the driverNames not finding usb to serial controller on Big Sur

Post by n.allan » Thu Dec 16, 2021 8:24 am

I added all the permissions I could to LiveCode in security and preferences. "Whole Disk Access" was the only one that had a checkbox entry for LiveCode.

If I put shell("ls /dev/tty*") I get 2 devices:

/dev/tty.usbserial-14530
/dev/tty.usbserial-4

If I put shell("ls /dev/cu*") I get another 2 devices:

/dev/cu.usbserial-14530
/dev/cu.usbserial-4

If I open for read:

/dev/tty.usbserial-14530 the IDE Freezes
/dev/tty.usbserial-4 result is "can't open that file"
/dev/cu.usbserial-14530 result is empty
/dev/cu.usbserial-4 the result is empty

If I read from file:
/dev/cu.usbserial-14530 the IDE Freezes
/dev/cu.usbserial-4 the IDE Freezes

Prior to Big Sur I would simply call the driverNames and read from the 3rd item on the list of usb serial ports. If I recall correctly I used to use the "calling unit"/dev/cu* device quite successfully. Unfortunately I can't roll back Big Sur on my machine as I need it for other software.

I suspect the driverNames function may need updated for Big Sur

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: the driverNames not finding usb to serial controller on Big Sur

Post by bn » Thu Dec 16, 2021 8:54 am

I suspect the driverNames function may need updated for Big Sur
Sorry to hear that, I guess it is time for a bug report.

Kind regards
Bernd

n.allan
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Mon Mar 12, 2007 12:06 pm

Re: the driverNames not finding usb to serial controller on Big Sur

Post by n.allan » Thu Dec 16, 2021 9:34 am

done - Bug 23488 - the driverNames no longer lists USB to Serial Adapters on OSX Big Sur

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: the driverNames not finding usb to serial controller on Big Sur

Post by richmond62 » Thu Dec 16, 2021 12:50 pm

Did those list on earlier versions of MacOS?

I just did this:

Code: Select all

on mouseUp
   put the driverNames into fld "DN"
end mouseUp
on MacOS 10.7.5 and got this:

Bluetooth-PDA-Sync,/dev/tty.Bluetooth-PDA-Sync,/dev/cu.Bluetooth-PDA-Sync

and nothing else.

This is NOT helpful in the Dictionary:
-
Screen Shot 2021-12-16 at 1.54.17 PM.png
-
Richmonds-iMac:~ richmond$ ls /dev/tty*
/dev/tty /dev/ttyse
/dev/tty.Bluetooth-Modem /dev/ttysf
/dev/tty.Bluetooth-PDA-Sync /dev/ttyt0
/dev/ttyp0 /dev/ttyt1
/dev/ttyp1 /dev/ttyt2
/dev/ttyp2 /dev/ttyt3
/dev/ttyp3 /dev/ttyt4
/dev/ttyp4 /dev/ttyt5
/dev/ttyp5 /dev/ttyt6
/dev/ttyp6 /dev/ttyt7
/dev/ttyp7 /dev/ttyt8
/dev/ttyp8 /dev/ttyt9
/dev/ttyp9 /dev/ttyta
/dev/ttypa /dev/ttytb
/dev/ttypb /dev/ttytc
/dev/ttypc /dev/ttytd
/dev/ttypd /dev/ttyte
/dev/ttype /dev/ttytf
/dev/ttypf /dev/ttyu0
/dev/ttyq0 /dev/ttyu1
/dev/ttyq1 /dev/ttyu2
/dev/ttyq2 /dev/ttyu3
/dev/ttyq3 /dev/ttyu4
/dev/ttyq4 /dev/ttyu5
/dev/ttyq5 /dev/ttyu6
/dev/ttyq6 /dev/ttyu7
/dev/ttyq7 /dev/ttyu8
/dev/ttyq8 /dev/ttyu9
/dev/ttyq9 /dev/ttyua
/dev/ttyqa /dev/ttyub
/dev/ttyqb /dev/ttyuc
/dev/ttyqc /dev/ttyud
/dev/ttyqd /dev/ttyue
/dev/ttyqe /dev/ttyuf
/dev/ttyqf /dev/ttyv0
/dev/ttyr0 /dev/ttyv1
/dev/ttyr1 /dev/ttyv2
/dev/ttyr2 /dev/ttyv3
/dev/ttyr3 /dev/ttyv4
/dev/ttyr4 /dev/ttyv5
/dev/ttyr5 /dev/ttyv6
/dev/ttyr6 /dev/ttyv7
/dev/ttyr7 /dev/ttyv8
/dev/ttyr8 /dev/ttyv9
/dev/ttyr9 /dev/ttyva
/dev/ttyra /dev/ttyvb
/dev/ttyrb /dev/ttyvc
/dev/ttyrc /dev/ttyvd
/dev/ttyrd /dev/ttyve
/dev/ttyre /dev/ttyvf
/dev/ttyrf /dev/ttyw0
/dev/ttys0 /dev/ttyw1
/dev/ttys000 /dev/ttyw2
/dev/ttys1 /dev/ttyw3
/dev/ttys2 /dev/ttyw4
/dev/ttys3 /dev/ttyw5
/dev/ttys4 /dev/ttyw6
/dev/ttys5 /dev/ttyw7
/dev/ttys6 /dev/ttyw8
/dev/ttys7 /dev/ttyw9
/dev/ttys8 /dev/ttywa
/dev/ttys9 /dev/ttywb
/dev/ttysa /dev/ttywc
/dev/ttysb /dev/ttywd
/dev/ttysc /dev/ttywe
/dev/ttysd /dev/ttywf

Richmonds-iMac:~ richmond$ ls /dev/cu*
/dev/cu.Bluetooth-Modem /dev/cu.Bluetooth-PDA-Sync

I wonder HOW any of the USB devices connected to this 2006 iMac work at all!

n.allan
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Mon Mar 12, 2007 12:06 pm

Re: the driverNames not finding usb to serial controller on Big Sur

Post by n.allan » Thu Dec 16, 2021 2:35 pm

Yes they used to appear in the driverNames. I worked on a stack during lockdown and (almost) had it all sussed. Reading and writing serial ports (almost real time). Big Sur came along and the stack no longer works.

I have been following the issue since it appeared on Arduino Microcontroler forums. They were quick to highlight the driver changes in Big Sur as they use the FTDI USB to Serial Chip on their programming boards.

Like I say, the driver issue appears to be semi resolved for them but we still have this issue in LiveCode where we can't read from serial ports.

I know people think serial ports are "dead technology" but I can assure everyone they are not going away any time soon in industrial settings.

mtalluto
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 125
Joined: Tue Apr 11, 2006 7:02 pm
Location: Seattle, WA
Contact:

Re: the driverNames not finding usb to serial controller on Big Sur

Post by mtalluto » Thu Dec 16, 2021 3:24 pm

I have this problem as well. I’ll dig around in my code a bit and see what I can find.
Mark Talluto
--
Canela
design - develop - deploy: https://appli.io
Database and Cloud for LiveCode Developers: https://livecloud.io
Company: https://canelasoftware.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: the driverNames not finding usb to serial controller on Big Sur

Post by dunbarx » Thu Dec 16, 2021 5:32 pm

I know people think serial ports are "dead technology" but I can assure everyone they are not going away any time soon in industrial settings.
USB is a serial protocol. I don't think it is going anywhere in any setting. :wink:

Craig

n.allan
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Mon Mar 12, 2007 12:06 pm

Re: the driverNames not finding usb to serial controller on Big Sur

Post by n.allan » Sun Jan 16, 2022 1:57 am

I'm showing my age here but when I say "serial port", I mean RS232

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: the driverNames not finding usb to serial controller on Big Sur

Post by richmond62 » Sun Jan 16, 2022 1:53 pm

RS232

What kind of out port is that?
-
bbc-micro-back.jpeg
-
My BBC Model B has a RS423 at the back. 8)

Aha:
-
RS232.jpeg
RS232.jpeg (4.1 KiB) Viewed 7190 times
-
What sort of computer with one of those can run an operating system which can run LiveCode?

SparkOut
Posts: 2839
Joined: Sun Sep 23, 2007 4:58 pm

Re: the driverNames not finding usb to serial controller on Big Sur

Post by SparkOut » Mon Jan 17, 2022 12:27 am

New computers with "COM port" connections (serial) are still available, and it's also possible to get USB-Serial adapters for a pittance.
Although I suspect that glib answer might not be so applicable in the Apple universe.

bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 133
Joined: Tue Feb 23, 2010 10:53 pm
Location: Saint Louis, Missouri USA

Re: the driverNames not finding usb to serial controller on Big Sur

Post by bobcole » Mon Jan 17, 2022 7:29 pm

In case it might help, here is the Terminal's response in macOS 12.1 (Monterey) on my MacBook Pro.
MBP-M1max ~ % ls /dev/cu*
/dev/cu.Bluetooth-Incoming-Port
This is the same response whether or not I have a thumb drive attached.
Same even when connected via Bluetooth to a wireless speaker, listening to music.
FYI,
Bob

mhsu
Posts: 8
Joined: Thu Aug 04, 2016 2:33 pm

Re: the driverNames not finding usb to serial controller on Big Sur

Post by mhsu » Wed Jan 26, 2022 9:17 pm


but if I try

Code: Select all

read from file "/dev/XXXXX" the stack crashes
I assume I don't have the correct permissions to read from "/dev/..." etc
Have you tried

Code: Select all

 open driver "/dev/XXXXX" for (binary/text) (read/write/update)
?

I don't know what the implementation of the open/close driver is under the hood; but this worked for me when I was trying to read from a usb-serial device (using either Apple's built in driver or the one downloaded from the FTDI website).

Post Reply

Return to “Mac OS”