Works initially, but after some time requests fail & return 'token is expired' message
See original GitHub issueI am running bluelinky on a raspberry pi 4, using this code to start a web daemon listening for commands. It works great when I first launch it, but after some period of time commands stop working and I get this error back instead:
/lock 192.168.1.99 token is expired, refreshing access token TypeError: Cannot read property 'RESPONSE_STRING' of null at Vehicle.<anonymous> (/home/pi/Documents/node_modules/bluelinky/dist/index.js:149:34) at Generator.next (<anonymous>) at fulfilled (/home/pi/Documents/node_modules/bluelinky/dist/index.js:52:58) at processTicksAndRejections (internal/process/task_queues.js:93:5)
I don’t know what the exact timeout for this is. I’m sure it’s at least an hour, because I’ve seen commands succeed nearly an hour after starting it.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (5 by maintainers)
Looks like that did it. Thanks!
@NeighborGeek https://github.com/Hacksore/bluelinky/commit/7d7494527bafddb7994b9c4ddd91eaeea94594d1#diff-13b5b151431c7e7a17f273559ed212d5R98 That should fix it as I was not saving the token after a new one had been fetched.