starting pigpiod fails with:
Code: [Select]
sudo pigpiod
2020-07-28 20:37:00 initInitialise: bind to port 8888 failed (Address already in use)
pi@thunder:~ $ Can't initialise pigpio library
Are you still seeing this error?
Can you also run ‘sudo python3 as3935_pigpio_test_X.py’ from the Sensors directory with ‘X’ as the socket you have the Thunder Click board plugged into (1 or 2) and post the output in a message.
The empty nowcast.json file suggests that the monitor is/has been running but as it’s not getting any data from the sensor the file is empty.
ahh, sorry my bad…
Yes, still that error from pigiod
The output of test:
Test starting
Good version of pigpio found - Version 77
Register 0x00 is 0x24
Register 0x01 is 0x01
Register 0x02 is 0xC2
Register 0x03 is 0xC0
Register 0x04 is 0x00
Register 0x05 is 0x00
Register 0x06 is 0x00
Register 0x07 is 0x01
Register 0x08 is 0x0A
Test complete
This is all on a Pi3 with Buster lite installed
no full raspberry pi OS
no pigpiod.service
no pigpiod service after manual install
in "/run/pigpio_spi_handles" there was only a zero, so I did stop every service and deleted the file
then started pigpiod and the monitor service the zero was back there
in the zero was the number 2975
pinto and Asobig - can you please try the following…
‘sudo nano /lib/systemd/system/pigpiod.service’.
Put this into the file and then save it…
[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
‘sudo systemctl daemon-reload’
‘sudo systemctl enable pigpiod.service’
‘sudo systemctl start pigpiod.service’
‘sudo systemctl restart as3935_monitor.service’
‘sudo systemctl restart as3935_web.service’
I still don’t understand why the pigpiod service unit file isn’t being created but this should get you going whilst I investigate further. Worst case I’ll create the unit file in the installer but I don’t understand why installing pigpio doesn’t create the unit file for you but it does for me.
pinto - depending on the state of the various services it is correct that there can be number files in /run/pigpio_spi_handles where the file contains a process number. If you try ‘ps ax | grep ’ where <process_number> is the value from one of the number files you should see which process has which SPI handle open. I’ve had to build in some extra coding because SPI handles weren’t being tidied up cleanly when processes got killed/died unexpectedly and the number files are part of the cleanup process.
I’m part way there to fixing the problem with the pigpiod.service file being missing. I now know why but still need to figure out how to make it available for everyone.
The first part of the puzzle was caused by a combination of a misunderstanding and a difference. I discovered pigpio whilst trying to work out how to program the AS3935 sensor. It seemed to do what I wanted so I installed the version compatible with my Pi4B. What I’d misunderstood was that pigpio is already included in some Raspberry Pi OS (and Raspbian OS) builds. I now know that it is included in the ‘Desktop plus recommended software’ build that I use and that it isn’t included in the Lite build. I’m not sure if it’s in the ‘Desktop (without recommended software)’ build. So in reality I had installed pigpio on top of an existing version. That’s where the difference came in. The pre-installed version includes the pigpiod.service file but when you build the software to install for yourself the file isn’t included. So my Pi had the pigpiod.service file from the build and the updated software from my own installation. The AS3935 installers only do the second part of this, i.e. build pigpiod, and when run on a Pi OS build that doesn’t include pigpiod it doesn’t have the service file.
I don’t know why the pre-installed and self-built versions differ, but my next job is to figure out how to fix the problem. I initially thought that would be simple, but this morning I’ve discovered that the pre-installed and built versions of pigpiod end up in different directories so there isn’t a ‘one size fits all’ service file that I can include in the installer. I’ll figure it out but I need some breakfast and a good old mug of British tea inside me first!
I think you should be OK with a restart. The fix you applied before the re-install is still there and that’s what’s allowing it to work.
I’m just about to do an install of v3.1 onto a fresh OS build to test it before releasing. It should solve the pigpiod.service problems you and others have seen and I’ve also modified the installer and other scripts to use a command line parameter for the Thunder Click socket number to reduce the number of files needed by 3. Once I’ve tested the new version I’ll upload and modify the installation instructions.
My Pi is still upgrading (56% now) so I’ll be able to test v3.1 soon and hopefully that will fix the problem at source rather than trying to put sticking plasters onto it.
I’ve installed v3.1 and it worked on first install and after a reboot. I have to go out to an appointment now but I’ll upload the new version and update the docs when I return.
I’ve updated the top message in this thread to remove the v3.0 files and add the v3.1 files.
I’ve also changed the instructions. They are subtly different so please read them carefully and don’t repeat the previous installation process because it may not work properly, especially if your Thunder Click board is plugged into socket 2!