I've written some python code using pigpio over a network. I have two questions I can't seem to solve myself:

  • Can I change the timeout when calling the pigpidaemon with pigpio.pi(<ip number>). Sometimes the computer I call is unavailable and the default timeout is very long.

  • Can I prevent the below message from being printed on stdout?

Can't connect to pigpio at alll(8888)

Did you start the pigpio daemon? E.g. sudo pigpiod

Did you specify the correct Pi host/port in the environment
E.g. export PIGPIO_ADDR=soft, export PIGPIO_PORT=8888

Did you specify the correct Pi host/port in the
pigpio.pi() function? E.g. pigpio.pi('soft', 8888)

bumped to the homepage by Community yesterday

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

  • 1
    Perhaps check that the computer is "up" before calling pigpio.pi(). Try a ping or something similar. – joan Aug 13 '17 at 20:41
  • I do two different tasks with these calls. First I scan the whole network for computers running pigpiod, there ping wont work. When I then know which computers run pigpiod I call them to control pins, there I could definitely use ping! Thanks! :-) – MagnusT Aug 14 '17 at 7:17
  • 1
    Possible duplicate of Try & Except fail to catch OSError – Brick Jun 14 at 13:07

for second part of your questions- the answer is "No".

see joans answer, in similar Q of mine

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.