Need Help: Error when deploy Greenhouse sample on RPi3b [message #1742613] |
Tue, 06 September 2016 03:34  |
Eclipse User |
|
|
|
I follow http://iot.eclipse.org/java/tutorial/ to deploy greenhouse sample on my RaspberryPi 3 model B, with Kura2.0.0 and jdk8.
After the package installed, I cannot see 'greenhouse publisher' under 'services' , I examined kura log and see below output:
[code]
java.io.IOException: Error writing to /dev/i2c-1 at address 0x40 to address 0x3. Got -20001.
it seems like some wrong with i2c write. I had setup i2c according to this instruction learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c, and command ' i2cdetect -y 1' output:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
so any hint about what'a wrong? thanks a lot in advance.
|
|
|
|
|
|
|
Re: Need Help: Error when deploy Greenhouse sample on RPi3b [message #1742916 is a reply to message #1742821] |
Thu, 08 September 2016 10:57   |
Eclipse User |
|
|
|
Hello David,
indeed after I stop and re-start bundle it appears under 'services' menu.
Another issue, the toggle on light doesn't take effect at all, so I download greenhouse source code and found missing read light code in place below (I added the missing code) in 'Pi4JGreenhouseSensorService.java'
_handle = _scheduledThreadPoolExecutor.scheduleAtFixedRate(
new Runnable() {
@Override
public void run() {
try {
float newTemperature = readTemperature();
if (Math.abs(_temperatureRef - newTemperature) > .1f) {
notifyListeners("temperature",
newTemperature);
_temperatureRef = newTemperature;
}
[b]boolean newLightState = readLightState();
if(newLightState != _lightState) {
notifyListeners("light", newLightState);
_lightState = newLightState;
}[/b]
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}, 0, 5000, TimeUnit.MILLISECONDS);
after deploy to RPi, the same issue there, read light state is always returning true, however the LED is off, and I checked the pin state with 'gpio readall', the pin state if off indeed.
I don't know what's wrong there.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05746 seconds