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 disconnected at startup - Steps toward troubleshooting?
#1
I have RPi 3B+ running openplotter 1.2 and sean's motor controller.  The autopilot worked successfully while testing, but I broke it sometime while adding a USB serial AIS receiver and changing around GPIO assignments for my panel control.

Now on boot, sensors are working but both the OpenCPN plugin and the openplotter pypilot autopilot control show "disconnected".  Restarting signal K does not help.  Changing /dev/ttyOP_ap assignment to none, apply, then back to pypilot brings autopilot control back to life.

How do I go after this?
Reply
#2
I suggest you try upgrading to openplotter 2.0, but this might cause other problems for you.

Maybe the pypilot service is not started? "ps aux pypilot" "systemctl status pypilot"

If it is running on boot you can check the serial port in ~/.pypilot/serial_ports to make sure the port is listed there.
Reply
#3
It seems I have a similar problem. However, I have these symptoms after some time. If I need to report it in a new post, please let me know.
I have the same setup, openplotter 1.2 and not ready to upgrade to 2 until it has all the features I need. By the way, I've done a clean install of 1.2 so there is no clutter.

About my autopilot problem:

All runs fine directly after boot-up, but after some time both OpenCPN and the webclient cannot find the Arduino.
Webclient SignalK connection is OK, but cannot find the motor controller.
In my case, also re-assigning the autopilot in serial connection fixes it, or rebooting the pi entirely.

I've even went so far as to try different Arduino's and different models (uno, nano) and all have the same behaviour.
I've tried the commands from your suggestion, but they report:


Code:
pi@openplotter:~ $ systemctl status pypilot
Unit pypilot.service could not be found.


Not sure what to do here, and how to get it stable again.
Reply
#4
are any other processes trying to use the serial port?

What does "journalctl -u pypilot" output?
Reply
#5
ps aux | grep pypilot shows two processes running
- pypilot_webapp 8080
- pypilot_control

systemctl status pypilot shows
Unit pypilot.service could not be found.

cat serial_ports shows
/dev/ttyOP_ap
(I notice on the openplotter serial page it appears as /dev/ttyOP_AMA.  Is this a problem?)

I couldn't find any entries in syslog. Do you log errors somewhere else?

Running from the console shows
Code:
pi@blue:~ $ python /usr/local/bin/pypilot
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
failed to open special file /dev/watchdog0 for writing:
autopilot cannot strobe the watchdog
connected to gpsd
Settings file not found. Using defaults and creating settings file
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
Accel calibration not in use
autopilot failed to read imu at time: 1585012430.11
servo probe... (u'/dev/ttyOP_ap', 38400)
arduino servo found on (u'/dev/ttyOP_ap', 38400)
serialprobe success: /home/pi/.pypilot/servodevice {u'path': u'/dev/ttyOP_ap', u'bauds': [38400]}
servo is running too _slowly_ 0.0625510215759
autopilot failed to read imu at time: 1585012430.31
MPU-925x init complete
nmea client connected
listening on port 20220 for nmea connections
Process NmeaBridgeProcess-5:
Traceback (most recent call last):
 File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
   self.run()
 File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
   self._target(*self._args, **self._kwargs)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/nmea.py", line 615, in process
   self.receive_nmea(line, msgs)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/nmea.py", line 434, in receive_nmea
   result = parser(line)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/nmea.py", line 63, in parse_nmea_gps
   speed = float(data[6])
ValueError: could not convert string to float:
got signal 17 cleaning up
Traceback (most recent call last):
got signal 15 cleaning up
 File "/usr/local/bin/pypilot", line 11, in <module>
   load_entry_point('pypilot==0.1', 'console_scripts', 'pypilot')()
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/basic_autopilot.py", line 108, in main
   ap.run()
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 180, in run
   self.iteration()
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 346, in iteration
Process Process-3:
   time.sleep(dt)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
Traceback (most recent call last):
   raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
 File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
got signal atexit cleaning up
got signal 15 cleaning up
   self.run()
got signal 15 cleaning up
 File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
   self._target(*self._args, **self._kwargs)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/boatimu.py", line 113, in imu_process
Process GpsProcess-4:
Traceback (most recent call last):
 File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
   time.sleep(t)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
   self.run()
 File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
   self._target(*self._args, **self._kwargs)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/gpsdpoller.py", line 62, in gps_process
   self.read(pipe)
   raise KeyboardInterrupt # to get backtrace on all processes
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/gpsdpoller.py", line 36, in read
   gpsdata = self.gpsd.next()
KeyboardInterrupt
 File "/usr/lib/python2.7/dist-packages/gps/gps.py", line 326, in next
Process Process-2:
Traceback (most recent call last):
   if self.read() == -1:
 File "/usr/lib/python2.7/dist-packages/gps/gps.py", line 312, in read
 File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
   status = gpscommon.read(self)
 File "/usr/lib/python2.7/dist-packages/gps/client.py", line 84, in read
   frag = self.sock.recv(4096)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
   self.run()
   raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
 File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
   self._target(*self._args, **self._kwargs)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/calibration_fit.py", line 438, in CalibrationProcess
got signal 17 cleaning up
got signal 15 cleaning up
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
 File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
Process Process-1:
Traceback (most recent call last):
 File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
   func(*targs, **kargs)
 File "/usr/lib/python2.7/multiprocessing/util.py", line 325, in _exit_function
   p = points.recv(1)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/signalk/pipeserver.py", line 35, in recv
   p.join()
   self.run()
 File "/usr/lib/python2.7/multiprocessing/process.py", line 145, in join
 File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
   self._target(*self._args, **self._kwargs)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/signalk/pipeserver.py", line 158, in pipe_server_process
   res = self._popen.wait(timeout)
 File "/usr/lib/python2.7/multiprocessing/forking.py", line 154, in wait
   time.sleep(.1)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
   return self.poll(0)
 File "/usr/lib/python2.7/multiprocessing/forking.py", line 135, in poll
   raise KeyboardInterrupt # to get backtrace on all processes
   pid, sts = os.waitpid(self.pid, flag)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
KeyboardInterrupt
   raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
Error in sys.exitfunc:
Traceback (most recent call last):
 File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
   func(*targs, **kargs)
 File "/usr/lib/python2.7/multiprocessing/util.py", line 325, in _exit_function
   p.join()
 File "/usr/lib/python2.7/multiprocessing/process.py", line 145, in join
   res = self._popen.wait(timeout)
 File "/usr/lib/python2.7/multiprocessing/forking.py", line 154, in wait
   return self.poll(0)
 File "/usr/lib/python2.7/multiprocessing/forking.py", line 135, in poll
   pid, sts = os.waitpid(self.pid, flag)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
   raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
   if self.pollin.poll(1000.0*timeout):
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
   raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
pi@blue:~ $
Reply
#6
(2020-03-24, 12:46 AM)seandepagnier Wrote: are any other processes trying to use the serial port?

What does "journalctl -u pypilot" output?

Code:
pi@openplotter:~ $ journalctl -u pypilot
-- No entries --

Code:
pi@openplotter:~ $ ps aux | grep pypilot
pi        1121  0.1  2.8  40944 26736 ?        Sl   11:11   0:13 /usr/bin/python /usr/local/bin/pypilot_webapp 8081
pi        1142  2.6  2.4  35144 22792 ?        S    11:11   5:01 /usr/bin/python /usr/local/bin/pypilot
pi        1202  0.9  1.8  35044 17404 ?        S    11:12   1:46 /usr/bin/python /usr/local/bin/pypilot
pi        1207  0.3  1.7  35044 16780 ?        S    11:12   0:37 /usr/bin/python /usr/local/bin/pypilot
pi        1210  1.3  1.8  35044 17524 ?        D    11:12   2:35 /usr/bin/python /usr/local/bin/pypilot
pi        1217  0.4  1.7  35044 17028 ?        S    11:12   0:52 /usr/bin/python /usr/local/bin/pypilot
pi        1218  0.4  1.8  35172 17852 ?        S    11:12   0:48 /usr/bin/python /usr/local/bin/pypilot
pi       14336  0.0  0.0   4368   536 pts/0    S+   14:24   0:00 grep --color=auto pypilot
Code:
pi@openplotter:~ $ python /usr/local/bin/pypilot
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
failed to open special file /dev/watchdog0 for writing:
autopilot cannot strobe the watchdog
connected to gpsd
Settings file not found. Using defaults and creating settings file
Using settings file RTIMULib.ini
Detected LSM9DS1 at standard/standard address
Using fusion algorithm Kalman STATE4
IMU Name: LSM9DS1
min/max compass calibration not in use
Using ellipsoid compass calibration
Accel calibration not in use
LSM9DS1 init complete
autopilot failed to read imu at time: 1585060023.64
busy, try again later {u'path': u'/dev/ttyOP_uno', u'bauds': [38400]} servo
busy, try again later {'path': '/dev/ttyOP_uno', 'bauds': [38400, 4800]} nmea0
nmea source for gps source gpsd 1585060023.71
busy, try again later {'path': '/dev/ttyOP_uno', 'bauds': [38400]} servo
signalk_server: bind failed, try again.
nmea client connected
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
   load_entry_point('pypilot==0.1', 'console_scripts', 'pypilot')()
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/basic_autopilot.py", line 108, in main
Process Process-1:
Process Process-3:
got signal 15 cleaning up
Traceback (most recent call last):
Traceback (most recent call last):
 File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
 File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
   ap.run()
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 180, in run
Process GpsProcess-4:
Traceback (most recent call last):
 File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
got signal 15 cleaning up
   self.run()
   self.run()
   self.run()
 File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
 File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
 File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
   self._target(*self._args, **self._kwargs)
   self._target(*self._args, **self._kwargs)
   self._target(*self._args, **self._kwargs)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/gpsdpoller.py", line 62, in gps_process
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/boatimu.py", line 113, in imu_process
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/signalk/pipeserver.py", line 157, in pipe_server_process
   self.iteration()
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 346, in iteration
   time.sleep(dt)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
Process Process-2:
Traceback (most recent call last):
   raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
 File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
got signal atexit cleaning up
   self.run()
 File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
   self.read(pipe)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/gpsdpoller.py", line 36, in read
   gpsdata = self.gpsd.next()
 File "/usr/lib/python2.7/dist-packages/gps/gps.py", line 326, in next
   self._target(*self._args, **self._kwargs)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/calibration_fit.py", line 438, in CalibrationProcess
   server.HandleRequests()
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/signalk/server.py", line 317, in HandleRequests
   if self.read() == -1:
 File "/usr/lib/python2.7/dist-packages/gps/gps.py", line 312, in read
   status = gpscommon.read(self)
 File "/usr/lib/python2.7/dist-packages/gps/client.py", line 84, in read
   time.sleep(1)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
   time.sleep(t)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
   raise KeyboardInterrupt # to get backtrace on all processes
   raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
KeyboardInterrupt
   frag = self.sock.recv(4096)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, 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/python2.7/atexit.py", line 24, in _run_exitfuncs
got signal 17 cleaning up
Error in sys.exitfunc:
Traceback (most recent call last):
 File "/usr/lib/python2.7/atexit.py", line 30, in _run_exitfuncs
   traceback.print_exc()
 File "/usr/lib/python2.7/traceback.py", line 233, in print_exc
   p = points.recv(1)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/signalk/pipeserver.py", line 35, in recv
   if self.pollin.poll(1000.0*timeout):
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
   print_exception(etype, value, tb, limit, file)
got signal 17 cleaning up

   raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
Reply
#7
(2020-03-24, 04:30 AM)AlanH Wrote: systemctl status pypilot shows
Unit pypilot.service could not be found.
In openplotter 1.2 pypilot is not really managed by systemd, so the loose collection of scripts in openplotter starts it and this causes issues. For openplotter 2.0 pypilot is managed as a system service and you can see the logs with journalctl.
Quote:Running from the console shows
Code:
pi@blue:~ $ python /usr/local/bin/pypilot
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
failed to open special file /dev/watchdog0 for writing:
autopilot cannot strobe the watchdog
connected to gpsd
Settings file not found. Using defaults and creating settings file
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
Accel calibration not in use
autopilot failed to read imu at time: 1585012430.11
servo probe... (u'/dev/ttyOP_ap', 38400)
arduino servo found on (u'/dev/ttyOP_ap', 38400)
serialprobe success: /home/pi/.pypilot/servodevice {u'path': u'/dev/ttyOP_ap', u'bauds': [38400]}
servo is running too _slowly_ 0.0625510215759
autopilot failed to read imu at time: 1585012430.31
MPU-925x init complete
nmea client connected
listening on port 20220 for nmea connections
Process NmeaBridgeProcess-5:
Traceback (most recent call last):
 File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
   self.run()
 File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
   self._target(*self._args, **self._kwargs)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/nmea.py", line 615, in process
   self.receive_nmea(line, msgs)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/nmea.py", line 434, in receive_nmea
   result = parser(line)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/nmea.py", line 63, in parse_nmea_gps
   speed = float(data[6])
ValueError: could not convert string to float:
Alan,
Your error is related to parsing nmea0183 gps and a bug in pypilot.   I think you have an early version of pypilot since this bug was fixed.  If you can instead assign your gps to gpsd, you won't have this problem if you don't want to upgrade.   pypilot will automatically get gps from gpsd if available.

(2020-03-24, 03:31 PM)jamos.tan@gmail.com Wrote:
Code:
pi@openplotter:~ $ journalctl -u pypilot
-- No entries --
In openplotter 1.2 the log for pypilot is normally not saved unfortunately.
Quote:
Code:
pi@openplotter:~ $ ps aux | grep pypilot
pi        1121  0.1  2.8  40944 26736 ?        Sl   11:11   0:13 /usr/bin/python /usr/local/bin/pypilot_webapp 8081
pi        1142  2.6  2.4  35144 22792 ?        S    11:11   5:01 /usr/bin/python /usr/local/bin/pypilot
pi        1202  0.9  1.8  35044 17404 ?        S    11:12   1:46 /usr/bin/python /usr/local/bin/pypilot
pi        1207  0.3  1.7  35044 16780 ?        S    11:12   0:37 /usr/bin/python /usr/local/bin/pypilot
pi        1210  1.3  1.8  35044 17524 ?        D    11:12   2:35 /usr/bin/python /usr/local/bin/pypilot
pi        1217  0.4  1.7  35044 17028 ?        S    11:12   0:52 /usr/bin/python /usr/local/bin/pypilot
pi        1218  0.4  1.8  35172 17852 ?        S    11:12   0:48 /usr/bin/python /usr/local/bin/pypilot
pi       14336  0.0  0.0   4368   536 pts/0    S+   14:24   0:00 grep --color=auto pypilot
[code]pi@openplotter:~ $ python /usr/local/bin/pypilot
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
failed to open special file /dev/watchdog0 for writing:
autopilot cannot strobe the watchdog
connected to gpsd
Settings file not found. Using defaults and creating settings file
Using settings file RTIMULib.ini
Detected LSM9DS1 at standard/standard address
Using fusion algorithm Kalman STATE4
IMU Name: LSM9DS1
min/max compass calibration not in use
Using ellipsoid compass calibration
Accel calibration not in use
LSM9DS1 init complete
autopilot failed to read imu at time: 1585060023.64
busy, try again later {u'path': u'/dev/ttyOP_uno', u'bauds': [38400]} servo
busy, try again later {'path': '/dev/ttyOP_uno', 'bauds': [38400, 4800]} nmea0
nmea source for gps source gpsd 1585060023.71
busy, try again later {'path': '/dev/ttyOP_uno', 'bauds': [38400]} servo
signalk_server: bind failed, try again.
nmea client connected
nmea_bridge: bind failed.

bind failing indicates pypilot already has some processes running. Try running "killall python" before running pypilot from the console.
Reply
#8
Thanks Sean, tried it:


Code:
pi@openplotter:~ $ sudo killall python
pi@openplotter:~ $ python /usr/local/bin/pypilot
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
failed to open special file /dev/watchdog0 for writing:
autopilot cannot strobe the watchdog
connected to gpsd
Settings file RTIMULib.ini loaded
Using settings file RTIMULib.ini
Using fusion algorithm Kalman STATE4
IMU Name: LSM9DS1
min/max compass calibration not in use
Using ellipsoid compass calibration
Accel calibration not in use
LSM9DS1 init complete
autopilot failed to read imu at time: 1585061836.82
busy, try again later {u'path': u'/dev/ttyOP_uno', u'bauds': [38400]} servo
busy, try again later {'path': '/dev/ttyOP_uno', 'bauds': [38400, 4800]} nmea0
nmea source for gps source gpsd 1585061837.68
busy, try again later {'path': '/dev/ttyOP_uno', 'bauds': [38400]} servo
nmea client connected
listening on port 20220 for nmea connections
busy, try again later {u'path': u'/dev/ttyOP_uno', u'bauds': [38400]} servo
busy, try again later {'path': '/dev/ttyOP_uno', 'bauds': [38400]} servo
busy, try again later {u'path': u'/dev/ttyOP_uno', u'bauds': [38400]} servo
busy, try again later {'path': '/dev/ttyOP_uno', 'bauds': [38400]} servo
busy, try again later {u'path': u'/dev/ttyOP_uno', u'bauds': [38400]} servo
busy, try again later {'path': '/dev/ttyOP_uno', 'bauds': [38400]} servo
busy, try again later {u'path': u'/dev/ttyOP_uno', u'bauds': [38400]} servo
busy, try again later {'path': '/dev/ttyOP_uno', 'bauds': [38400]} servo
^Cgot signal 2 cleaning up
got signal 2 cleaning up
got signal 2 cleaning up
got signal 2 cleaning up
got signal 15 cleaning up
got signal 15 cleaning up
got signal 15 cleaning up
Traceback (most recent call last):
 File "/usr/local/bin/pypilot", line 11, in <module>
   load_entry_point('pypilot==0.1', 'console_scripts', 'pypilot')()
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/basic_autopilot.py", line 108, in main
Process NmeaBridgeProcess-5:
   ap.run()
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 180, in run
Traceback (most recent call last):
Process Process-3:
 File "/usr/lib/python2.7/multiprocessing/process.py", line 261, in _bootstrap
   self.iteration()
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 346, in iteration
Traceback (most recent call last):
 File "/usr/lib/python2.7/multiprocessing/process.py", line 261, in _bootstrap
   time.sleep(dt)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
   raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
   util._exit_function()
 File "/usr/lib/python2.7/multiprocessing/util.py", line 294, in _exit_function
got signal atexit cleaning up
Process Process-1:
   util._exit_function()
Traceback (most recent call last):
   def _exit_function(info=info, debug=debug, _run_finalizers=_run_finalizers,
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
 File "/usr/lib/python2.7/multiprocessing/process.py", line 261, in _bootstrap
got signal 2 cleaning up
 File "/usr/lib/python2.7/multiprocessing/util.py", line 294, in _exit_function
Process GpsProcess-4:
   raise KeyboardInterrupt # to get backtrace on all processes
   util._exit_function()
 File "/usr/lib/python2.7/multiprocessing/util.py", line 303, in _exit_function
   def _exit_function(info=info, debug=debug, _run_finalizers=_run_finalizers,
Traceback (most recent call last):
KeyboardInterrupt
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
 File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
   info('process shutting down')
 File "/usr/lib/python2.7/multiprocessing/util.py", line 76, in info
   def info(msg, *args):
   self.run()
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
 File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
   raise KeyboardInterrupt # to get backtrace on all processes
   self._target(*self._args, **self._kwargs)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/gpsdpoller.py", line 62, in gps_process
   self.read(pipe)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/gpsdpoller.py", line 36, in read
KeyboardInterrupt
   gpsdata = self.gpsd.next()
 File "/usr/lib/python2.7/dist-packages/gps/gps.py", line 326, in next
   raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
   if self.read() == -1:
 File "/usr/lib/python2.7/dist-packages/gps/gps.py", line 312, in read
   status = gpscommon.read(self)
 File "/usr/lib/python2.7/dist-packages/gps/client.py", line 84, in read
   frag = self.sock.recv(4096)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, 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/python2.7/atexit.py", line 24, in _run_exitfuncs
   func(*targs, **kargs)
 File "/usr/lib/python2.7/multiprocessing/util.py", line 325, in _exit_function
got signal 17 cleaning up
Error in sys.exitfunc:
Traceback (most recent call last):
 File "/usr/lib/python2.7/atexit.py", line 30, in _run_exitfuncs
   traceback.print_exc()
 File "/usr/lib/python2.7/traceback.py", line 233, in print_exc
   print_exception(etype, value, tb, limit, file)
 File "/usr/lib/python2.7/traceback.py", line 125, in print_exception
   print_tb(tb, limit, file)
 File "/usr/lib/python2.7/traceback.py", line 69, in print_tb
   line = linecache.getline(filename, lineno, f.f_globals)
 File "/usr/lib/python2.7/linecache.py", line 14, in getline
   lines = getlines(filename, module_globals)
 File "/usr/lib/python2.7/linecache.py", line 41, in getlines
   return updatecache(filename, module_globals)
 File "/usr/lib/python2.7/linecache.py", line 84, in updatecache
   stat = os.stat(fullname)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
   raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
got signal 2 cleaning up
Process Process-2:
Traceback (most recent call last):
 File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
   self.run()
 File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
   self._target(*self._args, **self._kwargs)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/calibration_fit.py", line 438, in CalibrationProcess
   p = points.recv(1)
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/signalk/pipeserver.py", line 35, in recv
   if self.pollin.poll(1000.0*timeout):
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/pypilot/autopilot.py", line 93, in cleanup
   raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
Reply
#9
not sure what process is using the port already but this indicates another process has exclusive access.
Reply
#10
(2020-03-24, 04:09 PM)seandepagnier Wrote: not sure what process is using the port already but this indicates another process has exclusive access.

Weird, especially while it's a clean install of openplotter.


Arduino is connected over USB to a powered USB hub, the USB hub goes to the Pi. I'll try to connect it directly, maybe it makes a difference.

Also, is there a way to check which process is using the serial port? And, is it safe to upgrade pypilot from 1.2?

(2020-03-24, 04:19 PM)jamos.tan@gmail.com Wrote:
(2020-03-24, 04:09 PM)seandepagnier Wrote: not sure what process is using the port already but this indicates another process has exclusive access.

Weird, especially while it's a clean install of openplotter.


Arduino is connected over USB to a powered USB hub, the USB hub goes to the Pi. I'll try to connect it directly, maybe it makes a difference.

Also, is there a way to check which process is using the serial port? And, is it safe to upgrade pypilot from 1.2?

I've changed the serial port to "remember port" instead of device, and all seems to be working (for now). I'll keep an eye on it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)