Re: PiDV, AMBEserver and Buster


KB5ZUR
 

John,
Thanks for the help. 
I'm definitely a noob when it comes to a lot of Linux  commands and I appreciate you sending me the references. I will study the documentation to get more familiar with the system administration commands. I had tried a few things on my own researching the problem and decided to start fresh last night and here is where it stands.

Re-installed the OS and configured the pi using latest version from raspberry pi web site
Using sudo-raspi config, I set up the serial port turning off the boot console and enabling the com port
Ran the AMBEserver3.py test to verify the PiDV serial communications. (FYI, I had to modify the AMBEserver3.py file to delete the tm symbol after ThumbDV on line 22 as my python program couldn't understand the symbol)
Test runs fine so I proceed with the ambesocktesy.py running AMBEserver -i /dev/ttyS0 and that runs fine too.
 In fact I operated BlueDV on my PC as additional verification of the AMBEserver.

The wheels come off when I try to run the server as a service using sudo systemctl enable ambeserver@ttyS0 and  sudo systemctl start ambeserver@ttyS0 and  sudo systemctl status ambeserver@ttyS0
 I get the ever troubling error " AMBEserver: Unable to open GPIO export interface: Permission denied"

I then change the ownership of /dev/ttyS0 with:
sudo chown root:dialout /dev/ttyS0
sudo chmod 660 /dev/ttyS0
after testing I get 
ls -l /dev/tty[AS]*
crw-rw---- 1 root dialout 204, 64 Oct  1 17:48 /dev/ttyAMA0
crw-rw---- 1 root dialout   4, 64 Oct  2 09:14 /dev/ttyS0

but when I start the server again the same problems. Server fails with the GPIO permission failure and
the ownership of ttyS0 reverts back to this state.
ls -l /dev/tty[AS]*
crw-rw---- 1 root dialout 204, 64 Oct  1 17:48 /dev/ttyAMA0
crw--w---- 1 root tty       4, 64 Oct  2 09:21 /dev/ttyS0

somehow the  sudo systemctl start ambeserver@ttyS0 resets the ownership of of ttyS0

Again being a noob, I'm not sure where to go from here. I'm hoping this info will give you some insight as to how I can proceed from here.

Thanks again for your help.
-David
KB5ZUR



On Thu, Oct 1, 2020 at 2:14 PM John D Hays - K7VE <john@...> wrote:
David,

There are two commands you should become familiar with chown (to change ownership of a file or directory) and chmod (to change permissions for the owner, group, and world of a file or directory).  Also, learn chgrp.

Issue the commands:

man chmod
man chown
man chgrp

to read the manual pages for each command.

chown root:dialout /dev/ttyS0
chmod 660 /dev/ttyS0

After doing so, do the ls -l /dev/tty[AS]*  to see the new ownership and permissions of both AMA0 and S0.

I advise getting some system administration knowledge, you can start with articles like https://opensource.com/article/17/7/20-sysadmin-commands


On Wed, Sep 30, 2020 at 6:25 PM KB5ZUR <kb5zur@...> wrote:
Hi John,
Pardon my ignorance but I'm not sure how to make that change of ownership of /dev/ttyS0 can you kindly advise how to do that. I don't want to screw things up now that I am this close.

I appreciate all the help.

Thanks,
-David

On Wed, Sep 30, 2020 at 7:03 PM John D Hays - K7VE <john@...> wrote:
Try changing the ownership of /dev/ttyS0 -- your listing did not show it belonging to the dialout group.

On Wed, Sep 30, 2020 at 4:59 PM KB5ZUR <kb5zur@...> wrote:
Hi John,

Still no Joy!  tried your suggestion and the server failed. I stopped the server and ran the AMBEtest3.py and it hangs about half way through the test.
i@DV3000SVR:~/ambeserver-install $ sudo python AMBEtest3.py -s /dev/ttyAMA0
Setting ...
/dev/ttyAMA0
d
8
N
1
False
False
False

Reset
6100010033

grep dialout shows the following:
pi@DV3000SVR:~/ambeserver-install $ grep dialout /etc/group
dialout:x:20:pi,opendv
 AMBEtest3,py with ttyS0 seems to complete

pi@DV3000SVR:~/ambeserver-install $ sudo python AMBEtest3.py -s /dev/ttyS0
Setting ...
/dev/ttyS0
d
8
N
1
False
False
False

Reset
6100010033
Wrote: 5 bytes

Product ID
6100010030
Wrote: 5 bytes

Version
6100010031
Wrote: 5 bytes

Set DSTAR Mode
61000c000a013007634000000000000048
Wrote: 17 bytes

What now coach?

-David
KB5ZUR


On Wed, Sep 30, 2020 at 11:25 AM John D Hays - K7VE <john@...> wrote:
OK, normally the PiDV™ would be on /dev/ttyAMA0 and not /dev/ttyS0 (Pi4 may re-map).

Give a try with:
sudo systemctl stop ambeserver@...  
sudo systemctl disable ambeserver@...  
sudo systemctl start ambeserver@...  
sudo systemctl status ambeserver@... 

If all is good, then

sudo systemctl enable ambeserver@...    

You can verify that opendv is in the dialout group with
 grep dialout /etc/group

Which should return something like:
dialout:x:20:opendv     

On Wed, Sep 30, 2020 at 6:58 AM KB5ZUR <kb5zur@...> wrote:
John,
Her you go.
-DS

pi@DV3000SVR:~/ambeserver-install $ ls -l /dev/tty*

crw-rw---- 1 root dialout 204, 64 Sep 29 15:13 /dev/ttyAMA0
crw--w---- 1 root tty       4, 64 Sep 29 17:56 /dev/ttyS0


Hi John,
I'm at exactly this same point with my PiDV on a new Raspberry pi 3B+ install.
PiDV works with ttl to usb adaptor in wibdows and passed AMBEtest3.py fine.

Tried the "sudo usermod -G dialout opendv with no success. I still get the following errors when trying to run ambeserver@ttyS0
pi@DV3000SVR:~/ambeserver-install $ sudo systemctl status ambeserver@...
● ambeserver@... - AMBEserver Daemon
   Loaded: loaded (/etc/systemd/system/ambeserver@.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2020-09-29 15:38:36 CDT; 34s ago
 Main PID: 1546 (code=exited, status=1/FAILURE)
 
Sep 29 15:38:36 DV3000SVR systemd[1]: Starting AMBEserver Daemon...
Sep 29 15:38:36 DV3000SVR systemd[1]: Started AMBEserver Daemon.
Sep 29 15:38:36 DV3000SVR AMBEserver[1546]: AMBEserver: Starting...
Sep 29 15:38:36 DV3000SVR AMBEserver[1546]: AMBEserver: Opened serial port /dev/ttyS0 at 230400 bps.
Sep 29 15:38:36 DV3000SVR AMBEserver[1546]: AMBEserver: Unable to open GPIO export interface: Permission denied
Sep 29 15:38:36 DV3000SVR AMBEserver[1546]: AMBEserver: Could not initialize the DV3K!
Sep 29 15:38:36 DV3000SVR systemd[1]: ambeserver@...: Main process exited, code=exited, status=1/FAIL
Sep 29 15:38:36 DV3000SVR systemd[1]: ambeserver@...: Failed with result 'exit-code'.
Sep 29 15:38:36 DV3000SVR systemd[1]: ambeserver@...: Triggering OnFailure= dependencies.
lines 1-14/14 (END)


seems to be some sort of GPIO Permission denied error.

Driving me a bit crazy trying to figure this out. Any help is appreciated.




--
John D. Hays
Kingston, WA
K7VE

 



--
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.