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: 6523
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: 39300
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest 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

pi@pioneer:~$ cd /etc/udev/rules.d/
pi@pioneer:/etc/udev/rules.d$ ls
40-scratch.rules     80-arduino.rules  99-input.rules
71-foot_drive.rules  99-com.rules
pi@pioneer:/etc/udev/rules.d$ cat 80-arduino.rules
KERNEL=="ttyAMA0",SYMLINK+="ttyS0" GROUP="dialout"
KERNEL=="ttyACM0",SYMLINK+="ttyS1" GROUP="dialout"
pi@pioneer:/etc/udev/rules.d$
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “General programming discussion”