eslavko
Posts: 73
Joined: Fri Dec 06, 2013 6:10 pm

GPIO1

Sat May 30, 2020 3:11 pm

Hello...

I'm make test pod for some testing device. I use RPI and pigpiod. The problem is that I use all the pins including GPIO1. And now I face that pigpio library refuse to use that pin. Is it possible to override that?. I don't have any HAT, EEPROM or camera. So pin should be free. The limitation seems to be in library itself.

Thanks for any useful info.

User avatar
joan
Posts: 14887
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: GPIO1

Sat May 30, 2020 3:16 pm

Start the daemon with the -x option, e.g. sudo pigpiod -x -1 will allow access to all GPIO.

http://abyz.me.uk/rpi/pigpio/pigpiod.html

eslavko
Posts: 73
Joined: Fri Dec 06, 2013 6:10 pm

Re: GPIO1

Sat May 30, 2020 3:23 pm

That's works. Thanks.

...now how to start daemon on reboot?
sudo systemctl enable pigpiod -x -1

doesn't work.

knute
Posts: 550
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Re: GPIO1

Sat May 30, 2020 3:31 pm

You might try editing /lib/systemd/system/pigpiod.service.

eslavko
Posts: 73
Joined: Fri Dec 06, 2013 6:10 pm

Re: GPIO1

Sat May 30, 2020 3:44 pm

doesn't work. Seems that completely ignore the parameters.

eslavko
Posts: 73
Joined: Fri Dec 06, 2013 6:10 pm

Re: GPIO1

Sat May 30, 2020 3:45 pm

the file itself:

Code: Select all

[Unit]
Description=Daemon required to control GPIO pins via pigpio
[Service]
ExecStart=/usr/bin/pigpiod -x -1
ExecStop=/bin/systemctl kill pigpiod
Type=forking
[Install]
WantedBy=multi-user.target

eslavko
Posts: 73
Joined: Fri Dec 06, 2013 6:10 pm

Re: GPIO1

Sat May 30, 2020 4:45 pm

systemctl seems to skip all parameters when starting pigpiod!
seems to strange to be real but I try that on fresh install too and fail again.

at least adding

Code: Select all

@reboot              /usr/bin/pigpiod -x -1
to crontab works.

eslavko
Posts: 73
Joined: Fri Dec 06, 2013 6:10 pm

Re: GPIO1

Sat May 30, 2020 4:54 pm

knute wrote:
Sat May 30, 2020 3:31 pm
You might try editing /lib/systemd/system/pigpiod.service.
As this doesn't work I just got crazy idea. I changed line
ExecStart=/usr/bin/pigpiod -x -1
with
ExecStart=/usr/bin/pigpiodgarbage -x -1

so giving wrong name here. And after rebot I have surprise. pigpiod is loaded! so that file is not correct one!

knute
Posts: 550
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Re: GPIO1

Sat May 30, 2020 6:17 pm

Did you do a systemctl daemon-reload?

eslavko
Posts: 73
Joined: Fri Dec 06, 2013 6:10 pm

Re: GPIO1

Sun May 31, 2020 11:16 am

ups.. NO

But still don't work.
Here is complete workflow:

sudo systemctl disable pigpiod.service
sudo systemctl stop pigpiod.service

sudo nano /lib/systemd/system/pigpiod.service
replace ExecStart=/usr/bin/pigpiod with
ExecStart=/usr/bin/pigpiodgarbage -x -1

sudo systemctl daemon-reload
sudo systemctl enable pigpiod.service
sudo systemctl start pigpiod.service

pigpiod is started!

knute
Posts: 550
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Re: GPIO1

Sun May 31, 2020 7:18 pm

eslavko wrote:
Sun May 31, 2020 11:16 am
replace ExecStart=/usr/bin/pigpiod with
ExecStart=/usr/bin/pigpiodgarbage -x -1
Are you sure that pigpiod is in fact running when you called to start pigpiodgarbage?

User avatar
dickon
Posts: 1452
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: GPIO1

Sun May 31, 2020 7:23 pm

If he stuck it in his crontab, I'm not at all surprised it is...

eslavko
Posts: 73
Joined: Fri Dec 06, 2013 6:10 pm

Re: GPIO1

Tue Jun 02, 2020 6:06 am

I deleted it from crontab.

sudo systemctl disable pigpiod.service
sudo systemctl stop pigpiod.service

sudo nano /lib/systemd/system/pigpiod.service
replace ExecStart=/usr/bin/pigpiod with
ExecStart=/usr/bin/pigpiodgarbage -x -1
sudo systemctl daemon-reload

sudo reboot

after rebot there is no pigpiod task (looking with htop)
when I issue sudo systemctl start pigpiod.service
the pigpiod task appears but without -x -1 (but it shouldnt as pigpiodgarbage is called)

Return to “General discussion”