Topics

udev rule for radio USB port


Chuck M
 

Had problems with communication between the RPi 4 and CS-108G+ radio.  Radio connected as device:  /dev/ttyACM0.  

Found that changing permissions of the device to 777 improved making the connection with all my ham radio apps such as flrig, fldigi, CQRLOG, etc.  Had been entering the command,"sudo chmod 777 /dev/ttyACM0" after turning on the radio.  Wanted a way to make this happen automatically.

Used nano to create a udev to trigger this when the RPi detects the radio is connected.  File name is "etc/udev/rules.d/11-my.rules".  Contains this line to trigger the action:  KERNEL=="ttyACM0", MODE="0777"  Added bold and underline for emphasis, not needed in file.

Works well and no more issues with this.  Another item I had was the micro USB port on the radio was a little loose.  So wrapped a couple of rubber bands around the cable, then stretched them over the front of the radio.  Keeps the plug nice and tight.

Hope this useful for a few hams out there.

73s
Chuck
KD9DVB



David Ranch
 

Hello Chuck,

Changing your serial port permissions to 777 is the insecure way to solve this issue.  Fortunately, there is an easy way to fix this:

If you run the command "ls -la /dev/ttyACM*", you should see something like:

   ls -la /dev/ttyACM*
   crw-rw---- 1 root dialout 188, 0 Sep 23 12:42 /dev/ttyACM0


Notice the "dialout" in the Unix "group" field.  To give access to this port, you need to add your username to the "dialout" group.
To do this, type in the command:

   sudo usermod -G dialout <username>

Where you replace "<username>" with the Unix ID you're logging into the Raspberry Pi with (hopefully NOT the user "pi" account).  Once you've run this command, you either need to logout and back in to see the changes or just reboot.

--David
KI6ZHD




On 09/23/2020 12:32 PM, Chuck M via groups.io wrote:
Had problems with communication between the RPi 4 and CS-108G+ radio.  Radio connected as device:  /dev/ttyACM0.  

Found that changing permissions of the device to 777 improved making the connection with all my ham radio apps such as flrig, fldigi, CQRLOG, etc.  Had been entering the command,"sudo chmod 777 /dev/ttyACM0" after turning on the radio.  Wanted a way to make this happen automatically.

Used nano to create a udev to trigger this when the RPi detects the radio is connected.  File name is "etc/udev/rules.d/11-my.rules".  Contains this line to trigger the action:  KERNEL=="ttyACM0", MODE="0777"  Added bold and underline for emphasis, not needed in file.

Works well and no more issues with this.  Another item I had was the micro USB port on the radio was a little loose.  So wrapped a couple of rubber bands around the cable, then stretched them over the front of the radio.  Keeps the plug nice and tight.

Hope this useful for a few hams out there.

73s
Chuck
KD9DVB




Chuck M
 

Okay, will see how that works later on.  running some psk31 at the moment.  

Want it to be one and done, not having to re enter command each time.  I'll comment out the line in the rules file to test how your method works.

Post later on how it worked out.

Thanks
Chuck
KD9DVB



On Wednesday, September 23, 2020, 03:46:08 PM EDT, David Ranch <rpi4hamradio-groupsio@...> wrote:


Hello Chuck,

Changing your serial port permissions to 777 is the insecure way to solve this issue.  Fortunately, there is an easy way to fix this:

If you run the command "ls -la /dev/ttyACM*", you should see something like:

   ls -la /dev/ttyACM*
   crw-rw---- 1 root dialout 188, 0 Sep 23 12:42 /dev/ttyACM0


Notice the "dialout" in the Unix "group" field.  To give access to this port, you need to add your username to the "dialout" group.
To do this, type in the command:

   sudo usermod -G dialout <username>

Where you replace "<username>" with the Unix ID you're logging into the Raspberry Pi with (hopefully NOT the user "pi" account).  Once you've run this command, you either need to logout and back in to see the changes or just reboot.

--David
KI6ZHD




On 09/23/2020 12:32 PM, Chuck M via groups.io wrote:
Had problems with communication between the RPi 4 and CS-108G+ radio.  Radio connected as device:  /dev/ttyACM0.  

Found that changing permissions of the device to 777 improved making the connection with all my ham radio apps such as flrig, fldigi, CQRLOG, etc.  Had been entering the command,"sudo chmod 777 /dev/ttyACM0" after turning on the radio.  Wanted a way to make this happen automatically.

Used nano to create a udev to trigger this when the RPi detects the radio is connected.  File name is "etc/udev/rules.d/11-my.rules".  Contains this line to trigger the action:  KERNEL=="ttyACM0", MODE="0777"  Added bold and underline for emphasis, not needed in file.

Works well and no more issues with this.  Another item I had was the micro USB port on the radio was a little loose.  So wrapped a couple of rubber bands around the cable, then stretched them over the front of the radio.  Keeps the plug nice and tight.

Hope this useful for a few hams out there.

73s
Chuck
KD9DVB