Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove spaces from front/back of credentials. (was MQTT Error "Not Support") #114

Closed
mikebannan opened this issue Jan 27, 2025 · 3 comments
Labels
question Further information is requested

Comments

@mikebannan
Copy link

Describe Your Problem:

MQTT hasn't connected for (at least) several days. Here's the log. Is this the usual temporary non-connection you're used to?

Logs:

[27/01/2025, 11:40:14] [YoLink] Login to YoLink API with credentials from config
[27/01/2025, 11:40:14] [YoLink] [verbose] SENDING:
grant_type=client_credentials&client_id=+ua_xxx&client_secret=sec_v1_xxx
[27/01/2025, 11:40:14] [YoLink] [verbose] RECEIVED:
{"state":"error","msg":"Not Support"}
[27/01/2025, 11:40:14] [YoLink] Retry bound tryLogin due to error, try again in 45 second(s): YoLink API error: Not Support [lite]

Plugin Config:

{
    "name": "YoLink",
    "platform": "YoLink",
    "tokenURL": "https://api.yosmart.com/open/yolink/token",
    "apiURL": "https://api.yosmart.com/open/yolink/v2/api",
    "mqttPort": 8003,
    "userAccessId": " ua_xxx",
    "secretKey": "sec_v1_xxx",
    "refreshAfter": 14500,
    "verboseLog": true,
    "liteLog": true,
    "allDevices": false,
    "excludeTypes": [
        "Hub",
        "SpeakerHub"
    ],
    "includeTypes": [
        "MotionSensor"
    ],
    "enableExperimental": false,
    "devices": [
        {
            "deviceId": "xxx",
            "config": {
                "name": "Mailbox Motion Sensor"
            }
        }
    ]
}

Screenshots:

Environment:

  • Plugin Version:
  • Homebridge Version:
  • Node.js Version:
  • NPM Version:
  • Operating System:
@mikebannan mikebannan added the question Further information is requested label Jan 27, 2025
@dkerr64
Copy link
Owner

dkerr64 commented Jan 28, 2025

I cannot explain this. It looks like the YoLink server is receiving the MQTT login request and rejecting it, but I don't know why. You could try generating new user access ID and secret key, but its a wild guess.

I just restarted my plugin to see if I am able to cleanly connect to MQTT and it worked fine. My log (extending back 12 days) shows no errors from MQTT (but plenty of 00201 errors, unrelated of course, but a known issue with YoLink's protocol).

@mikebannan
Copy link
Author

Ugh. I had been getting the 00201 errors, and so generated new UAID and Secret Key. And inserted a space in front of the UAID. (My clue was the '+' in the SENDING log segment client_id=+ua_xxx&client_secret=sec_v1_xxx.)

The connection is fine now. Sorry for the noise.

I guess we now know that invalid credentials return the error Not Support.

@dkerr64
Copy link
Owner

dkerr64 commented Jan 29, 2025

I'm going to reopen this issue, because this is something I can fix in the plugin... striping all spaces from front/back of the access ID and secret. I'll close this again once I make that change.

@dkerr64 dkerr64 reopened this Jan 29, 2025
@dkerr64 dkerr64 changed the title MQTT Error "Not Support" Remove spaces from front/back of credentials. (was MQTT Error "Not Support") Jan 29, 2025
@dkerr64 dkerr64 closed this as completed Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants