I want to open up Raspberry Pi's sound source and serial communication rights to the general public.

Asked 2 years ago, Updated 2 years ago, 92 views

I'd like to pass voice and serial communication permissions to general users who access Raspberry Pi's server through a web browser...

What I tried is

Change the rights of the sound source

 sudochmod666/dev/snd/controlC0
sudo chmod666/dev/snd/pcmC0D0p

Changing Serial Communication Permissions

 sudochmod666/dev/ttyACM0

You can change the permissions above, and you can see the desired behavior, but every time you reboot, you realize that the file is rewritten to the original permissions.

This is also the first time Raspberry Pi has set up a server on Linux.
Could someone please let me know in an easy-to-understand way?

This is Raspberry Pi3 jessie.

Thank you for your cooperation.

linux raspberry-pi raspbian

2022-09-30 20:16

1 Answers

Generally speaking, it is better to add users to the owning group of device files instead of changing the permissions.

For example, /dev/snd/controlC0 is

crw-rw ----1 root audio 116,0 Jan 2023:12 controlC0`

The audio group can read and write to this device because it looks like .Therefore, if you add a user to the audio group, the user can read and write to the device.

/etc/group manages which group the user belongs to.Do not edit this file directly, but use the vigr command to edit it.In the example above, if it is an audio group,

audio:x:29:pi

There should be a line like this, so add a comma-separated user (probably the HTTP server running user) at the end.

However, if the server is exposed to the outside (Internet), it is safer to avoid giving the running user permissions on the HTTP server directly and allow the part that accesses the device to run with the permissions of another user.


2022-09-30 20:16

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.