Renaming serial ports in unix

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) Renaming serial ports in unix
# 1  
Old 05-24-2012
Renaming serial ports in unix

Hello everyone, this is my first post and I am by no means a unix expert, so I hope I explain my issue well.

I'm on a mac (mac mini), 10.7.

My question is about serial port names. I have an arduino microcontroller plugged in via usb, and every time the computer is shut down it gives the arduino a new auto-generated name (some variation of tty.usbmodem111 or tty.usbmodem121).

The problem is that I am communicating with my arduino via firmata with an external program where I have set the correct serial port name by hand. So of course, whenever the computer restarts and then renames the serial port that my arduino is on, my program can no longer find it!

So I need to find a way to manage this issue, either by making sure it always names the arduino serial port consistently. Or, maybe a script that can be executed to re-name the serial port to something pre-set. Or any other ideas for dealing with this renaming issue.

I really need to solve this problem, as I will not be able to rename the serial port by hand each time.

Any help would by very greatly appreciated, I really need to solve this issue.

Best,
Erik
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Help with serial ports.

Hi, This is my first post here. I would like to ask: how to connect the barcode scanner to the serial port? What are the names in the system (in / dev) and serialport1 serialport0? Please help with this. Regards. (2 Replies)
Discussion started by: ftwojtek
2 Replies

2. Programming

Serial Ports - locking them, checking if they are open

Hi, I'm trying to fix up some serial code that was given to me by a coworker no longer on the project. Problem is, when the program is running and reading the port, I can take away the port by doing a cu command in another terminal window. When I release the cu, the program crashes, I think... (1 Reply)
Discussion started by: Oak
1 Replies

3. Shell Programming and Scripting

PERL:controlling serial ports ?

Is it possible to write a perl program to controll the serial port? e.g. What iam trying to do, for a challenge is create a box with two lights. red and green, connect to a serial port and have a perl program to give me the options to turn on the red light or green light. Is this possilbe, can... (1 Reply)
Discussion started by: perleo
1 Replies

4. IP Networking

unix to unix serial connection question

hi there i'm a new bie just got few simple questions to ask. I got expert in windows configuration but totally new to unix environment . I want to make sure a com port (com1) is working, so I connect a 9-pin cable (CB9) for both PC using Unix environment (unix to unix). The question are (1)... (1 Reply)
Discussion started by: typsam
1 Replies

5. UNIX for Dummies Questions & Answers

Resetting hung serial ports and peripheral devices.

Working in SunOS 2.6 without the GUI, I am trying to find out what command line syntax I can use to reset the serial port. I have also been curious how to reset peripheral devices without having to reboot the machine. If anyone has a cheat sheet for that, that would be great! (1 Reply)
Discussion started by: mcherry
1 Replies

6. Cybersecurity

how to access ports in UNIX

How to access to COM1 Port COM2 ports in UNIX is there any functions (1 Reply)
Discussion started by: rajashekaran
1 Replies

7. UNIX for Dummies Questions & Answers

Ports In Unix

Please could some one tell me how to open a port in unix or to check if a port is open. (2 Replies)
Discussion started by: bountyhunter
2 Replies

8. Programming

Reading incoming data in serial ports

Hi every body, i have the following problem : I need to read incoming data from a serial port, this port has connected a weigth device to it that send the weigth and i need to read this data to my aplication, i had this problem in Window Enviroment and i resolve with a "C" routine, but in Unix... (1 Reply)
Discussion started by: jricardorm
1 Replies

9. UNIX for Dummies Questions & Answers

Installing a modem on a serial accelerator ports

I had been using a modem installed on a Digi accelerator port to dial in to an SCO open server r5 server. On monday it quit working and I realy don't know how it was installed and configured. I have tested the modem on a PC and it works. The port the modem is connected to is ttyB06 and I have... (1 Reply)
Discussion started by: kikkin
1 Replies

10. UNIX for Dummies Questions & Answers

Serial Ports, wacom tablet under unix

Hi, I'm new to the boards and don't know all that much about unix either. I do have quite a specific question though and i hope someone can help me with it... i'm going crazy...i've been trying to set up a wacom tablet on my unix box. i've don't it before but it was taken away and the os... (3 Replies)
Discussion started by: Salwey
3 Replies
Login or Register to Ask a Question
MAC_PORTACL(4)						   BSD Kernel Interfaces Manual 					    MAC_PORTACL(4)

NAME
mac_portacl -- network port access control policy SYNOPSIS
To compile the port access control policy into your kernel, place the following lines in your kernel configuration file: options MAC options MAC_PORTACL Alternately, to load the port access control policy module at boot time, place the following line in your kernel configuration file: options MAC and in loader.conf(5): mac_portacl_load="YES" DESCRIPTION
The mac_portacl policy allows administrators to administratively limit binding to local UDP and TCP ports via the sysctl(8) interface. In order to enable the mac_portacl policy, MAC policy must be enforced on sockets (see mac(4)), and the port(s) protected by mac_portacl must not be included in the range specified by the net.inet.ip.portrange.reservedlow and net.inet.ip.portrange.reservedhigh sysctl(8) MIBs. The mac_portacl policy only affects ports explicitly bound by a user process (either for a listen/outgoing TCP socket, or a send/receive UDP socket). This policy will not limit ports bound implicitly for outgoing connections where the process has not explicitly selected a port: these are automatically selected by the IP stack. When mac_portacl is enabled, it will control binding access to ports up to the port number set in the security.mac.portacl.port_high sysctl(8) variable. By default, all attempts to bind to mac_portacl controlled ports will fail if not explicitly allowed by the port access control list, though binding by the superuser will be allowed, if the sysctl(8) variable security.mac.portacl.suser_exempt is set to a non- zero value. Runtime Configuration The following sysctl(8) MIBs are available for fine-tuning the enforcement of this MAC policy. All sysctl(8) variables, except security.mac.portacl.rules, can also be set as loader(8) tunables in loader.conf(5). security.mac.portacl.enabled Enforce the mac_portacl policy. (Default: 1). security.mac.portacl.port_high The highest port number mac_portacl will enforce rules for. (Default: 1023). security.mac.portacl.rules The port access control list is specified in the following format: idtype:id:protocol:port[,idtype:id:protocol:port,...] idtype Describes the type of subject match to be performed. Either uid for user ID matching, or gid for group ID matching. id The user or group ID (depending on idtype) allowed to bind to the specified port. NOTE: User and group names are not valid; only the actual ID numbers may be used. protocol Describes which protocol this entry applies to. Either tcp or udp are supported. port Describes which port this entry applies to. NOTE: MAC security policies may not override other security system policies by allowing accesses that they may deny, such as net.inet.ip.portrange.reservedlow / net.inet.ip.portrange.reservedhigh. If the specified port falls within the range specified, the mac_portacl entry will not function (i.e., even the specified user/group may not be able to bind to the specified port). security.mac.portacl.suser_exempt Allow superuser (i.e., root) to bind to all mac_portacl protected ports, even if the port access control list does not explicitly allow this. (Default: 1). security.mac.portacl.autoport_exempt Allow applications to use automatic binding to port 0. Applications use port 0 as a request for automatic port allocation when bind- ing an IP address to a socket. This tunable will exempt port 0 allocation from rule checking. (Default: 1). SEE ALSO
mac(3), ip(4), mac_biba(4), mac_bsdextended(4), mac_ifoff(4), mac_mls(4), mac_none(4), mac_partition(4), mac_seeotheruids(4), mac_test(4), mac(9) HISTORY
MAC first appeared in FreeBSD 5.0 and mac_portacl first appeared in FreeBSD 5.1. AUTHORS
This software was contributed to the FreeBSD Project by NAI Labs, the Security Research Division of Network Associates Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (``CBOSS''), as part of the DARPA CHATS research program. BSD
December 9, 2004 BSD