fruggy83 / openocean

27 stars 11 forks source link

Implement retry-policy for missing answers #58

Open fruggy83 opened 5 years ago

fruggy83 commented 5 years ago

Discussion here

I will implement this

fruggy83 commented 5 years ago

Hi @bakkerv,

I have implemented a retry-policy for D2 things. You find a compiled version in the draft 2.5.0.2 release. Would be fine, if you could test this enhancement.

Best regards Daniel

bakkerv commented 5 years ago

Hi @fruggy83 ,

Sure, I'm glad to. I'm trying to get everything build again (it has been a while since I compiled the sources :))

Or do you have a prebuild version? I can only find the 2.5.0.1 release.. Btw: is this build compatible with the official openhab plugin? Or is the plugin-id different (openocean vs enocean)?

fruggy83 commented 5 years ago

Hi @bakkerv,

sorry forgot to publish the release. You should find a pre 2.5.0.2 release now.

Best regards Daniel

bakkerv commented 5 years ago

Hi @fruggy83,

It was a bit fiddling around, but after getting the 2.5.0.2 binding installing, I can confirm it works like a charm. Both the update after using my rocker and sending the command via openhab the light now switches perfectly. (Ok, I've only tested it for a couple of minutes, but no problems so far). Again, kudos!

fruggy83 commented 5 years ago

Hi @bakkerv,

great to hear and thanks for this info. If it does not make any problems in the next days, I will build an official release and push it back into the openhab repo.

Best regards Daniel

bakkerv commented 5 years ago

Hmm, Just added my second channel of the same switch to OpenHab, some problems do seem to arise..

2019-01-21 22:41:59.129 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:41:59.230 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:41:59.332 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:41:59.344 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Sending data, type RADIO_ERP1, payload D2011E01FFA7EF820001FFD3E301FF00 2019-01-21 22:41:59.365 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - RESPONSE with code RET_OK payload 00 received 2019-01-21 22:41:59.434 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:41:59.536 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:41:59.614 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Sending data, type RADIO_ERP1, payload D2011E01FFA7EF820001FFD3E301FF00 2019-01-21 22:41:59.637 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - RESPONSE with code RET_OK payload 00 received 2019-01-21 22:41:59.639 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:41:59.740 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:41:59.842 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:41:59.884 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Sending data, type RADIO_ERP1, payload D2011E01FFA7EF820001FFD3E301FF00 2019-01-21 22:41:59.910 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - RESPONSE with code RET_OK payload 00 received 2019-01-21 22:41:59.945 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:42:00.048 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:42:00.151 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:42:00.154 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Sending data, type RADIO_ERP1, payload D2011E01FFA7EF820001FFD3E301FF00 2019-01-21 22:42:00.180 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - RESPONSE with code RET_OK payload 00 received 2019-01-21 22:42:00.253 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:42:00.356 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:42:00.424 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Sending data, type RADIO_ERP1, payload D2011E01FFA7EF820001FFD3E301FF00 2019-01-21 22:42:00.438 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - RESPONSE with code RET_OK payload 00 received 2019-01-21 22:42:00.459 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:42:00.561 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:42:00.665 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:42:00.694 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Sending data, type RADIO_ERP1, payload D2011E01FFA7EF820001FFD3E301FF00 2019-01-21 22:42:00.709 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - RESPONSE with code RET_OK payload 00 received 2019-01-21 22:42:00.773 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:42:00.876 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:42:00.964 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Sending data, type RADIO_ERP1, payload D2011E01FFA7EF820001FFD3E301FF00 2019-01-21 22:42:00.979 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:42:00.982 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - RESPONSE with code RET_OK payload 00 received 2019-01-21 22:42:01.084 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback 2019-01-21 22:42:01.187 [DEBUG] [ernal.transceiver.EnOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback

I guess there is no limit on the number of retries, so it seems it is retrying forever..?

fruggy83 commented 5 years ago

Hi @bakkerv,

yes I am trying to send the last message until I receive an answer or you send another message (which will then be repeated). If your actuator is unreachable this will last forever. Maybe I restrict this to 10 (or user configurable?) times. I am also not cancelling this repeater when the thing gets disposed. Needs some rework.

Thanks for these hints Daniel

fruggy83 commented 5 years ago

HI @bakkerv,

I just updated the pre release. I added a retry counter and clean up the retry future on thing dispose now. Would be nice if you could test it again.

Best regards Daniel

bakkerv commented 5 years ago

Hi @fruggy83,

sure! Could you build a release for me?

Best regards, Vincent

bakkerv commented 5 years ago

Just out of curiosity, but how do you build the binary? I just cannot get the openhab-core and add-ons compiled/installed, which are required dependencies...

bakkerv commented 5 years ago

Hi @fruggy83,

Using vagrant and a centos 7 VM i was able to build the binary myself. I've tested it. I can confirm the retry counter works.. Unfortunately, the channel does not switch off using the D2 message. The A5 however seems to work. I'm a bit puzzled why the D2 does not work...

fruggy83 commented 5 years ago

Hi @bakkerv,

hm... 🤔 I have currently implemented it just for the D2 profile. I will look if I find a problem.