doug kimmerly - Can anyone point me in the righ...

Can anyone point me in the right direction? I'm trying to write a plugin that will schedule NMEA Switching while I'm away from the boat to save power and still have access to turn on things like the dehumidifier. I continue to run into permissions issues and I'm not sure the best way to get the permissions needed. I can send PUT commands from Postman, but when I try to replicate that in a plugin running on the server I get this
"Apr 18 15:40:00 Error turning OFF switch companionway at http://localhost/signalK/v1/api/vessels/self/electrical/switches/bank/45/11/state: You do not have permission to view this resource, <a href='/admin/#/login'>Please Login</a>"
I have retrieved a token given it admin access and used that in my PUT command.
What is the best way to authenticate a plugin to be able to access the NMEA switches ??
4 Replies
Scott Bender
Scott Bender3d ago
Don’t use http. You can just call app.putSelfPath Hmm. Somehow that got left out of the new documentation
doug kimmerly
doug kimmerlyOP3d ago
ok that sounds easier thanks
doug kimmerly
doug kimmerlyOP3d ago
changed it up and it works great thanks again

Did you find this page helpful?