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
Pypilot version 0.33
#1
Hi, I am running OpenCPN version 5.6.0 on a Pi4.  This installs a very old version of Pypilot (0.16) which will not communicate with the Pypilot Plugin.  So I upgraded Pypilot to the latest version using the excellent Pypilot Workbook as a guide.  The installation all seemed to go OK.  After a reboot, I tried the Pypilot Plugin, but no connection.  I used systemctl to see if the pypilot service was running but it had stopped:
pi@openplotter:~ $ systemctl status pypilot

● pypilot.service - pypilot
   Loaded: loaded (/etc/systemd/system/pypilot.service; enabled; vendor preset: 
   Active: activating (auto-restart) (Result: exit-code) since Mon 2022-01-03 18
  Process: 16155 ExecStart=/usr/local/bin/pypilot (code=exited, status=1/FAILURE
 Main PID: 16155 (code=exited, status=1/FAILURE)

So I ran pypilot from the prompt and got several errors that I do not understand.  Can anyone please point me in the right direction?
Many thanks
David

pi@openplotter:~ $ pypilot
autopilot start 1616.608142654
ERROR loading wind.py cannot import name 'HeadingOffset' from 'pypilot.autopilot' (/usr/local/lib/python3.7/dist-packages/pypilot/autopilot.py)   cannot import name 'HeadingOffset' from 'pypilot.autopilot' (/usr/local/lib/python3.7/dist-packages/pypilot/autopilot.py)
imu process 9036
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
nmea process 9040
listening on port 20220 for nmea connections
gps process 9043
Available Pilots: ['basic', 'absolute', 'simple']
warning: failed to open special file /dev/watchdog0 for writing
         cannot stroke the watchdog
made imu process realtime
Using settings file RTIMULib.ini
Settings file RTIMULib.ini loaded
Detected MPU9250/MPU9255 at standard address
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 9048
failed to load pypilot.conf not enough values to unpack (expected 2, got 1)
server setup has 5 pipes
autopilot init complete 1616.801705726
servo probe ('/dev/ttyAMA0', 38400) 1616.804768954
Process Process-6:
Traceback (most recent call last):
  File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.7/dist-packages/pypilot/server.py", line 408, in run
    self.init()
  File "/usr/local/lib/python3.7/dist-packages/pypilot/server.py", line 466, in init
    from zeroconf import IPVersion, ServiceInfo, Zeroconf
ImportError: cannot import name 'IPVersion' from 'zeroconf' (/usr/lib/python3/dist-packages/zeroconf.py)
Traceback (most recent call last):
  File "/usr/local/bin/pypilot", line 11, in <module>
    load_entry_point('pypilot==0.33', 'console_scripts', 'pypilot')()
  File "/usr/local/lib/python3.7/dist-packages/pypilot/autopilot.py", line 450, in main
    ap.iteration()
  File "/usr/local/lib/python3.7/dist-packages/pypilot/autopilot.py", line 353, in iteration
    time.sleep(pd10)
  File "/usr/local/lib/python3.7/dist-packages/pypilot/autopilot.py", line 195, in cleanup
    raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
closing autopilot
Reply
#2
It looks like this is caused by an oversight in a commit to the github that was made a few days ago. This can be expected to be solved soon, but in the meantime you might try checking out an older commit, e.g.
 
Code:
git checkout 07a3397

I cannot test this right now though, so it's a bit of a long shot for both me and you. I made an issue in github for this to be looked into.
Reply
#3
Somehow I didn't check a file in... it should be fixed in git now, but it won't be able to autodiscover based on the error you posted. what do you get from:

python3 -m pip freeze| grep zeroconf
Reply
#4
Hi, many thanks for your help.
I get: zeroconf==0.21.3
Reply
#5
I did the Pypilot update again and version 0.33 now works fine!
Many thanks for your help.
Reply
#6
I see, I have zeroconf==0.24.4

I will check the version in dependencies script, but at least pypilot will run without it now.
Reply
#7
Still one small problem: the OpenCPN Pypilot Plugin works fine connected to 127.0.0.1, but the Watchdog plugin (I have installed the latest version 2.4.39.0) does not seem to connect and I just get a Pypilot No connection alarm.
Many thanks
David
Reply
#8
(2022-01-05, 10:31 PM)drbarritt Wrote: Still one small problem:  the OpenCPN Pypilot Plugin works fine connected to 127.0.0.1, but the Watchdog plugin (I have installed the latest version 2.4.39.0) does not seem to connect and I just get a Pypilot No connection alarm.
Many thanks
David

The watchdog plugin that is provided in the OpenCPN's PlugIn Manager is an old version that does not connect to current pypilots. You can compile the watchdog plugin from github, but that watchdog gives an error in the opencpn log. For now it does not seem to be possible to use watchdog for pypilot.
Reply
#9
(2022-01-05, 11:07 PM)ironman Wrote:
(2022-01-05, 10:31 PM)drbarritt Wrote: Still one small problem:  the OpenCPN Pypilot Plugin works fine connected to 127.0.0.1, but the Watchdog plugin (I have installed the latest version 2.4.39.0) does not seem to connect and I just get a Pypilot No connection alarm.
Many thanks
David

The watchdog plugin that is provided in the OpenCPN's PlugIn Manager is an old version that does not connect to current pypilots. You can compile the watchdog plugin from github, but that watchdog gives an error in the opencpn log. For now it does not seem to be possible to use watchdog for pypilot.

All understood. Many thanks again for all your help.
Reply
#10
(2022-01-05, 11:07 PM)ironman Wrote: ... You can compile the watchdog plugin from github, but that watchdog gives an error in the opencpn log. For now it does not seem to be possible to use watchdog for pypilot.

The issue with compiling the watchdog plugin seems to have been resolved. Thx to Sean.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)