Code Monkey home page Code Monkey logo

ebus's People

Contributors

csowada avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ebus's Issues

Telegram rejected when masterTelegram CRC=AA

Hello @csowada,
Regarding the problem I mentioned on Feb 23 in the OpenHAB eBUS thread, i.e. this message is resolved:
"FF";"50";"B5 13";"03 04 22 00 F4 00 0A 22 00 32 00 00 00 00 00 00 00 97 00 AA";GET > custom-50.custom.podlogowe_zadana
while this one is not:
"FF";"50";"B5 13";"03 04 15 00 55 00 0A 15 00 19 00 0A 00 90 01 78 00 C7 00 AA";

I was able to find out that in the matchesCommand method of the EBusCommandRegistry class, the masterTelegram is built differently in both cases. In the latter case, the following masterTelegram is built:
00 00 B5 13 03 04 15 00 A9 01
Looking at the 2 last bytes, it seems that the computed CRC value is AA and the AA byte escaping makes the whole masterTelegram one byte longer. The logic which gets the slave response length from the message looks one byte further (slaveLenPos is incremented by one). In the end, slaveLen equals 21 (should be 10), computedSlaveLen is 10 (correct), slaveLenPos is 11 (should be 10) and the message is rejected.
I don't think I know the code well enough to propose the final fix, I wouldn't like it to be a dirty hack :-) I hope the information I provided will help you do that properly.

How can I send-commands and receive values

Moin,
first: thx, for this library...but I have two Question:

I use the following code (from tag: ebus-dist1.0.0) and the ebus sends a lot of data, but how can I send a command to recieve e.g. the "solar-temp" or "Aussentemperatur"?

IEBusConnection connection = new EBusSerialNRJavaSerialConnection(portName);
EmulatorCapture captureWriter = new EmulatorCapture(captureFile);
// Beide zusammenbringen
connection = new EBusCaptureProxyConnection(connection, captureWriter);
		
EBusController controller = new EBusController(connection);
EBusHighLevelService service = new EBusHighLevelService(controller);
EBusConfigurationJsonReader jsonCfgReader = new EBusConfigurationJsonReader(service.getConfigurationProvider());

File filex = new File("src/main/resources/common-configuration.json");
jsonCfgReader.loadConfigurationFile(filex.toURL());		

controller.start();
...

Which version of the ebus-lib should I use? The "dist-1.0.0" or the "master"?
Id had some problems to compile the master-source, so I switched to dist. But if you say, it is better to use the "master", I will try to compile again.

BR
Olli

buildMasterTelegram crashes with NullPointerException

Item "CGB2_Heizung_Programm" is linked to channel "bm2_heating_program-heating-circuit#program". Receiving data from Wolf-CGB2 is working fine without error, but sending data results always in a NullPointerException.

Item definition:

String CGB2_Heizung_Programm  "Heizung Programm: [%s]" {channel="ebus:bm2:home1:85:bm2_heating_program-heating-circuit#program"}

Thing definition:

Bridge ebus:bridge:home1 "eBUS Bridge (serial)" @ "eBus" [
    serialPort="/dev/ttyUSB0",
    masterAddress="FF",
    advancedLogging=false,
    serialPortDriver="nrjavaserial",
    parsers="common,wolf-bm2,wolf-cgb2,wolf-mm1"]
{
    Thing bm2 85 "Wolf BM-2 (0x85)" [ slaveAddress="85" , masterAddress="80"]
    {
        Channels:
        Type bm2_heating_program-heating-circuit_program : bm2_heating_program-heating-circuit#program
    }
}

Error Log:

12:34:17.228 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'CGB2_Heizung_Programm' received command 0
12:34:17.233 [INFO ] [arthome.event.ItemStatePredictedEvent] - CGB2_Heizung_Programm predicted to become 0
12:34:17.252 [INFO ] [smarthome.event.ItemStateChangedEvent] - CGB2_Heizung_Programm changed from 2 to 0
12:34:17.285 [WARN ] [e.csdev.ebus.command.EBusCommandUtils] - Replace slave target address 85 with valid master address !
12:34:17.289 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ebus.internal.handler.EBusHandle@e21c99': null
java.lang.NullPointerException: null
        at de.csdev.ebus.command.EBusCommandUtils.buildMasterTelegram(EBusCommandUtils.java:361) ~[?:?]
        at de.csdev.ebus.command.EBusCommandUtils.buildMasterTelegram(EBusCommandUtils.java:299) ~[?:?]
        at de.csdev.ebus.client.EBusClient.buildTelegram(EBusClient.java:160) ~[?:?]
        at org.openhab.binding.ebus.internal.utils.EBusClientBridge.generateSetterTelegram(EBusClientBridge.java:197) ~[?:?]
        at org.openhab.binding.ebus.internal.handler.EBusHandler.handleCommand(EBusHandler.java:316) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_152]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_152]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_152]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_152]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
        at com.sun.proxy.$Proxy135.handleCommand(Unknown Source) [?:?]
        at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:74) [bundleFile:?]
        at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_152]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_152]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_152]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_152]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_152]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_152]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_152]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_152]

openHAB: 2.5.1-2
eBUS Binding: 2.5.1-4
Java: Zulu 1.8.0_152 (same results with Oracle-Java-8)

My last working (send and receive) eBUS release is: 2.4.0.RC4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.