robertklep / nefit-easy-http-server

HTTP server to access Nefit/Bosch XMPP backend over HTTP
MIT License
38 stars 15 forks source link

SyntaxError: Unexpected token h in JSON at position 0 #19

Closed GiTuur closed 6 years ago

GiTuur commented 6 years ago

Hi, I just installed the nefit-easy-server but getting error when trying to get status:

curl http://127.0.0.1:3000/api/status

SyntaxError: Unexpected token h in JSON at position 0 at Object.parse (native) at pending.(anonymous function).send.then.e (/volume1/@appstore/Node.js_v6/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/nefit-easy-core/lib/index.js:236:30) at process._tickCallback (internal/process/next_tick.js:109:7)

Any idea what I'm doing wrong?

robertklep commented 6 years ago

This is typically caused by invalid credentials (serial, password, access code).

Be aware that there's a (long-standing) bug in the code that prevents the use of certain characters in the password. At least one known character that will cause problems in the password is !, but there might be others.

GiTuur commented 6 years ago

no character issue but password lenght. thx

robertklep commented 6 years ago

@GiTuur glad it's solved!

Any idea what the maximum length is? If there's a maximum, I think the Nefit app might just truncate passwords that are longer, which is something I could implement too (or at least show the user a warning).

GiTuur commented 6 years ago

Hi Robert, the maximun lenght is 10 characters

robertklep commented 6 years ago

Good to know, thanks!