New Setup For Jessie PIGPIO?

Moderator: Steve

New Setup For Jessie PIGPIO?

Postby alanmcdonley » Tue Jun 21, 2016 3:57 am

I had a microSD card failure, so rebuilt my bot OS last night.

I'm getting an error in a routine which worked before:

The error:
Code: Select all
python center.py
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Can't connect to pigpio at localhost(8888)

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

Did you specify the correct Pi host/port in the environment
variables PIGPIO_ADDR/PIGPIO_PORT?
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))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Traceback (most recent call last):
  File "center.py", line 37, in <module>
    center_servos()
  File "center.py", line 28, in center_servos
    PDALib.servoWrite(TILTSERVO, TiltCenter)
  File "/home/pi/RWPi/PDALib.py", line 251, in servoWrite
    pi.set_servo_pulsewidth(servopin[pin], val)
  File "/usr/lib/python2.7/dist-packages/pigpio.py", line 1320, in set_servo_pulsewidth
    self.sl, _PI_CMD_SERVO, user_gpio, int(pulsewidth)))
  File "/usr/lib/python2.7/dist-packages/pigpio.py", line 848, in _pigpio_command
    sl.s.send(struct.pack('IIII', cmd, p1, p2, 0))
AttributeError: 'NoneType' object has no attribute 'send'
pi@raspberrypi:~/RWPi $


I installed pigpio differently:
Code: Select all
* Install PIGPIO
sudo apt-get update
sudo apt-get install pigpio python-pigpio python3-pigpio


Before, with Wheezy, I installed pigpio thus:
Code: Select all
wget abyz.co.uk/rpi/pigpio/pigpio.zip
unzip pigpio.zip
cd PIGPIO
make
make install
Last edited by alanmcdonley on Tue Jun 21, 2016 8:46 am, edited 2 times in total.
alanmcdonley
 
Posts: 90
Joined: Thu Jul 23, 2015 10:50 am
Location: Boynton Beach, Florida

Re: New Setup For Jessie PIGPIO?

Postby alanmcdonley » Tue Jun 21, 2016 4:31 am

This fixed it, but I did not have to do this before:

sudo pigpiod

What do I need to do to get the demon to start automatically? I read that we don't need sudo for pigpio anymore, but I didn't pay much attention at the time.
Last edited by alanmcdonley on Tue Jun 21, 2016 8:47 am, edited 1 time in total.
alanmcdonley
 
Posts: 90
Joined: Thu Jul 23, 2015 10:50 am
Location: Boynton Beach, Florida

Re: New Setup For Jessie PIPGPIO?

Postby mikronauts » Tue Jun 21, 2016 7:32 am

Easiest way is to use cron, with an @boot option, see

http://www.raspberrypi-spy.co.uk/2013/0 ... sing-cron/
mikronauts
 
Posts: 119
Joined: Tue Sep 16, 2014 6:58 pm


Return to Pi Droid Alpha

Who is online

Users browsing this forum: No registered users and 1 guest

cron