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?
#11
Ok Sean, I ran update to make sure everything is the most current version.  Staying with 1.2 for now because it (mostly) works and 2.2 is still a bit new.

After update, same story.  No pypilot is running when openplotter starts, but it starts and runs stable from the console.  Changing port assignment to "none" then clicking Auto-Apply also starts pypilot.

Code:
pi@blue:~ $ killall python
pi@blue:~ $ openplotter
[[[[[
[[[[[ Clicking Autopilot Control on the pypilot tab
[[[[[
connect failed to localhost:21311
connect failed to localhost:21311
Traceback (most recent call last):
 File "/usr/local/lib/python2.7/dist-packages/pypilot-0.1-py2.7-linux-armv7l.egg/ui/autopilot_control.py", line 231, in onAP
   self.client.set('servo.raw_command', 0)
AttributeError: 'bool' object has no attribute 'set'
connect failed to localhost:21311
[[[[[
[[[[[ Changing port assignment for /dev/ttyAMA0 to none, then click Auto and Apply
[[[[[ Autopilot now works normally
[[[[[
Warning: Stopping signalk.service, but it can still be activated by:
 signalk.socket
probing arduino servo on /dev/ttyAMA0
arduino servo found
Settings file RTIMULib.ini loaded
Using fusion algorithm RTQF
read_sensors_d waiting for signal to exit
launched pypilot pid 2602
failed to load /home/pi/.pypilot/pypilot.conf Expected object or value
WARNING Alignment and other data lost!!!!!!!!!
failed to load /home/pi/.pypilot/pypilot.conf Expected object or value
WARNING Alignment and other data lost!!!!!!!!!
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: 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: 1585096370.33
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.0551450252533
autopilot failed to read imu at time: 1585096370.52
arduino server buffer overflow
MPU-925x init complete
autopilot failed to read imu at time: 1585096370.67
nmea source for gps source gpsd 1585096370.88
connect failed to localhost:21311
nmea client connected
listening on port 20220 for nmea connections
connected
IMURead failed!
nmea timeout for gps source gpsd 1585096387.04
nmea source for gps source gpsd 1585096387.54
FitPoints [] [-0.10289744062253131, 0.9786159943966504, -0.17810910202566343]
Reply
#12
Mine is stable now after setting all serial connections to "remember port" instead of "remember device". But I guess this only helps in my situation, maybe worth a try.
Reply
#13
(2020-03-25, 09:52 AM)jamos.tan@gmail.com Wrote: Mine is stable now after setting all serial connections to "remember port" instead of "remember device". But I guess this only helps in my situation, maybe worth a try.

Yep, looked at that.  pypilot was already set to remember port and the other option is greyed out. What's even more annoying is that everything was working fine right out of the box.  This problem developed after I installed a second USB device and moved some GPIO pin assignments for my panel light.
Reply
#14
I would dig deeper into this, but the new openplotter changed everything so I would focus efforts on making sure 2.0 is stable and doesn't have this problem.
Reply
#15
(2020-03-25, 03:46 PM)AlanH Wrote:
(2020-03-25, 09:52 AM)jamos.tan@gmail.com Wrote: Mine is stable now after setting all serial connections to "remember port" instead of "remember device". But I guess this only helps in my situation, maybe worth a try.

Yep, looked at that.  pypilot was already set to remember port and the other option is greyed out. What's even more annoying is that everything was working fine right out of the box.  This problem developed after I installed a second USB device and moved some GPIO pin assignments for my panel light.

Hmm, might it be a power management thing that causes the problem? What's also strange is that the option is greyed out, shouldn't be the case, at least with me it is still selectable. Never had it greyed out. What do you have connected to your USB headers and to the GPIO pins? Do you use an external (powered) usb hub?

Also, another question. After you do the re-select changing the serial port so that it works again, does it keep working as long as you have the pi booted? Does it reset and break only after reboot?

Also, what i find sometimes helped me in serial management troubles, is to remove all the connections and press reset. Then re-assign everything again. See if there are still things greyed out then.
Reply
#16
(2020-03-25, 05:44 PM)jamos.tan@gmail.com Wrote: Hmm, might it be a power management thing that causes the problem? What's also strange is that the option is greyed out, shouldn't be the case, at least with me it is still selectable. Never had it greyed out. What do you have connected to your USB headers and to the GPIO pins? Do you use an external (powered) usb hub?

Also, another question. After you do the re-select changing the serial port so that it works again, does it keep working as long as you have the pi booted? Does it reset and break only after reboot?

Also, what i find sometimes helped me in serial management troubles, is to remove all the connections and press reset. Then re-assign everything again. See if there are still things greyed out then.

All good questions! Once I reselect it continues working as long as openplotter is running. I can sail around all day on autopilot.  But if I manually exit openplotter, or reboot the system, pypilot does not restart.

I think the key might be in here ...

Code:
connect failed to localhost:21311


... which does not seem to happen once k-plex and serial ports are restarted.  Could there be a timing issue during the startup scripts?  I tried a 10-second delay but it didn't help.  I'm digging into Sean's code to try and understand the startup sequence but it's a bit advanced for me.

I'd assumed I cannot select device because the Pi serial port doesn't identify itself with a vendor and product ID.

Power problems are an interesting idea.  I'm running 2 x USB devices -- GPS puck and FTDTL serial port connected to the AIS receiver -- and GPIO powering a panel LED.  Maybe I'm pushing the limits of a 3A power supply during openplotter startup.  Hmm ... back to the boat for more experiments ...
Reply
#17
It even happens when closing the openplotter screen? You mean the same one that has the serial tab? I thought that this was seperate from any running processes.
As far as the power management, I don't think that would be a problem if that are the only things on your system. I have two rtl-sdr dongles, a zwave dongle, and I power a sense hat and a USB hub. But, I do power these with two separate power sources.

I just read some differences between the boot-up init.d and systemd on https://www.tecmint.com/systemd-replaces-init-in-linux/
Maybe this would be something to look at, maybe there is something wrong with the boot process and these would be the places I would look at, although my linux knowledge is not advanced, but good enough I suppose.

I usually do regular SD backups, before upgrading or installing new software which brings me to the next question.
Did you upgrade or install something new before getting this new problem?

My problem was that I upgrade pypilot, which now seems to be linked more to openplotter 2 development.
What I did a while back when I had a partially working openplotter running, I installed a clean install on a new sd card. But, because I didn't want to re-do all the other software packages, I just copied the code that I knew worked in the clean install and pasted them over the parts of the "corrupted" installation.

Might help when you reach the limits of problem solving... Tongue 
Also, when you need openplotter 1.2 I can help you with that. It cannot be downloaded anymore from sailoog, you need to start from 0.8.0 and then manually upgrade.
Reply
#18
Just thought about your specific error a bit:


Code:
connect failed to localhost:21311

Isn't this usually port 20220?
Is pypilot not having a signalk connection or only no motor controller connection?
Reply
#19
the startup sequence is different in openplotter 2.0 so I can only really suggest upgrading and that hopefully fixes the problem.
Reply
#20
Welp, near as I can tell pypilot is starting briefly then crashing out. I get readings from the IMU but then it disconnects. Workaround is add an Action to call command pypilot. It doesn't seem to work right away but I can play all actions from the menu bar and everything starts right up. Someday when I have time I'll pull everything apart again and upgrade to OP 2.0. Thanks for your help guys!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)