Skip to content

Comments

[Worxlandroid] Initial contribution#16893

Open
clinique wants to merge 20 commits intoopenhab:mainfrom
clinique:worxlandroid
Open

[Worxlandroid] Initial contribution#16893
clinique wants to merge 20 commits intoopenhab:mainfrom
clinique:worxlandroid

Conversation

@clinique
Copy link
Contributor

@clinique clinique commented Jun 19, 2024

This binding is used since a while as a standalone - let's get it merged.

@clinique clinique requested a review from a team as a code owner June 19, 2024 13:00
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/worx-landroid-binding/95246/570

@jlaur jlaur added the new binding If someone has started to work on a binding. For a new binding PR. label Jun 19, 2024
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/worx-landroid-binding/95246/609

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/worx-landroid-binding/95246/619

Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing this binding. This is a partly review, i only looked at the documentation, thing structure and some metadata files. I'll continue my review when i find some more time.
I noticed an images folder, i guess that can be removed as they do not seem to be used anywhere.

@clinique clinique requested a review from lolodomo as a code owner September 7, 2024 12:51
@clinique clinique self-assigned this Sep 7, 2024
Comment on lines 19 to 28
<groupId>software.amazon.awssdk.iotdevicesdk</groupId>
<artifactId>aws-iot-device-sdk</artifactId>
<version>1.15.0</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk.crt</groupId>
<artifactId>aws-crt</artifactId>
<version>0.25.1</version>
</dependency>
</dependencies>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This binding performs some similar requests/response, so it should be possible to create them without these SDK's.
Could you remove these dependencies?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you be more explicit ? I'm afraid I did not get the meaning of your comment.
IIRW I tried to upgrade dependencies but it had major impact on code structure, so prefered to leave as it was.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to say that the SDK should not be used. Instead the httpclient can be used to perform the same api request/responses.

You could look at the salus binding that also holds a very light weight base class doing much of the SDK work without needing the actual SDK.

Due to problems of the past with size, upgrades and other issues we try to keep these SDK’s out of the codebase.

Copy link
Contributor Author

@clinique clinique Sep 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lsiepel : This is for Mqtt client of AWS IoT, I remember I failed to switch to another MQTT client (because of the need of a websocket for the authentication IIRW that was not available with available one). I'll have another look at it to be sure.

Copy link
Contributor

@lsiepel lsiepel Sep 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have not looked in depth on how the MQTT client and websocket / authentication work together. I just know that we tent not to accept these SDK's. For the salus binding we had a similar issue with the software.amazon.awssdk.crt package. A fix was found by some lightweight classes that implemented the authentication.
Hope you figure out how to get rid of the SDK with these suggestions, otherwise please post the specific problems you encounter and maybe we can find a fix together. If ultimately it seems not feasable, we can always merge it as is, but yeah really prefer not to..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find any problems so far with the URL encoder in the HiveMQ implementation, is that still a problem and why?

What I found after looking at the code:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried HiveMQ client in my eatly tentative. I do not find back what blocked me at the time but the result is I did not suceed in that way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find any problems so far with the URL encoder in the HiveMQ implementation, is that still a problem and why?

Did you read the linked comment? As that also points to: hivemq/hivemq-mqtt-client#643
Maybe @jpg0 can elaborate on the issue and if your suggestion is a workaround.
@clinique would it be possible for you to give it another try and describe where you encounter issues? It would be helpfull to either find a workaround or a decision on SDK usage.

Copy link
Member

@wborn wborn Aug 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As that also points to: hivemq/hivemq-mqtt-client#643

That issue is not very detailed as it doesn't tell exactly where the issue occurs.

Also I couldn't relate the code in that issue to actual HiveMQ Client APIs. 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I filed that issue quite a while ago. I have just tried to dig through this as I had originally come to the same conclusion as you, but could not make it work. I've managed to reduce it to the following code:

import java.net.URI;

class Main {
    public static void main(String[] args) throws Exception {
        String input = "x/y";
        URI uri = new URI(
            "wss", null, "host", 8080, "/test", input, null);
            
        //Try to output: x%2Fy
        System.out.println(uri.getRawQuery());
    }
}

In the above it creates a URI just like hivemq, then passes it on to Netty which extracts the raw query as you pointed out. The challenge is to get the string that Netty uses (and is returned by getRawQuery()) to be equal to x%2Fy (AWS explicitly checks the exact URI for sig validation, so it cannot be different at all). If you pass it unencoded (x/y) is remains this way, if you pass it encoded (x%2Fy) it double encodes it.

@lsiepel
Copy link
Contributor

lsiepel commented Nov 6, 2025

Can you rebase your branch, it would make it simpler for me to trouble shoot the dependency issue.

Signed-off-by: Gaël L'hopital <gael@lhopital.org>
Signed-off-by: Gaël L'hopital <gael@lhopital.org>
Signed-off-by: Gaël L'hopital <gael@lhopital.org>
Correcting pom.xml

Signed-off-by: Gaël L'hopital <gael@lhopital.org>
Signed-off-by: Gaël L'hopital <gael@lhopital.org>
Signed-off-by: Gaël L'hopital <gael@lhopital.org>
Signed-off-by: Gaël L'hopital <gael@lhopital.org>
Signed-off-by: Gaël L'hopital <gael@lhopital.org>
Signed-off-by: Gaël L'hopital <gael@lhopital.org>
Signed-off-by: Gaël L'hopital <gael@lhopital.org>
Signed-off-by: Gaël L'hopital <gael@lhopital.org>
Updated to 4.3 and two SAT corrections
Correcting pom.xml

Signed-off-by: Gaël L'hopital <gael@lhopital.org>
Signed-off-by: clinique <gael@lhopital.org>
Copilot review correction
Pom update to 5.0
Updated to 4.3 and two SAT corrections
Correcting pom.xml

Signed-off-by: Gaël L'hopital <gael@lhopital.org>
Signed-off-by: clinique <gael@lhopital.org>
Signed-off-by: clinique <gael@lhopital.org>
Signed-off-by: clinique <gael@lhopital.org>
Signed-off-by: clinique <gael@lhopital.org>
Signed-off-by: gael@lhopital.org <gael@lhopital.org>
@clinique
Copy link
Contributor Author

clinique commented Nov 7, 2025

@lsiepel : rebased

Signed-off-by: gael@lhopital.org <gael@lhopital.org>
Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rebase also caused this to be missing. I added this locally, but now it claims it needs org.graalvm.sdk.
According to maven, this is an optional module. Do you know if this is essential or not? I can adapt the osgi package. I also wonder what we did wrong with the previous test as it was confirmed, but now we have these issues.

Signed-off-by: gael@lhopital.org <gael@lhopital.org>
@clinique clinique requested a review from lsiepel November 7, 2025 15:20
@lsiepel
Copy link
Contributor

lsiepel commented Nov 7, 2025

^ what are your thoughts about graal?

@clinique
Copy link
Contributor Author

clinique commented Nov 9, 2025

^ what are your thoughts about graal?

I discover this dependency with your message. Do you think it could have been introduced with the version update ?

@lsiepel
Copy link
Contributor

lsiepel commented Nov 9, 2025

^ what are your thoughts about graal?

I discover this dependency with your message. Do you think it could have been introduced with the version update ?

Yes, it was introduced with version upgrade

@clinique
Copy link
Contributor Author

clinique commented Nov 9, 2025

^ what are your thoughts about graal?

I discover this dependency with your message. Do you think it could have been introduced with the version update ?

Yes, it was introduced with version upgrade

Is it worth trying to package it in osgii ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new binding If someone has started to work on a binding. For a new binding PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants