symlinking devices in /dev

Posted on
Fri Feb 08, 2019 1:54 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

symlinking devices in /dev

I am trying to create a virtual device in /dev that can be found by Indigo, or an Indigo plugin. It is possible to create virtual device servers on other hosts using ser2net or pyserial and then create virtual devices in /dev that connect to the remote service. This can be done using socat or MultiCom and possibly other methods. However, the virtual devices these tools create have \ generic names like ttys001 and the indigo.serialPorts Device description class does not see them. What I want to do is:
    sudo ln -s /dev/ttys001 /dev/cu/usbmodem12345
But, that now fails with Operation not permitted

At this point I have a lot of questions and no direction... But, here are my questions/thoughts:
  • In Mojave, is there a work-around for symlinking devices?
  • Could/Should indigo.serialPort be modified, or modifiable by a plugin, to look for other patterns?
  • Should there be an option to specify a device in a combination pulldown/text field?
  • Should developers just start offering an extra text filled for the full path name to a device? Which would not even have to be in /dev.
  • Is the best answer to this question not even on this list?

Posted on
Sat Feb 09, 2019 12:04 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: symlinking devices in /dev: Progress?

I have made some progress, at least in learning, if not actually towards my goal. I found that by turning off System Integrity Protection (SIP) on MacOS I am able to hard-link, symlink and move (rename) devices in /dev. Only one problem, even if I use the proper naming scheme, Indigo doesn't see these devices. See this post for more details.

Posted on
Sat Feb 09, 2019 12:21 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: symlinking devices in /dev

BTW... Correction. This is what happens when you don't carefully control your variables. I had previously given terminal.app Full Disk Access in the Security & Privacy preference pane, and that did not seem to help. Then I rebooted and disabled SIP, and then things worked, well, I could change things in /dev. Then I rebooted to enable SIP on again and guess what, I can still make changes in /dev. So, it may be the Security & Privacy changes only take place after a reboot, or at least a logout.

However, I still can't fool Indigo into using my additions to /dev.

lanbrown wrote:
That's why I was asking how Indigo determines what devices to show. It doesn't show all USB devices, so it obviously parses a list.
Jay commented they may be using a POSIX call ti get the device list. I searched for such a call and couldn't find one. I suspect the list is created using something like ioreg.

Posted on
Sun Feb 10, 2019 5:38 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: symlinking devices in /dev

Some updates.
  1. As Matt has confirmed in this post in another thread, Indigo uses an OSX call to get the list of devices. The internals of the call are not obvious, but it does not iterate over /dev/*
  2. After reporting I could link virtual ports with SIP enabled, it stopped working. But, when when I disabled it, bang, I can link virtual ports again. Seems you do have to have SIP disabled.
  3. It is now obvious there is no straight forward way to fool Indigo plugins into thinking a virtual serial device (like /dev/cu.usbmodem*) is a real serial device. So, it looks like the best/only way to be able to use remotely served serial devices is by having the plugin developers add support for pyserials ability veto select local, socket or rfc2217 interfaces.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests