Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » Need Help: Error when deploy Greenhouse sample on RPi3b
Need Help: Error when deploy Greenhouse sample on RPi3b [message #1742613] Tue, 06 September 2016 07:34 Go to next message
Wang Murphy is currently offline Wang MurphyFriend
Messages: 6
Registered: September 2016
Junior Member
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 #1742687 is a reply to message #1742613] Tue, 06 September 2016 15:54 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin CabéFriend
Messages: 201
Registered: July 2009
Location: Toulouse, France
Senior Member

In the past I've found this resource to be helpful: https://www.raspberrypi.org/forums/viewtopic.php?p=675658#p675658
(you can jump directly to "Fixing the problem" Smile)


Re: Need Help: Error when deploy Greenhouse sample on RPi3b [message #1742729 is a reply to message #1742687] Wed, 07 September 2016 00:40 Go to previous messageGo to next message
Wang Murphy is currently offline Wang MurphyFriend
Messages: 6
Registered: September 2016
Junior Member
thanks for your reply, however the greenhouse publisher just NOT appear under 'services' menu, though the mqtt message publish ok, I can read the temprature from iot.eclipse.org sandbox
I read the kura log which gives a warning:

2016-09-07 09:29:10,449 [Component Resolve Thread (Bundle 6)] WARN o.e.k.c.c.ConfigurationServiceImpl - Either kura.service.pid null or service.pid org.eclipse.iot.greenhouse.publisher.GreenhousePublisher are null

I don't know what's wrong. I attached kura.log and kura-console.log (chopped)
  • Attachment: kura.log
    (Size: 53.00KB, Downloaded 59 times)
  • Attachment: kura-console.log
    (Size: 1.08KB, Downloaded 58 times)

[Updated on: Wed, 07 September 2016 01:58]

Report message to a moderator

Re: Need Help: Error when deploy Greenhouse sample on RPi3b [message #1742820 is a reply to message #1742729] Wed, 07 September 2016 21:48 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hello,

I can confirm there is a bug somewhere, I am checking into it. In the short term, you can get the Greenhouse service to show in the UI by logging into the OSGi console, stopping the bundle (org.eclipse.iot.greenhouse.publisher_0.1.0.SNAPSHOT), then starting it again. If you refresh your browser, the service should now show. Unfortunately, this will not persist a reboot. I will post back when I find the root issue.

Thanks,
--Dave
Re: Need Help: Error when deploy Greenhouse sample on RPi3b [message #1742821 is a reply to message #1742820] Wed, 07 September 2016 21:58 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hello,

It also appears to work if you uninstall the DP and re-install it. This persists across reboots. Again, when we root cause the issue I will post back here.

--Dave

[Updated on: Wed, 07 September 2016 22:12]

Report message to a moderator

Re: Need Help: Error when deploy Greenhouse sample on RPi3b [message #1742916 is a reply to message #1742821] Thu, 08 September 2016 14:57 Go to previous messageGo to next message
Wang Murphy is currently offline Wang MurphyFriend
Messages: 6
Registered: September 2016
Junior Member
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.
Re: Need Help: Error when deploy Greenhouse sample on RPi3b [message #1742968 is a reply to message #1742916] Thu, 08 September 2016 23:58 Go to previous messageGo to next message
Wang Murphy is currently offline Wang MurphyFriend
Messages: 6
Registered: September 2016
Junior Member
well, I see, on periodically greenhouse just sense temperature but not light state.
however act on light state just taking no effect, with 'gpio readall' the pin state is always 0, Pi4JGreenhouseSensorService.readLightState always return true.
Re: Need Help: Error when deploy Greenhouse sample on RPi3b [message #1743015 is a reply to message #1742968] Fri, 09 September 2016 13:22 Go to previous messageGo to next message
Wang Murphy is currently offline Wang MurphyFriend
Messages: 6
Registered: September 2016
Junior Member
Finally I've found the reason, the pi4j libs embedded in bundle 'org.eclipse.iot.greenhouse.sensors.raspberrypi' is not compatible with RPi3b.
So, I replaced the pi4j with the most recent version(1.1), the LED light is working properly at last!
Re: Need Help: Error when deploy Greenhouse sample on RPi3b [message #1780853 is a reply to message #1743015] Mon, 29 January 2018 09:03 Go to previous message
LI Yi is currently offline LI YiFriend
Messages: 37
Registered: June 2017
Member
Thank you very much , I have solved my problem!
Previous Topic:I2c bus
Next Topic:Permanent deployment of plugins to kura
Goto Forum:
  


Current Time: Wed Sep 19 05:35:55 GMT 2018

Powered by FUDForum. Page generated in 0.02126 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top