[Sense HAT driver] Unable to read to I2C device
See original GitHub issue-
Component affected:
- Distribution
- Installer name:
kura_3.2.0_raspberry-pi-2-3-nn_installer.deb - Platform: Raspberry Pi 3
- Kura version affected: 3.2.0
- Java version:
openjdk version "1.8.0_171" OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-1~deb9u1-b11) OpenJDK Client VM (build 25.171-b11, mixed mode) - Host OS: Raspbian Stretch Lite
- Installer name:
- Add-ons
- Name:
org.eclipse.kura.example.driver.sensehat - Version: 1.0.0
- URL: https://marketplace.eclipse.org/content/sensehat-example-driver-eclipse-kura
- Name:
- Distribution
-
Textual description of the issue:
I am trying to use the Sense HAT driver to read data from the environmental sensors and send it to a Kapua instance. I installed the driver mentioned in the form but when I try to add a new driver I get some errors (see kura.log) saying that it is not possible to read or write to the I2C device.
I have already enabled the I2C kernel module using the raspi-config tool and I confirm that the Sense HAT works because I am able to measure using the python library.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
sense hat problem please help - Raspberry Pi Forums
with the sense hat root@raspberrypi:~# hwclock -r hwclock: ioctl(RTC_RD_TIME) to /dev/rtc0 to read the time failed: Invalid argument
Read more >Raspberry Pi 4 I2C bus not working correctly - Stack Overflow
I tried to use the Raspberry Pi Sense HAT and the SSD1306 OLED display and the PCA9685 Servo Driver with the I2C Bus....
Read more >Writing to register on I2C device, returns device busy
I am trying to write data to a register on an I2C chip from the Raspberry Pi, when I use i2cdetect I get...
Read more >RaspberryPi 3 Model B+ and I2C issue - Wolfram Community
Hello,. I have been struggling with SenseHAT and Mathematica. First Mathematica was not able to find SenseHAT at all even than I followed...
Read more >[PATCH 0/5] Raspberry Pi Sense HAT driver - kernel
[PATCH 1/5] drivers/mfd: sensehat: Raspberry Pi Sense HAT core driver ... < 0) { + dev_err(sensehat->dev, "failed to read from device"); ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Replicated by installing the
openjdk-8-jre-headlesspackage which provides the JVM version you reported. In my setup the driver works if theoracle-java8-jdkpackage is installed, which provides the following java version:There might some issue regarding using the
jdk.diolibrary either withopenjdkitself or with some JVM version more recent than1.8.0_65.Moreover, I’ve found this by digging into the
jdk.diosource in Kura repo:The
com.oracle.dio.impl.Handle.tryLock(int)method, which is called in the code path that leads to the reported exception has the following signature [1]:And this is its native implementation [2]:
The native function returns
voidinstead of ajboolean, and its implementation looks incomplete. This is quite suspicious.[1] https://github.com/eclipse/kura/blob/develop/target-platform/jdk.dio-parent/src/dev/src/se/classes/com/oracle/dio/impl/Handle.java#L41 [2] https://github.com/eclipse/kura/blob/develop/target-platform/jdk.dio-parent/src/dev/src/se/native/com/oracle/dio/dio_common.cpp#L458
Add the necessary documentation