I have a simple flow to adjust the date on some NMEA0183 input to my signalK. (The GPS suffers from rollover error and thinks I am still in 2004, so we need to simply add a bunch of seconds to its output)
But I cannot figure out how to apply the output payload to signalk. I am using PUT to send it to various endpoints, eg localhost:3000/signalk/v1/api/put but whatever endpoint URL I use I get a 401 permission denied error. Clearly I am missing something obvious. What do I need to do to get this to work.
For authentication I have used a bearer token, but I don't think I even get to that point, I think the endpoint URL's I am using don't exist. Do I need to create them somewhere?
I have a simple test script here:
[
{
"id": "1",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": ""
},
{
"id": "inject",
"type": "inject",
"z": "1",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "headers",
"v": "{\"Authorization\":\"Bearer my-token\"}",
"vt": "json"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"context\":\"vessels.self\",\"updates\":[{\"source\":{\"label\":\"node-red\"},\"timestamp\":\"2024-06-29T12:34:56Z\",\"values\":[{\"path\":\"navigation.datetime\",\"value\":\"2024-06-29T12:34:56Z\"}]}]}",
"payloadType": "json",
"x": 150,
"y": 100,
"wires": [["send-request"]]
},
{
"id": "send-request",
"type": "http request",
"z": "1",
"name": "Send Adjusted Date",
"method": "PUT",
"ret": "txt",
"paytoqs": "ignore",
"url": "http://localhost:3000/signalk/v1/api/put/",
"tls": "",
"x": 400,
"y": 100,
"wires": [["debug-response"]]
},
{
"id": "debug-response",
"type": "debug",
"z": "1",
"name": "Debug Response",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 650,
"y": 100,
"wires": []
}
]