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
I2C service not running ...Work Around
#1
Need help trobleshooting "i2c service not running" error.

In recommissioning my RPi5 Openplotter system for this season, I get a "i2c service not running" error on check system startup.

My system is a Rpi 5 4GB running OP4.  The i2c sensor is a BME280.  I have spend a some time trying to troubleshoot this
issue with no success.  I have searched the forum here and tried the various solutions including this post:

https://forum.openmarine.net/showthread....8#pid32198

The only success on the  forum has been a fresh install....but not for me.

So what have I done to focus the troubleshooting process.
    1. I know the BME280 sensor and wiring are good.  I have attached it (exact sensor and wiring) to RPi 4 running OP3 and
      it works fine.  It's not the sensor!
    2. I wrote a fresh SD card with OpenPlotter 4 Starting (2024-06-19-OpenPlotter-v4-Starting-stable-img.zip) using RPi Imager
    3. Booted my RPi 5 this Sd card - did NOT do any OS or OpenPlotter updates.
    4. Went to Preferences > Raspberry Pi Configuration > Interfaces  and enabled I2C, Rebooted
    5. Opened SignalK, Created Admin user as pi with password, Logged in as user: pi
    6. Opened OP settings (ver 4.2.0), installed I2C Sensors app (ver 4.2.0-stable), Restart SignalK, Data Browser shows
      Validation.I2C path value.
    7. Open I2C sensors app, I2C addresses shows one address "76" ( BME280 sensor is the only i2c device)
    8. Add BME280 sensor on Address 76, 3 SignalK keys show, Edit temperature key for "environment.inside.temperature",
      All keys show 'yellow" in I2C app.
    9. SignalK shows no I2C data values.
  10. Restart SignalK and the ws.I2C..., and ws.NOTICATIONS..., Connections disappear from Dashboard page.
  11. Run Check System and ws.I2C... and ws.NOTICATIONS..... reappear in SignalK dashboard. Get the following I2C error

   

  12. Execute the terminal commands suggested in the above referenced forum post.  Get the following error on systemctl status:

   

So no love. 

Repeated the above steps with fresh SD card image but with all OS , Eeprom and OpenPlotter Updates as of 11 April 2025.  Same result.

So can someone else reproduce this result? I've tried to keep it as simple as possible detailing the exact steps taken so hopefully it can be reproduced.

Here's a neofetch screen for the above tests.

   

Is there anything else I can try to troubleshoot this issue? 

TIA - I love the OpenPlotter software and appreciate the hard work put into it.

Jay 
S/V Priority
Reply
#2
I have exactly the same issue with a BME688 so interested in any helpful suggestions - have tried all that I could find so far on this forum
Pi5 with Macarthur Hat - BME688 via STEMMA QT/Qwiic
Also have IMU sensor installed and that works fine in signalk
Thanks
S/Y Freya
Reply
#3
SOLUTION FOR ME!!!     But it's a HACK!

DISCLAIMER:  I'm not a programmer/developer.  What I'm detailing here is a pure hack.  It may break other things on your system and will probably not survive reinstalls or software updates.  This did work for me and has not caused any other problems with my openplotter setup.  I'm only trying to help others in this community.  Your mileage may vary.

Using the following command in a terminal shows the messages from systemd on starting the openplotter-i2c-read service.

Code:
journalctl -u openplotter-i2c-read.service -f

Use ctrl c to stop the output.  The openplotter-i2c-read service will try to restart every 3 sec. Here's the output for a single restart.

.txt   messages1.txt (Size: 4.62 KB / Downloads: 128)

Of particaular interest is this message:
   

The lgpio.py library is trying to access a file that doesn't exist.  This file is associated with notifications which I don't believe are used in our applications.

So my solution was to comment out this line of the lgpio.py library (I know it's a hack!). But it works.

So do this.
Code:
cd /usr/lib/python3/dist-packages
sudo cp lgpio.py lgpio.org
sudo nano lgpio.py

Show line numbers with Alt+Shift+3.
Navigate to line number 504 with Ctrl+/
Comment out line 504 with # as show in this screenshot

   

Save changes with Ctrl+x and y.

Then reboot system.  


If you need to change back to the original setup:
Code:
cd /usr/lib/python3/dist-packages
sudo rm lgpio.py
sudo mv lgpio.org lgpio.py

This worked for me.   Hope it helps you

Jay 
S/V Priority
Reply
#4
(2025-04-15, 11:27 AM)Jay_cd33 Wrote: SOLUTION FOR ME!!!     But it's a HACK!

DISCLAIMER:  I'm not a programmer/developer.  What I'm detailing here is a pure hack.  It may break other things on your system and will probably not survive reinstalls or software updates.  This did work for me and has not caused any other problems with my openplotter setup.  I'm only trying to help others in this community.  Your mileage may vary.

Using the following command in a terminal shows the messages from systemd on starting the openplotter-i2c-read service.

Code:
journalctl -u openplotter-i2c-read.service -f

Use ctrl c to stop the output.  The openplotter-i2c-read service will try to restart every 3 sec. Here's the output for a single restart.


Of particaular interest is this message:


The lgpio.py library is trying to access a file that doesn't exist.  This file is associated with notifications which I don't believe are used in our applications.

So my solution was to comment out this line of the lgpio.py library (I know it's a hack!). But it works.

So do this.
Code:
cd /usr/lib/python3/dist-packages
sudo cp lgpio.py lgpio.org
sudo nano lgpio.py

Show line numbers with Alt+Shift+3.
Navigate to line number 504 with Ctrl+/
Comment out line 504 with # as show in this screenshot



Save changes with Ctrl+x and y.

Then reboot system.  


If you need to change back to the original setup:
Code:
cd /usr/lib/python3/dist-packages
sudo rm lgpio.py
sudo mv lgpio.org lgpio.py

This worked for me.   Hope it helps you

Jay 
S/V Priority

Hi Jay, many thanks for this Hack, unfortunately it doesn't want to stay in place after a reboot. I have tried 3 times and I could post screenshots that are identical to yours but the "comment out #" doesn't seem to survive a reboot so is not there when I return to line 504.
So glad it works for you though.
Cheers
Malcolm
S/Y Freya
Reply
#5
(2025-04-16, 05:53 PM)ukabroad Wrote: Hi Jay, many thanks for this Hack, unfortunately it doesn't want to stay in place after a reboot. I have tried 3 times and I could post screenshots that are identical to yours but the "comment out #" doesn't seem to survive a reboot so is not there when I return to line 504.
So glad it works for you though.
Cheers
Malcolm
S/Y Freya

Malcolm,
This is weird.  I powered up my test RPi5 used in the testing above and the lgpio.py line 504 # was gone.  So you are right, the fix doesn't stick.  What's really weird is I reapplied the fix and rebooted 3 times and it always stuck.  So I tried completed disconnecting power (unplugged) and when I powered up it was still there.  So I'm lost as to what sequence causes the lgpio.py library to be overwritten.  I currently testing a full power disconnect for a longer period.

I have rebooted my main boat system (with many more devices connected) many times and the fix seems to hold.  But why I don't know.

I will continue to investigate.   If nothing I'm persistent.  I might try taking away write privileges on that file or coming up with a startup script that overwrites with the fixed version on startup.  

I'll post if I have any success.

Jay
S/V Priority
Reply
#6
(2025-04-16, 06:36 PM)Jay_cd33 Wrote:
(2025-04-16, 05:53 PM)ukabroad Wrote: Hi Jay, many thanks for this Hack, unfortunately it doesn't want to stay in place after a reboot. I have tried 3 times and I could post screenshots that are identical to yours but the "comment out #" doesn't seem to survive a reboot so is not there when I return to line 504.
So glad it works for you though.
Cheers
Malcolm
S/Y Freya

Malcolm,
This is weird.  I powered up my test RPi5 used in the testing above and the lgpio.py line 504 # was gone.  So you are right, the fix doesn't stick.  What's really weird is I reapplied the fix and rebooted 3 times and it always stuck.  So I tried completed disconnecting power (unplugged) and when I powered up it was still there.  So I'm lost as to what sequence causes the lgpio.py library to be overwritten.  I currently testing a full power disconnect for a longer period.

I have rebooted my main boat system (with many more devices connected) many times and the fix seems to hold.  But why I don't know.

I will continue to investigate.   If nothing I'm persistent.  I might try taking away write privileges on that file or coming up with a startup script that overwrites with the fixed version on startup.  

I'll post if I have any success.

Jay
S/V Priority

Thanks for the prompt response Mate, I will stay tuned
Cheers
Malcolm
Reply
#7
I have the same issue. Have a BME280 installed, fresh install post fitting a NVME base. Getting 'service not running' warning on check system for i2c. Interestingly the sensor will read in Signal K with the BME280 plugin but wont read otherwise.
Reply
#8
(2025-04-17, 04:31 PM)Dillingsuk Wrote: I have the same issue. Have a BME280 installed, fresh install post fitting a NVME base. Getting 'service not running' warning on check system for i2c. Interestingly the sensor will read in Signal K with the BME280 plugin but wont read otherwise.

Hi Dillingsuk,
Yes. It's not the sensor.  It's the openplotter-i2c-read service.  If you enter the follwing command in a terminal you will see the problem.
Code:
sudo systemctl status openplotter-i2c-read
 It will show that the openplotter-i2c-read service is enabled but not running because the error I showed above.  The openplotter-i2c-read.service will try to restart every 3 seconds.
The fix I described above will get the read service running.  In fact you don't need to reboot, it should start on its own.  But you can always force the restart with the following.
Code:
sudo systemctl restart openplotter-i2c-read

You should see data in signalk if you have configured your BME280 in the openplotter I2C app.  You can also run the Openplotter Check System and it should show i2c running.

I'm not sure why the lgpio.py file gets overwritten sometimes.   My systems seem to reboot okay.  It was just the one time I described above that it was overwritten.

The plugin may be the way to go.  I have not explored that way to read the BME280.  Thanks for the info.

Jay
S/V Priority
Reply
#9
(2025-04-16, 06:41 PM)ukabroad Wrote: Thanks for the prompt response Mate, I will stay tuned
Cheers
Malcolm

Malcolm,
Could I ask you to confirm a couple things.   After making the modifications to the lgpio.py, instead of rebooting could you restart the openplotter-i2c-read service with the following command.

Code:
sudo systemctl restart openplotter-i2c-read

Then confirm that the read service is running with the Openplotter Check System.   Also confirm that Signalk is getting data from your BME688 sensor.

I have not been able to repeat the loss of the lgpio.py changes to my systems after shutdowns and reboots.  I'm thinking that maybe your changes to the lgpio.py are not being saved.  After making the changes the read service should work without rebooting.

Still investigating.
Jay
S/V Priority
Reply
#10
(2025-04-17, 06:45 PM)Jay_cd33 Wrote:
(2025-04-17, 04:31 PM)Dillingsuk Wrote: I have the same issue. Have a BME280 installed, fresh install post fitting a NVME base. Getting 'service not running' warning on check system for i2c. Interestingly the sensor will read in Signal K with the BME280 plugin but wont read otherwise.

Hi Dillingsuk,
Yes. It's not the sensor.  It's the openplotter-i2c-read service.  If you enter the follwing command in a terminal you will see the problem.
Code:
sudo systemctl status openplotter-i2c-read
 It will show that the openplotter-i2c-read service is enabled but not running because the error I showed above.  The openplotter-i2c-read.service will try to restart every 3 seconds.
The fix I described above will get the read service running.  In fact you don't need to reboot, it should start on its own.  But you can always force the restart with the following.
Code:
sudo systemctl restart openplotter-i2c-read

You should see data in signalk if you have configured your BME280 in the openplotter I2C app.  You can also run the Openplotter Check System and it should show i2c running.

I'm not sure why the lgpio.py file gets overwritten sometimes.   My systems seem to reboot okay.  It was just the one time I described above that it was overwritten.

The plugin may be the way to go.  I have not explored that way to read the BME280.  Thanks for the info.

Jay
S/V Priority

Thanks Jay commenting out line 504 has worked! I haven't experienced the fix undoing itself as yet either. 

Strange this though as my old SD version is working fine so the file is getting being deleted somehow when installing from scratch.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)