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 setup procedure?
#1
I’ve spent many hours going around in circles so am looking for a bit of guidance. I’ve followed ironman’s workbook which should automatically connect Pypilot to Signal k but that does not appear to be the case. Then I added the connections manually as shown in the screen grab. Still nothing. Is there a more up to date doc I could reference?  I have Pypilot installed on an rpi4. Sean’s MPU-9255 board is detected by Pypilot. Roll pitch and yaw are not available in any of the Signal K webapp widgets. What am I missing?

   
Reply
#2
Looks good from here... Is mdns switched on in the signalk server settings? Run pypilot at the prompt (step 8) and post a file with the console output. I haven't gotten to signalk yet in a detailed step yet, but if you share the details of what you got I'll write one. Also figure out the pypilot engine version (end of step 7). The one provided with openplotter is really old. Update and restart signalk; capture the signalk server log. Also show the Signalk dashboard.
Reply
#3
Here's a concept narrative; I'll add it to the Pypilot Workbook (formerly known as Pypilot for Dummies) in a minute:
Reply
#4
@ironman
Are mdns and zeroconf needed when you use OpenPlotter and the direct connection to SignalK?
That should be the method you use when you use TinyPilot.

I get the idea that the OpenPlotter way of connecting to SignalK predates the TinyPilot connection by at least a year.
It looks like a different type of connection to me.

Correct me if I'm wrong but I get the impression openplotter-pypilot uses some deamon-like script which uploads the pypilot data directly to SignalK in the background.
Reply
#5
You are right; the nmea/20220 method is older than the signalk/3000 method. They work on both {openplotter,tinypilot} distributions, though, if pypilot is updated to the latest version, which I think it needs to be, at least for the OpenCPN plugin to work. I would not call it the tinypilot connection, but if you would recommend that method for the tinypilot, I would not disagree with you.

With regard to that script - thank you! - I had seen it in the past but it got lost in my effort to make one coherent story out of it all. Expect some updates in the workbook; i'll make a release note in the dummies thread when I'm there.
Reply
#6
(2021-03-19, 04:23 PM)ironman Wrote: You are right; the nmea/20220 method is older than the signalk/3000 method. They work on both {openplotter,tinypilot} distributions, though, if pypilot is updated to the latest version, which I think it needs to be, at least for the OpenCPN plugin to work. I would not call it the tinypilot connection, but if you would recommend that method for the tinypilot, I would not disagree with you.

With regard to that script - thank you! - I had seen it in the past but it got lost in my effort to make one coherent story out of it all. Expect some updates in the workbook; i'll make a release note in the dummies thread when I'm there.

I updated the Pypilot Workbook with a piece on the illusive openplotter background script, and removed some of my posting above, as not to leave contradicting messages.
Reply
#7
The openplotter-pypilot background script to translate pypilot with signalk should go away now that pypilot directly supports signalk. This script only translated a few keys in one direction.
Reply
#8
Ironman, the high level functional overview is super helpful for beginners so thanks a million for that and the workbook. I’ve followed your updated process. Enabled mdns but there’s no access request to approve. If I understand things correctly I shouldn’t need to manually add the connections in Pypilot if I’m using mdns but I tried it both ways and nothing. I then attempted to update Pypilot as shown in step 7 but “python setup.py build” returned a request to update python to version 3. I got it updated by blindly following a process I googled but now I get a file not found error shown in the screen grab. Below that is the terminal dump from before I tried updating Pypilot. I’m so far in the weeds  Big Grin

   

pi@openplotter:~ $ pypilot
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
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
Loaded Pilots: ['learning', 'basic', 'absolute', 'simple', 'wind']
warning: failed to open special file /dev/watchdog0 for writing
         cannot stroke the watchdog
connected to gpsd
autopilot failed to read imu at time: 1616175732.210111
I2C read error from 12, 16 - Failed to read compass fuse ROM
ERROR: IMU Init Failed, no inertial data available
autopilot failed to read imu at time: 1616175732.380395
autopilot failed to read imu at time: 1616175732.5212145
autopilot failed to read imu at time: 1616175732.661924
autopilot failed to read imu at time: 1616175732.8027282
autopilot failed to read imu at time: 1616175732.944327
autopilot failed to read imu at time: 1616175733.08571
autopilot failed to read imu at time: 1616175733.2271347
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: 1616175733.3687413
autopilot failed to read imu at time: 1616175733.5101938
I2C read error from 12, 16 - Failed to read compass fuse ROM
ERROR: IMU Init Failed, no inertial data available
autopilot failed to read imu at time: 1616175733.6516252
autopilot failed to read imu at time: 1616175733.7929516
autopilot failed to read imu at time: 1616175733.9345188
pypilot_server: bind failed; already running a server?
nmea ready for connections
nmea_bridge: bind failed.
got signal 17 cleaning up
Traceback (most recent call last):
  File "/usr/local/bin/pypilot", line 11, in <module>
got signal 15 cleaning up
got signal 15 cleaning up
Process gpsProcess-5:
    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
Process Process-3:
got signal 15 cleaning up
Process Process-1:
got signal 15 cleaning up
connect failed to localhost:21311
    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
Process Process-2:
    self.iteration()
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/autopilot.py", line 320, in iteration
    time.sleep(self.boatimu.period/10)
  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 atexit cleaning up
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 85, in imu_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/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/server.py", line 209, in HandleRequests
    self.server_socket.bind(('0.0.0.0', self.port))
OSError: [Errno 98] Address already in use

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/pipeserver.py", line 146, in pipe_server_process
    server.HandleRequests()
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/server.py", line 212, in HandleRequests
    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
got signal 17 cleaning up
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
Traceback (most recent call last):
  File "/usr/lib/python3.7/multiprocessing/popen_fork.py", line 28, in poll
  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 66, in gps_process
    self.read(pipe)
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/gpsd.py", line 39, in read
    gpsdata = self.gpsd.next()
  File "/usr/local/lib/python3.7/dist-packages/gps/gps.py", line 301, in next
    return self.__next__()
  File "/usr/local/lib/python3.7/dist-packages/gps/gps.py", line 292, in __next__
    if self.read() == -1:
  File "/usr/local/lib/python3.7/dist-packages/gps/gps.py", line 281, in read
    status = gpscommon.read(self)
  File "/usr/local/lib/python3.7/dist-packages/gps/client.py", line 115, in read
    frag = self.sock.recv(8192)
    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
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/autopilot.py", line 107, in cleanup
KeyboardInterrupt
    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/calibration_fit.py", line 589, in CalibrationProcess
    client = pypilotClient(on_con, 'localhost', autoreconnect=True)
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.16-py3.7-linux-armv7l.egg/pypilot/client.py", line 98, in __init__
    connection.connect((host, port))
  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
Reply
#9
You're so close ;-) My bad. Try this, mind the 3 in python3, two times. I already changed this in the step 7.

Code:
cd pypilot
python3 setup.py build
sudo python3 setup.py install
Reply
#10
Oh yeah, even I could have maybe, eventually figured out that error. The python3 commands executed.  No change in Pypilot’s access to imu. I’m not getting an access control request. When I make the connections manually in Pypilot they show up in Signal K but now there’s a new error. See screen shot. Terminal dump is without the connections added in Pypilot. 

   

pi@openplotter:~ $ pypilot
imu process 1926
nmea process 1931
listening on port 20220 for nmea connections
loading servo calibration /home/pi/.pypilot/servocalibration
gps process 1933
WARNING: using default servo calibration!!
Loaded Pilots: ['learning', '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 1937
failed to load /home/pi/.pypilot/pypilot.conf not enough values to unpack (expected 2, got 1)
backup data failed as well not enough values to unpack (expected 2, got 1)
server setup has 5 pipes
I2C read error from 12, 16 - Failed to read compass fuse ROM
ERROR: IMU Init Failed, no inertial data available 136.62964182
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.24-py3.7-linux-armv7l.egg/pypilot/boatimu.py", line 128, in process
    data = self.read()
  File "/usr/local/lib/python3.7/dist-packages/pypilot-0.24-py3.7-linux-armv7l.egg/pypilot/boatimu.py", line 158, in read
    if not self.rtimu.IMURead():
AttributeError: 'IMU' object has no attribute 'rtimu'
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 324, in iteration
    time.sleep(pd10)
  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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)