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 calibration fails
#1
Hi all. I'm trying to get my tinypilot to work. Since last time I used it, I have been trying some attempts to reinstall/build an updated version from GIT. This fails, however, and I have been rebuilding version (0.31, I believe) from the /pypilot folder on my toinypilot.

When trying to run various scripts, I get some sort of error message. Typically:


Code:
tc@pypilot:~$ pypilot_calibration
Traceback (most recent call last):
 File "/usr/local/bin/pypilot_calibration", line 11, in <module>
   load_entry_point('pypilot==0.32', 'console_scripts', 'pypilot_calibration')()
 File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 565, in load_entry_point
   return get_distribution(dist).load_entry_point(group, name)
 File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
   return ep.load()
 File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2291, in load
   return self.resolve()
 File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2297, in resolve
   module = __import__(self.module_name, fromlist=['__name__'], level=0)
 File "/usr/local/lib/python3.6/site-packages/pypilot/ui/autopilot_calibration.py", line 11, in <module>
   import wx, wx.glcanvas
ModuleNotFoundError: No module named 'wx'
 
Code:
tc@pypilot:~$ pypilot
autopilot start 1464.401773
ERROR loading wind.py cannot import name 'HeadingOffset'   cannot import name 'HeadingOffset'
ERROR loading gps.py cannot import name 'HeadingOffset'   cannot import name 'HeadingOffset'
imu process 4096
made imu process realtime
Using settings file RTIMULib.ini
Settings file RTIMULib.ini loaded
Failed to open SPI bus 0, select 0
Using fusion algorithm Kalman STATE4
ERROR: No IMU Detected 1465.569427
warning, failed to make calibration process idle, trying renice
nmea process 4103
listening on port 20220 for nmea connections
gps process 4107
loading servo calibration /home/tc/.pypilot/servocalibration
WARNING: using default servo calibration!!
Available Pilots: ['simple', 'basic', 'absolute']
warning: failed to open special file /dev/watchdog0 for writing
        cannot stroke the watchdog
pypilotServer process 4108
autopilot init complete 1465.879017
servo probe ('/dev/ttyAMA0', 38400) 1465.91319
server/client is running too _slowly_ 0.07228399999985413
server setup has 5 pipes
imu rate set to rate 20
setting initial gyro bias [-1.915, -2.625, -0.228]
imu rate set to rate 20
server add socket ('127.0.0.1', 56272)
server add socket ('127.0.0.1', 56274)
server add socket ('127.0.0.1', 56276)
arduino servo found ['/dev/ttyAMA0', 38400]
serialprobe success: /home/tc/.pypilot/servodevice ['/dev/ttyAMA0', 38400]
sensor found rudder servo /dev/ttyAMA0

Any activation of the AP fails due to various  overcurrent and rudder out of range messages...   Any ideas where to start troubleshooting?

Code:
tc@pypilot:~$ pypilot_boatimu
imu process 4124
pypilotServer process 4126
made imu process realtime
Using settings file RTIMULib.ini
Settings file RTIMULib.ini loaded
Failed to open SPI bus 0, select 0
Using fusion algorithm Kalman STATE4
ERROR: No IMU Detected 3101.016343
server setup has 3 pipes
warning, failed to make calibration process idle, trying renice
imu rate set to rate 20
setting initial gyro bias [-1.915, -2.625, -0.228]
server add socket ('127.0.0.1', 53226)
server add socket ('127.0.0.1', 53228)
server, remove socket ('127.0.0.1', 53226)
server, remove socket ('127.0.0.1', 53228)
server add socket ('127.0.0.1', 53230)
server add socket ('127.0.0.1', 53232)
calibration loaded, starting 4123
server add socket ('127.0.0.1', 53234)
server, remove socket ('127.0.0.1', 53234)
Reply
#2
Code:
$ ssh pypilot
tc@192.168.1.102's password:
tinypilot is a Sailboat Autopilot Distribution for raspberry pi

  ( '>')
 /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY.
(/-_--_-\)           www.tinycorelinux.net

tc@pypilot:~$ pypilot_boatimu
falling back to python nonblocking socket, will consume more cpu cannot import name 'linebuffer'
pypilot failed to import required modules.  Did you forget to run sudo python3 setup.py install?
pypilot failed to import required modules.  Did you forget to run sudo python3 setup.py install?
Reply
#3
The hint is:
ModuleNotFoundError: No module named 'wx'

Did you install python wx support either via apt or pip?


What kind of rudder feedback and motor controller is connected?
Reply
#4
Thanks Sean. I will explain:

1: I ordered a new Tinypilot,, and the "large" motor controller from you, in September last year. You had to deviate from your typical setup, due to missing hardware (Quote: "What has happened is I no longer have any mpu9255 sensors, so switched
to icm20948.   The stable software doesn't support it, so I need to
use new software."
 
2: I installed the AP on my boat. The boat is a Beneteau Oceanis 331, with a L&S hydraulic drive. The feedback sensor is from the previous AP, a B&G Network Pilot. There is also a clutch valve connected for bypassing the pump for manual  steering. Everything worked perfectly fine, and the sailing performance was impressive! I was however, not able to fully connect to my SignalK data for wind input etc. so I deciced to try to upgrade to the latest version on Github. Thats when the troble started. I used the instructions from the wiki: 
Code:
cd
mkdir pypilot-update
cd pypilot-update/
git clone git://github.com/pypilot/pypilot
git clone --depth 1 git://github.com/pypilot/pypilot_data
cp -rv pypilot_data/* pypilot
cd pypilot
. pypilot.build

3: The build (version 0.32) seemed to successfully complete, but when rebooting the AP, it never seems to fully complete the startup sequence.

4: Then I decided to try to download the latest image (https://pypilot.org/images/tinypilot_2021_11_16.img.xz) from here . So from here, everything originally on my SD card was lost.

5: With the new image, the AP boots correctly, but I'm having issues with the rudder feedback setup. Not able to get it setup correctly. 

6: Your question, about whether I installed python wx support. The answer is that I have not (deliberately) tried to install any such module.

So here I am. I'm sure there is an easy fix to all this. Just need some guidance. Is there something in the original setup (that you sent in september (v 0.31)) that was specifically customized to my TP, due to the off-spec icm20948? Or have I been fiddling with anything that makes my AP unhappy, even when downloading the latest code from git?
Do you suggest that I download a new image file, and start from there? 

Best regards, Leif
Reply
#5
(2022-02-26, 08:50 AM)kniven Wrote: Thanks Sean. I will explain:

1: I ordered a new Tinypilot,, and the "large" motor controller from you, in September last year. You had to deviate from your typical setup, due to missing hardware (Quote: "What has happened is I no longer have any mpu9255 sensors, so switched
to icm20948.   The stable software doesn't support it, so I need to
use new software."
Correct, you need a more recent image version 0.3 and later
 
Quote:2: I installed the AP on my boat. The boat is a Beneteau Oceanis 331, with a L&S hydraulic drive. The feedback sensor is from the previous AP, a B&G Network Pilot. There is also a clutch valve connected for bypassing the pump for manual  steering. Everything worked perfectly fine, and the sailing performance was impressive! I was however, not able to fully connect to my SignalK data for wind input etc. so I deciced to try to upgrade to the latest version on Github. Thats when the troble started. I used the instructions from the wiki: 
Code:
cd
mkdir pypilot-update
cd pypilot-update/
git clone git://github.com/pypilot/pypilot
git clone --depth 1 git://github.com/pypilot/pypilot_data
cp -rv pypilot_data/* pypilot
cd pypilot
. pypilot.build

3: The build (version 0.32) seemed to successfully complete, but when rebooting the AP, it never seems to fully complete the startup sequence.
Hmm strange. In this case, the step to take is check the log in /var/log/pypilot/current.

Alternately stop pypilot service:
$ sudo sv d pypilot
then run pypilot directly and check the output
$ pypilot
Quote:4: Then I decided to try to download the latest image (https://pypilot.org/images/tinypilot_2021_11_16.img.xz) from here . So from here, everything originally on my SD card was lost.
[/quote
Sometimes it's good to use a new sd to keep the working image just in case..
[quote]
5: With the new image, the AP boots correctly, but I'm having issues with the rudder feedback setup. Not able to get it setup correctly. 

6: Your question, about whether I installed python wx support. The answer is that I have not (deliberately) tried to install any such module.
OK. There is no gui on tinypilot. I had thought you were installing pypilot on openplotter or another linux machine and trying to run the calibration scripts. For example:
pypilot_calibration <tinypilot_ip>
Quote:So here I am. I'm sure there is an easy fix to all this. Just need some guidance. Is there something in the original setup (that you sent in september (v 0.31)) that was specifically customized to my TP, due to the off-spec icm20948? Or have I been fiddling with anything that makes my AP unhappy, even when downloading the latest code from git?
Do you suggest that I download a new image file, and start from there? 

Best regards, Leif
Can you try using that same image, and connecting to the web. For example http://192.168.1.102

From here it should be possible to calibrate the rudder feedback. That image should support rudder feedback without issues, maybe it just wasn't calibrated? Alternately, you could use the pypilot_calibration script, or even the opencpn plugin to calibrate the rudder feedback. It should also be possible using the remote control and lcd screen. So generally 4 methods. I am sorry about the issues you had upgrading, if you can check the log it would give hints, but the image you downloaded should be "ok"
Reply
#6
Thanks Sean. I'm away from my boat this week, but I will try in some days.
BTW: I did manage to connect via the web-interface. And when trying to set the extremities of the rudder sensor, the reported position seemed correct +-30 degrees. But the error messages still indicated various issues. Will report back later this week.
Reply
#7
I managed to solve my problem, by rewriting the image. Will try to build from github anytime soon.
Reply
#8
(2022-02-25, 08:12 PM)seandepagnier Wrote: The hint is:
ModuleNotFoundError: No module named 'wx'

Did you install python wx support either via apt or pip?


What kind of rudder feedback and motor controller is connected?

How do you install python wx on tinylinux for tinypilot?
Because I get the same bug (v 0.42) !
Reply
#9
wx doesnt run on tinypilot normally... it can but this requires using x and typically it is commandline only.

pypilot_calibration is a python script gui interface to pypilot. You should run this locally on whatever computer you are using, or just use the web interface or opencpn plugin which both support the same features.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)