This page last changed on Dec 02, 2012 by palle500.

HI I have been used OR for about two weeks now and have added 1-Wire temp-sensors that works well but if the owserver goes down the local controller stops due to an exceptions in the sensor reading if not the owserver respond!

The biggest problem are that other things continue to work (clock, WEB display etc) and also the temperature values just freeze! Not showing N/A as usual if some I had some other 1-Wire reading problems!

I run the owserver on Raspberry Pi and the controller on a W7 laptop.

Any one who knows how to take care about this exception and just do a time out and send N/A as temperature value as long the owserver not respond?

/Palle500


OneWireCommand.class (application/octet-stream)
OneWireCommand$1.class (application/octet-stream)

Which version of the controller are you using?
Can you try and use the 2-1-0-DeveloperSnapshot.

Posted by mredeker at Dec 03, 2012 08:20

Dear Marcus,
I use the official verson 2.01 and don't know how to find any newer beta versions (i'm new to Java and are Windows programmer in Delphi, C, asssembler and some embedding systems). I have been searching in the forum for some guides how to find/use the latest online designer and local controller. I don't run any Java development tools so I can't compile the latest source code.

!-Wire log looks like this:
ERROR 2012-12-02 22:47:02,151 (1-WIRE): OneWire IO error, unable to read from OWSERVER.
java.net.UnknownHostException: OwTemp.lan
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at org.owfs.jowfsclient.internal.OwfsClientImpl.connect(OwfsClientImpl.java:103)
at org.owfs.jowfsclient.internal.OwfsClientImpl.establishConnection(OwfsClientImpl.java:173)
at org.owfs.jowfsclient.internal.OwfsClientImpl.sendRequest(OwfsClientImpl.java:501)
at org.owfs.jowfsclient.internal.OwfsClientImpl.read(OwfsClientImpl.java:313)
at org.openremote.controller.protocol.onewire.OneWireCommand.read(OneWireCommand.java:131)
at org.openremote.controller.protocol.onewire.OneWireCommand.run(OneWireCommand.java:228)
at java.lang.Thread.run(Thread.java:662)

EDIT: I have found by trail and error that it works fine if the Owserver and the controller machine are on the same switch (fast response) but then I connect the Owserver to an ethernet power line coupler (bad speed) the problem show up approximatly after 1-5 minutes.
/Lars

Posted by palle500 at Dec 03, 2012 09:27

The 2-1-DeveloperSnapshot can be found here: http://sourceforge.net/projects/openremote/files/For%20Developers/OpenRemote%202.0%20%28Developer%20Releases%29/OpenRemote-Controller-2.1.0_Developer-Snapshot-20120920.zip/download

Posted by mredeker at Dec 03, 2012 09:34

Thanks Marcus,
Found some different files in this version. Started the new version and it works fine.
But I got the same problem if I disconnet the Owserver?

INFO 2012-12-03 10:45:23,070 : Registered sensor : Sensor (Name = 'TempA', ID =
'1120186', State Mappings: {})
INFO 2012-12-03 10:45:23,071 : Startup complete.
INFO 2012-12-03 10:45:23,072 : Controller Definition File Watcher for Default De
ployer started.
2012-dec-03 10:45:23 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
2012-dec-03 10:45:23 org.apache.catalina.startup.Catalina start
INFO: Server startup in 2898 ms
Exception in thread "Polling thread for sensor: TempA" java.lang.NullPointerException
at org.owfs.jowfsclient.internal.OwfsClientImpl.sendRequest(OwfsClientImpl.java:509)
at org.owfs.jowfsclient.internal.OwfsClientImpl.read(OwfsClientImpl.java:313)
at org.openremote.controller.protocol.onewire.OneWireCommand.read(OneWireCommand.java:139)
at org.openremote.controller.protocol.onewire.OneWireCommand.run(OneWireCommand.java:219)
at java.lang.Thread.run(Thread.java:662)java.lang.NullPointerException
at org.owfs.jowfsclient.internal.OwfsClientImpl.sendRequest(OwfsClientImpl.java:509)
at org.owfs.jowfsclient.internal.OwfsClientImpl.read(OwfsClientImpl.java:313)
at org.openremote.controller.protocol.onewire.OneWireCommand.read(OneWireCommand.java:139)
at org.openremote.controller.protocol.onewire.OneWireCommand.run(OneWireCommand.java:219)
at java.lang.Thread.run(Thread.java:662)

/Lars

Posted by palle500 at Dec 03, 2012 10:04

Ok, thanks for double checking against the latest version.
I will create a Jira issue and double check when I find some time.

Posted by mredeker at Dec 03, 2012 10:44

Please take the 2 files attached to this post and replace the files from the 2.1 DeveloperSnapshot
in the folder Controller-2-1/webapps/controller/WEB-INF/classes/org/openremote/controller/protocol/onewire.

This should create "N/A" sensor value and once owserver is running again show the correct value.
OneWireCommand.class
OneWireCommand$1.class

Posted by mredeker at Dec 03, 2012 22:38

Great job Marcus!
It now works perfectly. I tested it with 1 sec reading intervall with three 1-Wire temp sensors, no problem.
If I disconnet the Owserver N/A show up directly and then reconnected it show the temperature again and the values are changing, so it not a new bug

Again Gretfully thanks for your help.

I public here my way of do the scaling for my sensors. The differens against all the rules example I have fond on the forum are that i use IF to select all of my temp sensors and only do the converting once:

   
package org.openremote.controller.model.event

global org.openremote.controller.statuscache.CommandFacade execute;
global org.openremote.controller.statuscache.SwitchFacade switches;

import org.openremote.controller.protocol.Event;
import java.text.DecimalFormat;

// Fix nice temp format
rule "TempX"
when

  $tempSensorX:CustomState( source == "TempA" ) OR
  $tempSensorX:CustomState( source == "TempB" ) OR
  $tempSensorX:CustomState( source == "TempC" )

then

  $tempSensorX.setValue(formatDouble(Double.valueOf($tempSensorX.getValue()))+"\272c");  // Unicode for "Âșc"

end

function String formatDouble(double d) {
  return (new DecimalFormat("#,###.0")).format(d);
}

EDIT: Don't know why the "Unknown macro:" are added to my code example?
Could some one tell me how i insert code in this Wiki?
/Lars

Posted by palle500 at Dec 03, 2012 23:11

Glad to see that my fix works.
You have to surround your code with a {code} tag at the beginning and one at the end.

Posted by mredeker at Dec 04, 2012 08:02
Document generated by Confluence on Jun 05, 2016 09:29