question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trouble with I2C

See original GitHub issue

Hi,

I try to get a stripped-down version of the example for I2C from the PI4J site (https://pi4j.com/documentation/io-examples/i2c/) running.

The main method starts with the following statements:

		Context pi4j = Pi4J.newAutoContext();
		I2CProvider i2CProvider = pi4j.provider("linuxfs-i2c");

Unfortunately I get teh following exception when trying to get the I2CProvider:

Exception in thread "main" com.pi4j.provider.exception.ProviderNotFoundException: Pi4J provider [linuxfs-i2c] could not be found.  Please include this 'provider' JAR in the classpath.
        at com.pi4j@2.0-SNAPSHOT/com.pi4j.provider.impl.DefaultRuntimeProviders.get(DefaultRuntimeProviders.java:238)
        at com.pi4j@2.0-SNAPSHOT/com.pi4j.provider.impl.DefaultProviders.get(DefaultProviders.java:147)
        at com.pi4j@2.0-SNAPSHOT/com.pi4j.context.Context.provider(Context.java:240)
        at de.rziegaus.ATECC608A@1.00/de.rziegaus.SimpleATECC608A.main(SimpleATECC608A.java:18)

So I added the dependency for linuxfs-i2c, but now I get a different problem with the program. Now I get an exception saying

Error occurred during initialization of boot layer
java.lang.LayerInstantiationException: Package lib.armhf in both module com.pi4j.library.pigpio and module com.pi4j.library.linuxfs

If I remove the jar files concerning pigpio (library and plugin) manually everything works fine - at least I don’t get any errors when I run the stripped-down version of the program.

What concerns me a bit - do I really have to choose between either pigpio and linuxfs-i2c? Or is there a workaround?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rz259commented, Aug 6, 2021

Ok, the problem is resolved. I have downloaded the latest snapshot and now it works.

Thanks for your help,

Rudi

0reactions
eitchcommented, Aug 6, 2021

Ahh, good to know! I was hoping to find some time this weekend to test it out again. But now not necessarily.

On Fri, Aug 6, 2021, 17:03 rz259 @.***> wrote:

Closed #121 https://github.com/Pi4J/pi4j-v2/issues/121.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Pi4J/pi4j-v2/issues/121#event-5123404081, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB35BXUIF3LW5ZOO3ESI2TT3P2TBANCNFSM5BG3PMSA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Problems In Systems - I2C-Bus.org
Often, problems in I2C bus systems have a simple cause and can easily be verified by checking with simple equipment. Is there a...
Read more >
Troubleshooting I2C - Texas Instruments
This application report describes the I2C protocol and provides guidelines on debugging a missing acknowledgment, selecting the pullup resistors, or meeting the ...
Read more >
common problems and errors with using I2C - What every ...
A problem arises though when both masters are trying to read from the same slave device. When this happens it is possible that...
Read more >
What Could Go Wrong? I2C Edition - Hackaday
Although I2C does reduce the number of signal wires you need, it gets dangerous when you have more than a handful of devices...
Read more >
Problem with I2C
It works well, but I need to do communication errorless - between i2c slave and i2c master is cable - about 30cm. There...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found