Skip to content

MQTT gateway doesn't work with Thai API #44

Description

@JumpLao

Seem like ASN1 schema for Thai API is different from other. Decoder cannot decode "net.heberling.ismart.asn1.v1_1.entity.VinInfo.brandName". Error message show "out of bound" when try to decode brandName

Screenshot 2566-06-28 at 11 20 36

Activity

  1. JumpLao commented on Jun 28, 2023

    @JumpLao
    Author

    I try to debug decoder with saic-java-api-gateway. It seem that decoder cannot decode login response correctly using MP_UserLogginResp. token part of MP_UserLogginResp is unreadable may be that why whole application body cannot be decode.
    Screenshot 2566-06-28 at 14 57 51

  2. mschmiedel commented on Jul 3, 2023

    @mschmiedel
    Contributor

    Hi,

    I tried to reproduce the error using your message from the picture in a unit test, but I cannot manage to format the string properly. Could you post the message that is logged as plain text please?

  3. linked a pull request that will close this issueCompatibility with Thai API #47on Jul 5, 2023
  4. tisoft commented on Jul 5, 2023

    @tisoft
    Collaborator

    I found the difference. The Thai API uses the same API versions as the European App. But unfortunately SAIC added a languageType field in the European app, without increasing the version number. Please try out #47. The login should work there, but there might be more problems.

  5. JumpLao commented on Jul 5, 2023

    @JumpLao
    Author

    Login response decode successfully but there is no applicationData. I found that there is an error message in response body.

    Screenshot 2566-07-05 at 17 53 24 Screenshot 2566-07-05 at 18 00 13

    errorMessage toString: [B@1f9354e8

  6. tisoft commented on Jul 5, 2023

    @tisoft
    Collaborator

    The error message is a byte array, but it contains string data. You should be able to do new String(loginResponseMessage.getBody().getErrorMessage(), StandardCharsets.UTF_8) to get the message.

  7. JumpLao commented on Jul 5, 2023

    @JumpLao
    Author

    The error message is a byte array, but it contains string data. You should be able to do new String(loginResponseMessage.getBody().getErrorMessage(), StandardCharsets.UTF_8) to get the message.

    I'm just forgot to change API URI to Thailand SAIC URI. Currently, the Login API is working fine, but the other APIs are not functioning properly. I will now attempt to debug the other APIs one by one

  8. JumpLao commented on Jul 5, 2023

    @JumpLao
    Author

    It appears that the MQTT gateway is using the API asn1 schema v2.1, but for Thailand, the API uses asn1 schema v2.0. You can find more information about this at the following URI: https://iov-tap.mgthai.com/TAP.Web/ota.mpv20.
    Screenshot 2566-07-05 at 21 41 54

  9. tisoft commented on Jul 5, 2023

    @tisoft
    Collaborator

    I have added some parts of the ASN.1 schema for version 2.0. Could you try it with them?

  10. tisoft commented on Oct 23, 2023

    @tisoft
    Collaborator

    @JumpLao Could you try the changes in #47 If they work I could integrate them in the release versions.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions