Skip to content

Remove async from signature method#120

Open
bytespider wants to merge 1 commit intodevelopfrom
119-empty-response-from-msl120
Open

Remove async from signature method#120
bytespider wants to merge 1 commit intodevelopfrom
119-empty-response-from-msl120

Conversation

@bytespider
Copy link
Copy Markdown
Owner

Transport.send() was calling an async method Message.sign() without await. Since the sign method is synchronous, async has been removed from the method signature.

@bytespider
Copy link
Copy Markdown
Owner Author

@oblivioncth Do you have time to see if this fix resolves the issue you are experiencing?

@oblivioncth
Copy link
Copy Markdown

Yea just give me a little bit. Obviously my bulb isn't working via MQTT right now even after setting up with the old version, but #57 implies I may have luck if I provide a key/user id. There was another issue I don't remember where you even implies never versions no longer default to a blank key so I imagine 1.0.16 may be one of those.

But sure I can see if this at least lets me use the latest version to perform the setup and get past the empty response issue.

@oblivioncth
Copy link
Copy Markdown

#103 is what I was referring to. The README still says that "" is the default for the key, but packages/cli/src/meross-setup.ts does show a default of "meross" as you mentioned there. Not sure if the default was ever updated to apply correctly or if the tool still sends a blank key due to some other logic.

@bytespider
Copy link
Copy Markdown
Owner Author

That's right, older versions of the Meross firmware would allow a blank key so that's what I used. But newer firmware required something, so I updated the defaults. I'll update the documentation to make sure it says the right thing.

@oblivioncth
Copy link
Copy Markdown

$ git checkout 119-empty-response-from-msl120
$ npm install
$ npm run build
$ LOG_LEVEL=debug  node packages/cli/dist/meross-info.js
2026-05-02 17:38:54 DEBUG: Transport initialized. Credentials: {"userId":0,"key":"meross"} {"name":"transport"}
2026-05-02 17:38:54 DEBUG: HTTPTransport initialized with URL: http://10.10.10.1/config {"name":"http"}
2026-05-02 17:38:54 DEBUG: Setting transport for device 00000000000000000000000000000000 to HTTPTransport {"name":"device","transport":{"id":"http://10.10.10.1/config","timeout":10000,"credentials":{"userId":0,"key":"meross"},"url":"http://10.10.10.1/config"}}
2026-05-02 17:38:54 INFO: Fetching device information for 00000000000000000000000000000000 {"name":"device"}
2026-05-02 17:38:54 DEBUG: Signing message a945b57eea3c466ab6a305c4ae0055e8 {}
2026-05-02 17:38:54 HTTP: POST http://10.10.10.1/config {"Content-Type":"application/json; charset=utf-8","Accept":"application/json"} {"header":{"method":"GET","namespace":"Appliance.System.All","from":"http://10.10.10.1/config","messageId":"a945b57eea3c466ab6a305c4ae0055e8","timestamp":1777757935,"sign":"ad80a5890ade1b1f1b1dfa6f9bb4526f"},"payload":{}} {"name":"request","requestId":"a945b57eea3c466ab6a305c4ae0055e8","request":{"method":"POST","headers":{"Content-Type":"application/json; charset=utf-8","Accept":"application/json"},"body":"{\"header\":{\"method\":\"GET\",\"namespace\":\"Appliance.System.All\",\"from\":\"http://10.10.10.1/config\",\"messageId\":\"a945b57eea3c466ab6a305c4ae0055e8\",\"timestamp\":1777757935,\"sign\":\"ad80a5890ade1b1f1b1dfa6f9bb4526f\"},\"payload\":{}}"}}
request to http://10.10.10.1/config failed, reason: Parse Error: Missing expected CR after response line
Error stack:
FetchError: request to http://10.10.10.1/config failed, reason: Parse Error: Missing expected CR after response line
    at ClientRequest.<anonymous> (file:///home/chris/Downloads/Meross/node_modules/node-fetch/src/index.js:108:11)
    at ClientRequest.emit (node:events:531:35)
    at emitErrorEvent (node:_http_client:108:11)
    at Socket.socketOnData (node:_http_client:624:5)
    at Socket.emit (node:events:531:35)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at Readable.push (node:internal/streams/readable:392:5)
    at TCP.onStreamRead (node:internal/stream_base_commons:189:23)⏎ 

:(

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants