This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Updated pypilot to latest git and getting errors form pypilot_servo
#11
I tried with and without using the software upgrade. This morning I tried again with the upgrade during setup and was met with a gpsd error. It looked like it was having trouble adding users from what I recall. I am able to get the calibration screens to work in compass only with no problems. When GPS is enabled, it disconnects every couple seconds and then reconnects.
Reply
#12
Today, on a fresh SD card I installed a new copy of 2020-12-16-OpenPlotter-v2-Headless-img. After install I did the recommended update, then I went through the process of updating to the current git version of pypilot.

After calibrating the accelerometer, then setting the boat's alignment all seemed to be working as expected up until this point, so I added the serial connection for the motor controller in the openplotter-serial settings and added it to pypilot. At this point I noticed the pypilot server process cycling, the control clients would connect breifly, show updates for a split second, then hang for a few seconds then zero out, then again show updates for a split second ... repeating on and on.

In /var/log/syslog I see:

May 14 12:50:42 openplotter systemd[1]: Stopped pypilot.
May 14 12:50:42 openplotter systemd[1]: Started pypilot.
May 14 12:50:42 openplotter signalk-server[1865]: TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
May 14 12:50:45 openplotter signalk-server[1865]: TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
May 14 12:50:45 openplotter signalk-server[1865]: TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
May 14 12:50:45 openplotter signalk-server[1865]: TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
May 14 12:50:45 openplotter signalk-server[1865]: TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
May 14 12:50:46 openplotter systemd[1]: pypilot.service: Main process exited, code=exited, status=1/FAILURE
May 14 12:50:46 openplotter systemd[1]: pypilot.service: Failed with result 'exit-code'.
May 14 12:50:46 openplotter signalk-server[1865]: TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
May 14 12:50:47 openplotter signalk-server[1865]: TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
May 14 12:50:48 openplotter systemd[1]: pypilot.service: Service RestartSec=2s expired, scheduling restart.
May 14 12:50:48 openplotter systemd[1]: pypilot.service: Scheduled restart job, restart counter is at 98.
May 14 12:50:48 openplotter systemd[1]: Stopped pypilot.
May 14 12:50:48 openplotter systemd[1]: Started pypilot.
May 14 12:50:48 openplotter signalk-server[1865]: TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
May 14 12:50:51 openplotter signalk-server[1865]: TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
May 14 12:50:51 openplotter signalk-server[1865]: TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
May 14 12:50:51 openplotter signalk-server[1865]: TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
May 14 12:50:51 openplotter signalk-server[1865]: TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
May 14 12:50:52 openplotter systemd[1]: pypilot.service: Main process exited, code=exited, status=1/FAILURE
May 14 12:50:52 openplotter systemd[1]: pypilot.service: Failed with result 'exit-code'.
May 14 12:50:52 openplotter signalk-server[1865]: TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
May 14 12:50:53 openplotter signalk-server[1865]: TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
May 14 12:50:54 openplotter systemd[1]: pypilot.service: Service RestartSec=2s expired, scheduling restart.
May 14 12:50:54 openplotter systemd[1]: pypilot.service: Scheduled restart job, restart counter is at 99.
May 14 12:50:54 openplotter systemd[1]: Stopped pypilot.
May 14 12:50:54 openplotter systemd[1]: Started pypilot.


When I then stop the pypilot service, and run pypilot form the command line, it runs for a short while, then fails:

pi@openplotter:~ $ pypilot
imu process 6660
nmea process 6665
listening on port 20220 for nmea connections
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
made imu process realtime
Using settings file RTIMULib.ini
Settings file RTIMULib.ini loaded
Loaded Pilots: ['learning', 'basic', 'absolute', 'simple']
Detected MPU9250/MPU9255 at standard address
warning: failed to open special file /dev/watchdog0 for writing
cannot stroke the watchdog
gps process 6670
Using fusion algorithm Kalman STATE4
IMU Name: MPU-925x
min/max compass calibration not in use
Using ellipsoid compass calibration
Using accel calibration
pypilotServer process 6672
server setup has 5 pipes
server add socket ('127.0.0.1', 38462)
servo probe ('/dev/ttyAMA0', 38400) 3148.442749013
MPU-925x init complete
imu rate set to rate 20
read imu running too _slowly_ 0.051795058000152494 0.05
setting initial gyro bias [-1.051, -1.397, 1.083]
arduino servo found on ['/dev/ttyAMA0', 38400]
serialprobe success: /home/pi/.pypilot/servodevice ['/dev/ttyAMA0', 38400]
EEPROM SIGNATURE ok
Traceback (most recent call last):
File "/usr/local/bin/pypilot", line 11, in <module>
load_entry_point('pypilot==0.24', 'console_scripts', 'pypilot')()
File "/usr/local/lib/python3.7/dist-packages/pypilot-0.24-py3.7-linux-armv7l.egg/pypilot/autopilot.py", line 386, in main
ap.iteration()
File "/usr/local/lib/python3.7/dist-packages/pypilot-0.24-py3.7-linux-armv7l.egg/pypilot/autopilot.py", line 366, in iteration
self.servo.poll()
File "/usr/local/lib/python3.7/dist-packages/pypilot-0.24-py3.7-linux-armv7l.egg/pypilot/servo.py", line 670, in poll
self.clutch_pwm.set(self.driver.clutch_pwm)
File "/usr/local/lib/python3.7/dist-packages/pypilot-0.24-py3.7-linux-armv7l.egg/pypilot/arduino_servo/arduino_servo.py", line 102, in <lambda>
__getattr__ = lambda self, name: _swig_getattr(self, ArduinoServo, name)
File "/usr/local/lib/python3.7/dist-packages/pypilot-0.24-py3.7-linux-armv7l.egg/pypilot/arduino_servo/arduino_servo.py", line 80, in _swig_getattr
raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
AttributeError: 'ArduinoServo' object has no attribute 'clutch_pwm'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python3.7/multiprocessing/popen_fork.py", line 28, in poll
pid, sts = os.waitpid(self.pid, flag)
File "/usr/local/lib/python3.7/dist-packages/pypilot-0.24-py3.7-linux-armv7l.egg/pypilot/autopilot.py", line 169, in cleanup
raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
closing autopilot
terminate calibration process


If I then remove the motor controller device from openplotter-pypilot, I can then run pypilot from the command line and it will stay running. Or I can start the service and it will start once and not cycle as before. I've tried this with both an op device alias, as well as assigning the ttyAMA0 device directly from the pypilot settings, and it reacts the same way.
Reply
#13
I have just a few more days to fix my boat and managed to break it...   I should be able to deal with this today.   You can also check out a prior commit
Reply
#14
(2021-05-15, 02:08 PM)seandepagnier Wrote: I have just a few more days to fix my boat and managed to break it...   I should be able to deal with this today.   You can also check out a prior commit

Thanks Sean for looking into this, and the hint about a prior commit.

After running "git checkout 8aa04df928cd4293e960c13a7ad1c6b407832e32" (20 day old commit) in the pypilot source directory, then running the setup.py install  things seem to work as expected.
Reply
#15
I will try to work from unstable branch in the future
Reply
#16
Good tip. That specific commit you mention did not work for me and it was only about 12 days old. I was successful finally with commit 43ad7ed7c8585eee5b3b0e5c42cc9fd1109c0f90
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)