EasyServo plugin not working for me.. any ideas?

Hi all.. trying to use EasyServo plugin, but not working, and no clue why...

  • Completed all prereqs as per instructions (enable i2c, edit pigpiod.service with -x -1, make sure pigpiod service is running)
  • tested service via pigs t command > got a numner (which is the good outcome)
    Servos not working (and no electric signal seen on pins with a tester)

Tested to update same pins via GPIO Control plugin (just to test pins were not fired), and they update fine (on/off)..

Any idea how may I troubleshoot?

Running Octoprint 1.6.1 via [octoprint-docker] image.

Thanks in advance,
ET

Are you running the container in privileged mode? Did you complete the nstructions on the host or container system?

Tks for the quick response..
a. Container is in privileged mode.. I think I had to do this for other plugin/capability at some months back:
image

b. Instructions were completed on the host... did I mess it up there?

Would this be of any value?

Apologies in advance for limited technical knowledge.. Learning as I go.

ET

Quick update. Tested the pigpiodd deamon via pigs:
e.g. pigs servo 13 1500 (from the host terminal)
and both servos move as expected... meaning all is good form a host perspective (I had my doubts).
So it is just a matter of access from the container I guess...
Guidance appreciated.
ET

No docker expert, so can't really advise - and I don't know how it acts in privileged mode - but I would suggest trying to test it out from inside the container. Generally most GPIO plugins are not tested on docker containers - and if you don't need to run it from docker, then personally I wouldn't, to save the extra effort.

Thanks @Charlie_Powell.
I do need the docker as I run other stuff on the same pi.Also an excuse to learn/experiment.. .Has been working great for 1-2 yrs now.. all other plugins have worked with little trouble, including some that manage Gpio pins in other ways (GPIO Control, PSU Control, and in eh past Octoprint-Enclosure).
Probably something specific to pigpiod in this case... Will experiment a bit with the container parameters, and let you guys know if I get somewhere (just for future reference).

Worst case I can go via mqtt publisher plugin to HomeAssistant (running on the same pi, separate container) and move the gpios form there... that does work, but I looe the clean UI of the Easy Servo plugin.

Thanks again.
ET

Tied a couple of changes to the container, but not much progress, but "always check the logs"...

2021-07-22 02:31:58,675 - octoprint.plugins.EasyServo - INFO - The libraryUsed is pigpio
2021-07-22 02:31:58,675 - octoprint.plugins.EasyServo - INFO - Initializing pigpio
2021-07-22 02:31:58,725 - octoprint.plugins.EasyServo - INFO - <pipio.pi host=localhost port=8888>
2021-07-22 02:31:58,725 - octoprint.plugins.EasyServo - INFO - There was an error initializing pigpio

and then:

2021-07-22 02:33:59,188 - octoprint.server.api - ERROR - Error while executing SimpleApiPlugin EasyServo
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/octoprint/server/api/__init__.py", line 158, in pluginCommand
    response = api_plugin.on_api_command(command, data)
  File "/usr/local/lib/python3.8/site-packages/octoprint/util/__init__.py", line 1941, in wrapper
    return f(*args, **kwargs)
  File "/octoprint/plugins/lib/python3.8/site-packages/EasyServo/__init__.py", line 668, in on_api_command
    currentX = self.width_to_angle(self.pi.get_servo_pulsewidth(self._settings.get_int(["GPIOX"])))
  File "/octoprint/plugins/lib/python3.8/site-packages/pigpio.py", line 1699, in get_servo_pulsewidth
    return _u2i(_pigpio_command(self.sl, _PI_CMD_GPW, user_gpio, 0))
  File "/octoprint/plugins/lib/python3.8/site-packages/pigpio.py", line 1025, in _pigpio_command
    sl.s.send(struct.pack('IIII', cmd, p1, p2, 0))
AttributeError: 'NoneType' object has no attribute 'send'
2021-07-22 02:33:59,724 - octoprint.server.api - ERROR - Error while executing SimpleApiPlugin EasyServo
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/octoprint/server/api/__init__.py", line 158, in pluginCommand
    response = api_plugin.on_api_command(command, data)
  File "/usr/local/lib/python3.8/site-packages/octoprint/util/__init__.py", line 1941, in wrapper
    return f(*args, **kwargs)
  File "/octoprint/plugins/lib/python3.8/site-packages/EasyServo/__init__.py", line 668, in on_api_command
    currentX = self.width_to_angle(self.pi.get_servo_pulsewidth(self._settings.get_int(["GPIOX"])))
  File "/octoprint/plugins/lib/python3.8/site-packages/pigpio.py", line 1699, in get_servo_pulsewidth
    return _u2i(_pigpio_command(self.sl, _PI_CMD_GPW, user_gpio, 0))
  File "/octoprint/plugins/lib/python3.8/site-packages/pigpio.py", line 1025, in _pigpio_command
    sl.s.send(struct.pack('IIII', cmd, p1, p2, 0))
AttributeError: 'NoneType' object has no attribute 'send'

And finally on shutdown:

2021-07-22 02:38:30,523 - octoprint.server - INFO - Shutting down...
2021-07-22 02:38:30,975 - octoprint.server - INFO - Calling on_shutdown on plugins
2021-07-22 02:38:30,979 - octoprint.events - INFO - Processing shutdown event, this will be our last event
2021-07-22 02:38:30,986 - octoprint.events - INFO - Event loop shut down
2021-07-22 02:38:31,927 - octoprint.plugins.tracking - INFO - Sent tracking event shutdown, payload: {}
2021-07-22 02:38:31,928 - octoprint.plugins.EasyServo - INFO - There was an error on shutdown pigpio not connected
2021-07-22 02:38:32,936 - octoprint.server - INFO - Goodbye!

I guess the EasyServo is failing to access pigpiod outside the container, or trying to fire it's own copy? beyond my paygrade...

Hello,

I am absolutely not familiar with Docker, but what if you listen on another port ? 8888 is the default one, maybe try 8889 ?

from: pigpio library

Tks FranFran.. the thing is pigpiod is running perfectly fine on the host. I can move the servos with no issues either from a host terminal (via pigs) or from HomeAssistant/ NodeRed (running on its own docker container on the same host).. So I am thinking the problem must be in the way EasyServo expects to see/access pigpiod.. Probably simply not intended to work with docker at this stage. And I see no way of customizing that.
Raised an issue on the EasyServo repository, just is case the developer is interested in addressing it.

ET