1

I have previously asked a question Cannot remotely connect to pigpiod (now deleted) but never resolved the issue.

This is a more generic question.

sudo ss -lntp
State  Recv-Q  Send-Q   Local Address:Port    Peer Address:Port                                                                                                                             
LISTEN 0       128            0.0.0.0:111          0.0.0.0:*     users:(("rpcbind",pid=299,fd=4),("systemd",pid=1,fd=26))                                                                   
LISTEN 0       5              0.0.0.0:8880         0.0.0.0:*     users:(("rpimonitord",pid=835,fd=4))                                                                                       
LISTEN 0       128            0.0.0.0:80           0.0.0.0:*     users:(("nginx",pid=449,fd=6),("nginx",pid=448,fd=6),("nginx",pid=447,fd=6),("nginx",pid=446,fd=6),("nginx",pid=445,fd=6)) 
LISTEN 0       64             0.0.0.0:39411        0.0.0.0:*                                                                                                                                
LISTEN 0       128            0.0.0.0:52149        0.0.0.0:*     users:(("rpc.mountd",pid=430,fd=17))                                                                                       
LISTEN 0       128            0.0.0.0:22           0.0.0.0:*     users:(("sshd",pid=450,fd=3))                                                                                              
LISTEN 0       128            0.0.0.0:44311        0.0.0.0:*     users:(("rpc.mountd",pid=430,fd=9))                                                                                        
LISTEN 0       50             0.0.0.0:445          0.0.0.0:*     users:(("smbd",pid=1237,fd=34))                                                                                            
LISTEN 0       64             0.0.0.0:2049         0.0.0.0:*                                                                                                                                
LISTEN 0       128            0.0.0.0:33063        0.0.0.0:*     users:(("rpc.mountd",pid=430,fd=13))                                                                                       
LISTEN 0       128          127.0.0.1:3306         0.0.0.0:*     users:(("mysqld",pid=763,fd=22))                                                                                           
LISTEN 0       50             0.0.0.0:139          0.0.0.0:*     users:(("smbd",pid=1237,fd=35))                                                                                            
LISTEN 0       5              0.0.0.0:5900         0.0.0.0:*     users:(("vncserver-x11-c",pid=424,fd=10))                                                                                  
LISTEN 0       64                [::]:35503           [::]:*                                                                                                                                
LISTEN 0       128               [::]:111             [::]:*     users:(("rpcbind",pid=299,fd=6),("systemd",pid=1,fd=28))                                                                   
LISTEN 0       128               [::]:80              [::]:*     users:(("nginx",pid=449,fd=7),("nginx",pid=448,fd=7),("nginx",pid=447,fd=7),("nginx",pid=446,fd=7),("nginx",pid=445,fd=7)) 
LISTEN 0       128               [::]:37973           [::]:*     users:(("rpc.mountd",pid=430,fd=19))                                                                                       
LISTEN 0       128               [::]:22              [::]:*     users:(("sshd",pid=450,fd=4))                                                                                              
LISTEN 0       100              [::1]:8888            [::]:*     users:(("pigpiod",pid=348,fd=0))                                                                                           
LISTEN 0       10               [::1]:4700            [::]:*     users:(("cnid_metad",pid=439,fd=3))                                                                                        
LISTEN 0       50                [::]:445             [::]:*     users:(("smbd",pid=1237,fd=32))                                                                                            
LISTEN 0       64                [::]:2049            [::]:*                                                                                                                                
LISTEN 0       128               [::]:50849           [::]:*     users:(("rpc.mountd",pid=430,fd=11))                                                                                       
LISTEN 0       20                   *:548                *:*     users:(("afpd",pid=438,fd=4))                                                                                              
LISTEN 0       128               [::]:54825           [::]:*     users:(("rpc.mountd",pid=430,fd=15))                                                                                       
LISTEN 0       50                [::]:139             [::]:*     users:(("smbd",pid=1237,fd=33))                                                                                            
LISTEN 0       5                 [::]:5900            [::]:*     users:(("vncserver-x11-c",pid=424,fd=9))    

Most of my networking services rpcbind nginx rpc.mountd sshd smbd vncserver listen on both IP4 & IP6

pigpiod seems to listen only on IP6 but I can't even seem to access it over IP6

I must admit IP6 is still a strange beast to me. None of the ISP support it, but both my P4 and iMac are directly connected to the same IP6 enabled switch and I can ping my Pi4 over IP6 although my router (and DHCP server) is IP4 only

~$ ping6 -c1 MilliwaysPi4.local
PING6(56=40+8+8 bytes) fe80::1024:466f:2446:8598%en0 --> fe80::e67f:ed81:a435:79de%en0
16 bytes from fe80::e67f:ed81:a435:79de%en0, icmp_seq=0 hlim=64 time=0.410 ms

I have tried all the following without success

pi = pigpio.pi('fe80::e67f:ed81:a435:79de%en0')
pi = pigpio.pi('MilliwaysPi4.local')
pi = pigpio.pi('MilliwaysPi4')
pi = pigpio.pi('10.1.2.74')
pi = pigpio.pi('fe80::e67f:ed81:a435:79de')

My questions are :-
1. How can I get pigpiod to listen on IP4?
2. How can I connect to pigpiod on IP6?

I suppose I could just take the brute force approach and disable IP6.

  • Specifically pigpiod is listening on loopback ipv6 (::1), equivalent to 127.0.0.1 a few other services are listening on all ipv6 interfaces (::), equivalent to 0.0.0.0. It should be reachable locally or via ssh port forwarding or what have you. – crasic Oct 10 '19 at 1:24
  • 2
    The most logical reason why pigpiod is on ipv6 is because it failed to open the configured ipv4 port. – crasic Oct 10 '19 at 1:26
2

It does not matter if it binds to ip4 or ip6. If you run raspi-config, the interfacing options will allow you to enable or disable remote connection to gpio server. The actual unit script is fine and does not need to be changed.

2

Thanks to crasic, I realised that pigpiod was only listening on the local interface.

When restarted manually with sudo pigpiod it seemed to start working!

This raises another question; I had set to start pigpiod on boot with systemctl enable pigpiod.

On listing /lib/systemd/system/pigpiod.service I discovered this was set to Disable remote socket interface.

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

I am not sure where this came from. The file is dated 2019-01-25 and appears to be identical to the version on my Pi3 running Stretch (pigpio 1.64-1), although this was a fresh install of Buster, which has AFAIK has pigpiod pre-installed.

  • These scripts are contributed by the Foundation as part of their remote GPIO work. They are a black art as far as I am concerned which is why I don't attempt to answer such questions. As @abolotnov says if you use raspi-config the proper invocations should be made. – joan Oct 10 '19 at 8:24
  • @joan Thanks for the comment. As usual it seems the Foundation has fiddled with something (but not documented it). It used to work with earlier releases. It is far from clear how the raspi-config setting would override the quite clear systemd service - even more WHY anyone would promulgate a service which disabled a fundamental capability of pigpio! I will "fix" the service, regardless of the Foundation kludge, – Milliways Oct 10 '19 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.