2021-05-13, 06:47 PM
(This post was last modified: 2021-05-13, 08:29 PM by Sparhawk76.
Edit Reason: after a bit more digging ...
)
(2021-05-13, 06:17 PM)cosborne Wrote: I don't think I had a problem with running pypilot from cli until I reinstalled as sudo but I could be wrong. I definitely have an issue now.
Code:pi@openplotter:~/pypilot/pypilot $ service pypilot stop
pi@openplotter:~/pypilot/pypilot $ pypilot
imu process 23486
nmea process 23491
listening on port 20220 for nmea connections
made imu process realtime
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
Using settings file RTIMULib.ini
Settings file not found. Using defaults and creating settings file
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: ['absolute', 'basic', 'simple', 'learning']
warning: failed to open special file /dev/watchdog0 for writing
cannot stroke the watchdog
gps process 23495
pypilotServer process 23498
server setup has 5 pipes
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 "/home/pi/.local/lib/python3.7/site-packages/pypilot/server.py", line 398, in run
self.poll(dt)
File "/home/pi/.local/lib/python3.7/site-packages/pypilot/server.py", line 564, in poll
connection.write('watch=' + pyjson.dumps(connection.cwatches) + '\n')
AttributeError: module 'pyjson' has no attribute 'dumps'
serialprobe removing gps device /dev/serial/by-id/usb-u-blox_AG_-_www.u-blox.com_u-blox_7_-_GPS_GNSS_Receiver-if00
MPU-925x init complete
failed send ex 86016.668265574 86016.668315011 module 'pyjson' has no attribute 'dumps'
failed to encode data pipe! imu_pipe[1] module 'pyjson' has no attribute 'dumps'
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 "/home/pi/.local/lib/python3.7/site-packages/pypilot/boatimu.py", line 148, in process
self.poll()
File "/home/pi/.local/lib/python3.7/site-packages/pypilot/boatimu.py", line 181, in poll
msgs = self.client.receive()
File "/home/pi/.local/lib/python3.7/site-packages/pypilot/client.py", line 315, in receive
self.poll(timeout)
File "/home/pi/.local/lib/python3.7/site-packages/pypilot/client.py", line 215, in poll
self.connection.write('watch=' + pyjson.dumps(self.wwatches) + '\n')
AttributeError: module 'pyjson' has no attribute 'dumps'
Traceback (most recent call last):
File "/usr/local/bin/pypilot", line 11, in <module>
load_entry_point('pypilot==0.24', 'console_scripts', 'pypilot')()
File "/home/pi/.local/lib/python3.7/site-packages/pypilot/autopilot.py", line 386, in main
ap.iteration()
File "/home/pi/.local/lib/python3.7/site-packages/pypilot/autopilot.py", line 381, in iteration
time.sleep(dt)
File "/home/pi/.local/lib/python3.7/site-packages/pypilot/autopilot.py", line 169, in cleanup
raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
closing autopilot
terminate calibration process
After installing the pyjson module with pip, I am now getting this exact error. Also I backtracked your steps and am getting all the same errors as you with pypilot_servo, and running servo.py from the pypilot installation directory. So looks like we are both chasing the exact same bug. If it makes any difference I am running openplotter headless, which came with pypilot version 0.16.
Edit: after a bit more digging I've noticed that with the pyjson module installed, pypilot fails immediately after running. If I uninstall pyjson using pip, the pypilot process will stay running for a short time, before failing with the original error I posted that I noticed was quite similar to cosborne's error running servo.py.