OpenMarine
Moitessier Hat GPS data, how to send to Pypilot_py - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: Pypilot (https://forum.openmarine.net/forumdisplay.php?fid=17)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=18)
+--- Thread: Moitessier Hat GPS data, how to send to Pypilot_py (/showthread.php?tid=2685)



Moitessier Hat GPS data, how to send to Pypilot_py - rastam4n - 2020-06-24

Hi there
I have a new install of OP2 using the img with Moitessier Hat package.
I have installed the pypilot_py plugin as per the git instructions
It is working ok, I can set the AP to hold a heading and it does that. 
I cannot switch to GPS mode, when I do Pypilot plugin switches from a connected state to a disconnected state. Then in a few seconds reverts back to Compass mode.
I have setup the connections in OpenCPN and signalK as per the instructions in the signalK documentation
I have GPS data in OpenCPN, as it shows my my position and the GPS signal bar shows green bars.


When i try to switch to GPS mode in pypilot plugin signalk shows this data 
Jun 24 14:42:28 GET /admin/fonts/fa-solid-900.55eb2a60e8181f0e68b558c991973bf0.woff2 304 13.715 ms - -
Jun 24 14:42:28 GET /appstore/available 304 741.096 ms - -
Jun 24 14:43:16 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Jun 24 14:43:16 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Jun 24 14:43:16 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Jun 24 14:43:16 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Jun 24 14:43:17 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Jun 24 14:43:18 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Jun 24 14:43:19 TcpProvider:connect ECONNREFUSED 127.0.0.1:20220
Jun 24 14:43:33 GET /admin/ 304 1.363 ms - -

any ideas why the is happening?




RE: Moitessier Hat GPS data, how to send to Pypilot_py - seandepagnier - 2020-06-26

You must post the output from pypilot log file. There are a few ways including:

$ sudo systemctl stop pypilot

Then run pypilot from command line:

$ pypilot

Make it crash and post the result.


RE: Moitessier Hat GPS data, how to send to Pypilot_py - rastam4n - 2020-06-26

(2020-06-26, 01:56 AM)seandepagnier Wrote: You must post the output from pypilot log file.   There are a few ways including:

$ sudo systemctl stop pypilot

Then run pypilot from command line:

$ pypilot

Make it crash and post the result.

Thanks Sean, see the output below. As soon as I switched from compass mode to GPS it crashed.


pi@openplotter:~ $ sudo systemctl stop pypilot
pi@openplotter:~ $ pypilot
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
Loaded Pilots: ['simple', 'learning', 'absolute', 'wind', 'basic']
warning: failed to open special file /dev/watchdog0 for writing
         cannot stroke the watchdog
Settings file RTIMULib.ini loaded
Using settings file RTIMULib.ini
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
autopilot failed to read imu at time: 1593183296.3804114
autopilot failed to read imu at time: 1593183296.5585127
MPU-925x init complete
arduino servo found on ['/dev/ttyAMA0', 38400]
serialprobe success: /home/pi/.pypilot/servodevice ['/dev/ttyAMA0', 38400]
nmea ready for connections
listening on port 20220 for nmea connections
setup wiatches True
EEPROM SIGNATURE ok
found gps on tcp socket1GN
Traceback (most recent call last):
  File "/usr/local/bin/pypilot", line 11, in <module>
    load_entry_point('pypilot==0.16', 'console_scripts', 'pypilot')()
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/autopilot.py", line 395, in main
    ap.run()
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/autopilot.py", line 214, in run
    self.iteration()
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/autopilot.py", line 335, in iteration
    pilot.compute_heading()
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/pilots/pilot.py", line 60, in compute_heading
    gps = resolv(compass + ap.gps_compass_offset.value, 180)
NameError: name 'resolv' is not defined
got signal atexit cleaning up
got signal 15 cleaning up
got signal 15 cleaning up
got signal 15 cleaning up
Process Process-1:
got signal 15 cleaning up
Process Process-3:
Process NmeaBridgeProcess-4:
Process gpsProcess-5:
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-0.16-py3.7-linux-armv7l.egg/pypilot/pipeserver.py", line 147, in pipe_server_process
    time.sleep(.1)
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/autopilot.py", line 107, in cleanup
    raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
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-0.16-py3.7-linux-armv7l.egg/pypilot/nmea.py", line 702, in process
    time.sleep(dt)
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/autopilot.py", line 107, in cleanup
    raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
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-0.16-py3.7-linux-armv7l.egg/pypilot/boatimu.py", line 154, in imu_process
    time.sleep(t)
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/autopilot.py", line 107, in cleanup
    raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/gpsd.py", line 28, in connect
    self.gpsd = gps.gps(mode=gps.WATCH_ENABLE) #starting the stream of info
  File "/usr/local/lib/python3.7/dist-packages/gps/gps.py", line 197, in __init__
    gpscommon.__init__(self, host, port, verbose, reconnect)
  File "/usr/local/lib/python3.7/dist-packages/gps/client.py", line 43, in __init__
    self.connect(self.host, self.port)
  File "/usr/local/lib/python3.7/dist-packages/gps/client.py", line 69, in connect
    self.sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

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-0.16-py3.7-linux-armv7l.egg/pypilot/gpsd.py", line 65, in gps_process
    self.connect()
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/gpsd.py", line 33, in connect
    time.sleep(3)
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/autopilot.py", line 107, in cleanup
    raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
got signal 17 cleaning up
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.16-py3.7-linux-armv7l.egg/pypilot/autopilot.py", line 107, in cleanup
    raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
got signal 15 cleaning up
Process Process-2:
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-0.16-py3.7-linux-armv7l.egg/pypilot/calibration_fit.py", line 618, in CalibrationProcess
    p = cal_pipe.recv(1)
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/pipeserver.py", line 36, in recv
    if self.pollin.poll(1000.0*timeout):
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/autopilot.py", line 107, in cleanup
    raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
closing autopilot
pi@openplotter:~ $


RE: Moitessier Hat GPS data, how to send to Pypilot_py - seandepagnier - 2020-06-28

You have pulled the latest git? I believe I fixed this, but if not, you might want to roll back to 0.12 for now.


RE: Moitessier Hat GPS data, how to send to Pypilot_py - rastam4n - 2020-06-28

(2020-06-28, 03:16 PM)seandepagnier Wrote: You have pulled the latest git?   I believe I fixed this, but if not, you might want to roll back to 0.12 for now.

Yep that is from the latest git. 
How do I roll back?