beckmaxwell08
Posts: 1
Joined: Wed Mar 21, 2018 10:01 pm

Making a ln -s permanent upon boot

Wed Mar 21, 2018 10:14 pm

Hi I have been working with Glediator for a few months now to get it to start up on my RPI and WS2812 light, well I finally got it to work! Only problem is when I reboot my RPI I have to re-enter a symbolic link

Code: Select all

sudo ln -s /dev/ttyACM0 /dev/ttyS89
This line is a must for RXTX to read my Arduino Uno's COM Port. Is there a way I can make this permanent so I don't have to retype EVERY reboot. If not that's alright, but it would be a time saver! Just in case this is also needed

Code: Select all

ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Mar 21 21:20 /DEV/ttyACM0
ls -l /dev/ttyS89
lrwxrwxrwx 1 root root 12 Mar 21 21:56 /dev/ttyS89 -> /dev/ttyACM0
Thank you so much.

User avatar
topguy
Posts: 5617
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Making a ln -s permanent upon boot

Wed Mar 21, 2018 10:36 pm

What is "RXTX" and why cant it be programmed/configured to use ttyACM0 directly ?

The simplest way is just to add the command (without sudo) to "/etc/rc.local" then it will run on every boot.

User avatar
DougieLawson
Posts: 35536
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Making a ln -s permanent upon boot

Thu Mar 22, 2018 1:47 am

To do what you want will need a udev rule.

Code: Select all

[email protected]:~$ cd /etc/udev/rules.d/
[email protected]:/etc/udev/rules.d$ ls
40-scratch.rules     80-arduino.rules  99-input.rules
71-foot_drive.rules  99-com.rules
[email protected]:/etc/udev/rules.d$ cat 80-arduino.rules
KERNEL=="ttyAMA0",SYMLINK+="ttyS0" GROUP="dialout"
KERNEL=="ttyACM0",SYMLINK+="ttyS1" GROUP="dialout"
[email protected]:/etc/udev/rules.d$
Note: Having anything remotely humorous in your signature is completely banned on this forum. Wear a tinfoil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “General programming discussion”