skydiver / ewelink-api

eWeLink API for JavaScript
https://www.npmjs.com/package/ewelink-api
MIT License
264 stars 108 forks source link

{ error: 500, msg: 'SyntaxError: Unexpected token < in JSON at position 0' } #210

Closed Picalz closed 1 year ago

Picalz commented 1 year ago

When trying to login with await connection.getCredentials() :

{
  error: 500,
  msg: 'SyntaxError: Unexpected token < in JSON at position 0'
}

Has EweLinks backend maybe changed? As this issue just randomly started after no modifications.

Picalz commented 1 year ago

I've rectified the issue. There was another device using this lib 'logged in' to ewelink that was causing an issue. I imaging it was invalidating old auth keys repetitively, or waiting for the last authenticated lib user to disconnect. Stopping all clients and restarting the desired one worked for me 👍