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

Issue with new ewpe ac devices #23

Open
NickB1 opened this issue Aug 16, 2021 · 5 comments
Open

Issue with new ewpe ac devices #23

NickB1 opened this issue Aug 16, 2021 · 5 comments

Comments

@NickB1
Copy link

NickB1 commented Aug 16, 2021

Hi,

Thanks for the great work on this program.
I'm trying to read out two ac units which have been installed today with ewpe wifi modules.
Unfortunately I get a cipher error:

> [email protected] start
> node index.js

2021-08-16T19:36:47.375Z [info]: Trying to connect to MQTT server mqtt://127.0.0.1 ...
2021-08-16T19:36:48.318Z [info]: Successfully connected to MQTT server
2021-08-16T19:36:48.483Z [info]: Socket server is listening on 0.0.0.0:36315
2021-08-16T19:36:48.489Z [info]: Scanning network 192.168.1.255 for available devices...
node:internal/crypto/cipher:193
  const ret = this[kHandle].final();
                            ^

Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipheriv.final (node:internal/crypto/cipher:193:29)
    at decrypt (/opt/ewpe-smart-mqtt/app/encryptor.js:15:48)
    at Connection.handleResponse (/opt/ewpe-smart-mqtt/app/connection.js:110:26)
    at Socket.emit (node:events:394:28)
    at UDP.onMessage [as onmessage] (node:dgram:931:8) {
  library: 'digital envelope routines',
  function: 'EVP_DecryptFinal_ex',
  reason: 'wrong final block length',
  code: 'ERR_OSSL_EVP_WRONG_FINAL_BLOCK_LENGTH'
}
npm notice
npm notice New minor version of npm available! 7.15.1 -> 7.20.6
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.20.6
npm notice Run npm install -g [email protected] to update!
npm notice

Any idea what the problem could be?
Maybe something changed in the communication protocol of the new devices?

Best regards

@jodewee
Copy link

jodewee commented Apr 14, 2022

same issue over here

@jodewee
Copy link

jodewee commented May 18, 2022

@NickB1 did you make any progress on thin one?

@find-a-good-nickname
Copy link

I got the same error exactly.

npm version: 8.18.0
node version: 16.13.1

`pi@raspberrypi:~/ewpe-smart-mqtt $ npm start

[email protected] start
node index.js

2022-08-24T04:41:41.770Z [info]: Trying to connect to MQTT server mqtt://localhost ...
2022-08-24T04:41:41.968Z [info]: Successfully connected to MQTT server
2022-08-24T04:41:41.988Z [info]: Socket server is listening on 0.0.0.0:37104
2022-08-24T04:41:41.989Z [info]: Scanning network 192.168.10.71 for available devices...
2022-08-24T04:41:42.030Z [info]: New device found: (mac: 502cc6bc13e0), binding...
2022-08-24T04:41:42.048Z [info]: New device bound: (192.168.10.71:7000)
2022-08-24T04:41:42.052Z [info]: MQTT message received: ewpe-smart/502cc6bc13e0 {cid:,bc:gree,brand:gree,catalog:gree,mac:502cc6bc13e0,mid:10001,model:gree,name:,lock:0,series:gree,vender:1,ver:V3.0.0,address:192.168.10.71,port:7000,key:oxk22YP1uj0S97fd}
node:internal/crypto/cipher:193
const ret = this[kHandle].final();
^

Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
at Decipheriv.final (node:internal/crypto/cipher:193:29)
at decrypt (/home/pi/ewpe-smart-mqtt/app/encryptor.js:15:48)
at Connection.handleResponse (/home/pi/ewpe-smart-mqtt/app/connection.js:110:26)
at Socket.emit (node:events:402:35)
at UDP.onMessage [as onmessage] (node:dgram:939:8) {
library: 'digital envelope routines',
function: 'EVP_DecryptFinal_ex',
reason: 'bad decrypt',
code: 'ERR_OSSL_EVP_BAD_DECRYPT'
}

`

@Xenomes
Copy link

Xenomes commented Oct 17, 2022

I made a patch, hopefully the owner will accept the pull requests.

@stas-demydiuk
Copy link
Owner

Updated the app, so it will not crash in case of decrypt failure and will just print the error to the console, I hope it will help with the issue

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

No branches or pull requests

5 participants