2021-05-30, 04:57 PM
(2021-05-30, 07:07 AM)Kris Wrote: Thank you so much for your help! I will be back with the results on the PWM clutch soon.It is normal for the switch to short at end of travel. You should short the pin to gnd so it goes low when the switch is closed and the internal pullup keeps it high when open. i'm not sure how you wired it, but I don't think you want to change the code since there are not internal pulldowns, or at least you are complicating the design with external resistors.
I am pairing this Pypilot installation with the Neco drive that already has built-in end switches and a rudder position potentiometer. The end switches short out when the end of travel is reached, so they work just the other way than your code was written. I have deleted the exclamation mark in your code as follows:
Altered code:re
Unless you mean your switch is normally closed and only opens at end of travel??
(2021-05-30, 04:18 PM)Kris Wrote: Traceback (most recent call last):
File "/usr/local/bin/pypilot_client", line 11, in <module>
load_entry_point('pypilot==0.16', 'console_scripts', 'pypilot_client')()
File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/client.py", line 383, in main
msg = client.receive_single(.1)
File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/client.py", line 207, in receive_single
line = self.receive_line(timeout)
File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/client.py", line 172, in receive_line
return self.receive_line(timeout - dt)
File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/client.py", line 158, in receive_line
raise Exception('invalid message from server:', line)
Exception: ('invalid message from server:', 'invalid request: set unknown value: servo.clutch_pwm')
Uninstalling and reinstalling Pypilot did not solve the issue.
You have to run "sudo python3 setup.py install" twice