This gives 'socket connection failure' error whether logged on as pi or as the new user.You could check that by entering the command pigs pigpv at the command line when logged in as the user.
Yes. As but stated above, user pi has no problem in Scratch, the new user does, so strange that both users get the error with the pigs pigspv command.How are you accessing the daemon? Is it via scratch?
By way of experiment I've added the new user to group 'pi' and group 'sudo'. When logged on as the new user, even with this new status, running Scratch does not start the pigpiod daemon and the Scratch error described in the first post is obtained. Then, if the daemon is run by 'sudo pigpiod' in a terminal window prior to running Scratch, running my Scratch program still generates a crash and the Smalltalk error.If it doesn't the problem may be that the user needs to have sudo permissions to start the daemon. That might also explain the scratch failure, as scratch will try to start the daemon and presumably will also fail if the user doesn't have sudo permissions.
Strictly speaking isn't Scratch that tries to start the daemon, but the surrounding shell script.iw1 wrote:When logged on as this new user, just as before, Scratch doesn't start pigpiod and running the Scratch program trying to access the pins gives the error "...No connection to pigpiod daemon is missing ..." as first described above.
However this time, still logged on as the new user, if pigpiod is started in a terminal window with 'sudo pigpiod', subsequently running the Scratch program works without errors. I can't reproduce the fatal crash out of Scratch.
Code: Select all
sudo nano /usr/bin/scratch
But it would seem from the things I have tried that pigpiod can only be used (started?) by members of group sudo; not what I was hoping for. Is there a reason why non-sudoers are excluded? Is there a way round this? If not it's probably best for me to stick to user pi.As far as the pigpio daemon is concerned the user (and groups) are irrelevant.
You shouldn't touch Scratch's configuration.iw1 wrote:Thanks again for the help. I'll give that a try when I get chance. I've noticed that there are some lines in the /usr/bin/scratch file that relate to starting and conditionally stopping pigpiod as sudo so I suspect I won't get things right first time. More learning to do, but that's what this is all about. Again thanks.