![]() |
|
PyPilot Broken After Updates and Repair Process - Printable Version +- OpenMarine (https://forum.openmarine.net) +-- Forum: OpenMarine (https://forum.openmarine.net/forumdisplay.php?fid=27) +--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=28) +--- Thread: PyPilot Broken After Updates and Repair Process (/showthread.php?tid=7018) |
PyPilot Broken After Updates and Repair Process - chaddcurtis - 2026-07-11 OpenPlotter 4 / Pypilot repair notes: missing backend, RTIMULib incompatibility, linebuffer errors, and missing calibration graphics TL;DR I was able to restore Pypilot on two Raspberry Pi 5 systems running OpenPlotter 4:
The problems were not caused by the IMU or its I2C connection. They involved an incomplete or inconsistent Pypilot installation, incompatible RTIMULib Python bindings, a broken or missing compiled Code: linebufferCode: pypilot_dataOn the older installation, the step that finally restored the Pypilot backend was: Code: cd /tmpI then removed the cached IMU configuration and restarted Pypilot: Code: cd ~Afterward, Pypilot detected the ICM-20948, verified all IMU axes, loaded calibration, started the server, displayed the 3D calibration boat, and reported compass, GPS, wind, and true-wind modes. Your mileage may vary. This is not my area of expertise, and this repair process was developed and worked through with the assistance of ChatGPT. I am sharing the symptoms, commands, logs, and results because they may help others who are experiencing the same problems. This should not be treated as an official or universal repair procedure. Make a complete image backup of the SD card or NVMe drive before trying any of this. System details My system was:
The exact versions and repository contents may change, so anyone trying this should record their own OpenPlotter, Pypilot, Python, and architecture details. Symptoms Across the two installations, I encountered several of the following:
Start with the logs The graphical interface often showed only that the service was activating and then becoming inactive again. The system logs revealed the actual errors. Check both services: Code: systemctl status pypilot_boatimu --no-pager -lThen inspect the logs: Code: journalctl -u pypilot_boatimu -b --no-pager -n 150For live monitoring: Code: journalctl -u pypilot_boatimu -for: Code: journalctl -u pypilot -fConfirm that Linux can see the IMU Check that the I2C bus exists: Code: ls -l /dev/i2c*Then scan bus 1: Code: sudo i2cdetect -y 1My ICM-20948 appeared at: Code: 0x68That confirmed that the IMU was electrically visible to Linux. Important distinction: Seeing the IMU with Code: i2cdetectSomeone can therefore have correct wiring and a detectable IMU while Pypilot still fails entirely because of a software problem. Failure 1: missing or incomplete Pypilot installation On the fresh OpenPlotter installation, the Pypilot package did not appear to leave a complete working backend. Problems included:
The dependency script failed with: Code: NameError: name 'wiringpi_dep' is not definedAn initial Pypilot source build also failed with: Code: error: command 'swig' failed: No such file or directoryThe basic packages I installed included: Code: sudo apt updateI would not assume this package list is complete for every installation. The relevant error messages in the logs should determine what is actually missing. Failure 2: incompatible RTIMULib binding Installing Debian's Code: python3-rtimulibThe service reported: Code: AttributeError: 'RTIMU.Settings' object has no attribute 'MPU925xAccelFsr'I installed the newer RTIMULib2 Python binding: Code: cd /tmpI verified that the required setting existed with: Code: cd ~The important result was: Code: Has MPU925xAccelFsr: TrueIf it reports Code: FalseFailure 3: broken or mixed Pypilot files on the older installation The older installation had an additional error: Code: cannot import name 'linebuffer' from 'pypilot.linebuffer'The Code: pypilot_boatimuA normal installation using: Code: sudo python3 setup.py installhad helped on the fresh installation, but it did not appear to replace all of the conflicting files on the older system. The repair that ultimately worked there was: Code: cd /tmpIn my case, pip removed Pypilot 0.70 and installed Pypilot 0.71. It also installed or replaced Pypilot's declared dependencies, including:
This was a much more complete replacement than the earlier Code: setup.py installIt also modifies Python packages outside Debian's normal package-management process. That is one reason I strongly recommend making a complete drive image first. Important testing trap: leave the cloned source directory After installing Pypilot, I initially tested Code: linebufferCode: /tmp/pypilotPython imported the files from the cloned source directory instead of the installed package and produced: Code: ImportError: cannot import name '_linebuffer'That result was misleading. Before testing the installation, change to another directory: Code: cd ~Then check where Python is loading each package from: Code: python3 -c "import pypilot; print(pypilot.__file__)"The installed Pypilot copy should normally be somewhere under: Code: /usr/local/lib/python3.11/dist-packages/It should not point to Code: /tmp/pypilotResetting cached IMU detection After installing the corrected packages, I removed the cached RTIMU configuration so that Pypilot would probe the IMU again: Code: cd ~Then I checked: Code: systemctl status pypilot_boatimu --no-pager -lOnce IMU-only mode remained active, I enabled and checked the full Pypilot service: Code: sudo systemctl restart pypilotFailure 4: missing calibration boat and graphics Even after the Pypilot backend and IMU were operating, the calibration window had another separate problem. It displayed: Code: Vagabond.obj failed to loadThis appears to be a problem others have also encountered. In this condition:
The boat model and related calibration assets are supplied by the separate Code: pypilot_dataFor a system where Pypilot is otherwise working, the missing model can be addressed separately: Code: sudo apt install -y \Then verify the package from outside the source directory: Code: cd ~Reopen the calibration program: Code: pypilot_calibrationAfter installing Code: pypilot_dataCode: Vagabond.objThe full forced Pypilot installation: Code: sudo python3 -m pip install \also installed Code: pypilot_dataMissing graphics versus an IMU failure Calibration points do not appear or respond to movement Investigate:
Calibration points move, but the boat model is absent Investigate:
A missing boat image does not necessarily mean that the IMU or calibration data is failing. GTK warnings The calibration application also produced messages similar to: Code: Gtk-WARNING: for_size smaller than min-sizeThese appeared to be interface-layout warnings. In my case, they did not prevent live IMU data, moving calibration points, calibration calculations, or the 3D boat model from appearing once its files were installed. Successful results After the repairs, the logs showed messages including: Code: Detected ICM20948 at standard addressThe calibration interface showed live, moving points and the restored 3D sailboat model. The Pypilot client also reported: Code: ap.modes = [compass, gps, wind, true wind]This confirmed that the backend was running and exposing the expected steering modes. What I believe this established On my system, the repair established that:
What it did not establish This does not yet prove that:
Pypilot worked on the older installation previously and stopped working after system updates, but I cannot identify the precise package or update that caused the breakage. Conclusions I encountered at least four separate but related problems:
The key repair on the older installation was: Code: sudo python3 -m pip install \The separate Code: pypilot_dataAgain, this is not my area of expertise, and this repair process was developed and worked through with the assistance of ChatGPT. I am posting it as a record of one successful repair and as a set of diagnostic clues, not as an authoritative or risk-free installation guide. I would be interested to know whether others using Code: openplotter-pypilot 4.0.11-betaCode: MPU925xAccelFsrCode: cannot import name 'linebuffer'Code: No module named 'pypilot_data'Code: Vagabond.obj failed to loadUseful details to include in any comparison would be:
RE: PyPilot Broken After Updates and Repair Process - rdempsey - 2026-07-12 I have the same problem,. Thanks for the deep dive. Way beyond my current skill set though. I always end up breaking things . Hopefully this will help with future versions ! RE: PyPilot Broken After Updates and Repair Process - rdempsey - 2026-07-12 I decided to try Anthropic Claude since I'm not a programmer. Claude got pypilot up and running fine, but still couldn't see the imu. It came up with this as the cause: "That answers it definitively. Looking at the actual OpenPlotter pypilot GUI source, it directly does import RTIMU and calls RTIMU.Settings(...) — so this is a hard dependency, but it comes from a completely separate project: Sean D'Epagnier's own fork of RTIMULib2, not from pypilot's own repo (which explains why building pypilot's setup.py never touches it), and not from Debian's generic librtimulib7 package either (which pypilotPostInstall explicitly removes as incompatible, since it's the wrong fork)." Here's the list of steps it gave me that solved this (I removed all the tests and stuff that didn't work, because it was LONG !) 1. Fixed the incomplete SignalK plugin install npm install pypilot-autopilot-provider@1.1.2 (run from ~/.signalk — the app store had listed it as installed when it wasn't) 2. Fixed the missing swig dependency that broke pypilot's own build sudo apt install -y swig sudo apt install -y libgpiod-dev sudo /usr/bin/pypilotPostInstall (this rebuilt and installed the actual pypilot engine to /usr/local/bin/) 3. Enabled the systemd services so they'd start sudo systemctl enable pypilot pypilot_web sudo systemctl start pypilot pypilot_web 4. Removed the wrong RTIMU package (Debian's generic one conflicted with pypilot's expected fork) sudo apt remove -y python3-rtimulib 5. Built and installed the correct RTIMULib2 fork with Python bindings sudo apt install -y cmake libi2c-dev cd ~ git clone https://github.com/seandepagnier/RTIMULib2 cd RTIMULib2/Linux mkdir build && cd build cmake -DBUILD_GL=OFF -DBUILD_DEMOGL=OFF .. make -j4 sudo make install sudo ldconfig cd ../python python3 setup.py build sudo python3 setup.py install 6. Set the operating mode in the OpenPlotter GUI OpenPlotter → Pypilot → Services tab → set mode to "IMU only" → Apply/Save That last GUI step turned out to be the actual key to surviving reboots — OpenPlotter's own service manager was overriding the raw systemctl enable state based on its saved mode setting each boot. Nice work sticking with this one — it was a genuinely deep stack of separately broken pieces. Fair winds with the pilot. Everything works now !!!! Hope this helps somebody else or points them in the right direction.
|