Re: PiDV, AMBEserver and Buster


KB5ZUR
 

Thanks John,
That does work. I've tested and it does start automatically on reboot. I'm not really sure of the security ramifications of running this way especially since pi this will be port forwarded through to the internet so I can use it remotely.
I wonder if there is anything I could add to the systemctl cmd (-user or something) when starting Ambeserver rather than changing the user to root.
Again thanks for all your help in getting this going. I learned a few things LOL.

-David
KB5ZUR


On Fri, Oct 2, 2020 at 12:09 PM John D Hays - K7VE <john@...> wrote:
I don't recommend running daemons as root, but you could edit
/etc/systemd/system/ambeserver@.service

[Unit]
Description=AMBEserver Daemon
After=network.target serial-getty@%i.service dev-%i.device
Conflicts=serial-getty@%i.service
OnFailure=serial-getty@%i.service

[Service]
User=opendv
EnvironmentFile=/etc/opendv/%p-%i.conf
PermissionsStartOnly=true
ExecStartPre=/bin/chgrp dialout /dev/%i
ExecStartPre=/bin/chmod 0660 /dev/%i
ExecStart=/usr/local/sbin/AMBEserver -p ${UDP_PORT} -i /dev/%i $AMBESERVER_FLAGS
Restart=on-abort

[Install]
WantedBy=multi-user.target


And change User to root.   As you can see this script supposedly changes group permissions to dialout and read/write for the device.  So it should work.

Verify that user opendv is a member of the dialout group

grep dialout /etc/group

On Fri, Oct 2, 2020 at 9:05 AM KB5ZUR <kb5zur@...> wrote:
I tried this the other night and again just now.

I copied my ambeserver-ttyS0.conf to ambeserver-serial0.conf and to serial 1.conf.

I tried enabling and running both and got the error  "ambeserver@... failed no such file or or directory. same for serial1

however I do see this in /dev
lrwxrwxrwx  1 root root           5 Oct  1 17:48 serial0 -> ttyS0
lrwxrwxrwx  1 root root           7 Oct  1 17:48 serial1 -> ttyAMA0

-DS


On Fri, Oct 2, 2020 at 10:19 AM John D Hays - K7VE <john@...> wrote:
There are some automatic aliases.

Try serial0 and serial1 and see if that helps.  


--
John D. Hays
Kingston, WA
K7VE

 



--
John D. Hays
Kingston, WA
K7VE

 

Join ambe@nw-digital-radio.groups.io to automatically receive all group messages.