This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
write and read SignalK Path
#1
Hi guys,
probably it is only my problem, but i need help.

I use node-red to write a path in SignalK. NO PROBLEM
Then I triy to read.... nothing.
I can't understand where is my mistake.
Any help is appreciate.

Code:
[{"id":"3332bda9.e31492","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"8fb41530.5ab9d8","type":"change","z":"3332bda9.e31492","name":"Test","rules":[{"t":"set","p":"payload","pt":"msg","to":"100","tot":"num"},{"t":"set","p":"topic","pt":"msg","to":"test","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":80,"wires":[["bed36ea1.85c9d"]]},{"id":"bed36ea1.85c9d","type":"signalk-send-pathvalue","z":"3332bda9.e31492","name":"","source":"","meta":"","x":650,"y":80,"wires":[]},{"id":"2821b233.65808e","type":"inject","z":"3332bda9.e31492","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"5","crontab":"","once":false,"onceDelay":"1","topic":"","payload":"","payloadType":"date","x":170,"y":80,"wires":[["8fb41530.5ab9d8"]]},{"id":"b7be7b4d.1f36a8","type":"signalk-subscribe","z":"3332bda9.e31492","name":"","mode":"sendAll","flatten":true,"context":"vessels.self","path":"test","source":"","period":1000,"x":160,"y":160,"wires":[["f362dc99.127a6"]]},{"id":"f362dc99.127a6","type":"debug","z":"3332bda9.e31492","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":440,"y":160,"wires":[]}]



Thanks
Max
s/y  Y2K
Reply
#2
Pretty sure this came up before, it does work, have a look in the data browser and you should see test. But istr the node-red node won't see signalk data which is created by node red.
Reply
#3
(2021-05-03, 08:32 AM)PaddyB Wrote: Pretty sure this came up before, it does work, have a look in the data browser and you should see test. But istr the node-red node won't see signalk data which is created by node red.

Yeah, I confirm that I can see in browser... But why I can't see on node red again?
I see also very well in mqtt, but I would like to continue with signalk.
Reply
#4
(2021-05-03, 11:15 AM)Spidgrou Wrote:
(2021-05-03, 08:32 AM)PaddyB Wrote: Pretty sure this came up before, it does work, have a look in the data browser and you should see test. But istr the node-red node won't see signalk data which is created by node red.

Yeah, I confirm that I can see in browser... But why I can't see on node red again?
I see also very well in mqtt, but I would like to continue with signalk.

Not sure why it's programmed that way, maybe to stop loops. Why would you need to though? If you want to something to a delta in node red why not do it when you create it instead of sending in node red then reading again in another flow?
Reply
#5
Try setting the source in both send and subscribe.

PS I find unformatted node-red flow JSON really hard to read. Consider pretty printing/formatting it when posting it.
Reply
#6
(2021-05-03, 09:37 PM)tkurki Wrote: Try setting the source in both send and subscribe.

PS I find unformatted node-red flow JSON really hard to read. Consider pretty printing/formatting it when posting it.

Hi,
yeah IT WORKS.

Probably nodered needs a different source from his name.
If I don't insert any Source, Nodered put itself as source.

Code:
[
   {
       "id": "3332bda9.e31492",
       "type": "tab",
       "label": "Flow 1",
       "disabled": false,
       "info": ""
   },
   {
       "id": "8fb41530.5ab9d8",
       "type": "change",
       "z": "3332bda9.e31492",
       "name": "Test",
       "rules": [
           {
               "t": "set",
               "p": "topic",
               "pt": "msg",
               "to": "test",
               "tot": "str"
           },
           {
               "t": "set",
               "p": "payload",
               "pt": "msg",
               "to": "101",
               "tot": "num"
           }
       ],
       "action": "",
       "property": "",
       "from": "",
       "to": "",
       "reg": false,
       "x": 390,
       "y": 80,
       "wires": [
           [
               "bed36ea1.85c9d"
           ]
       ]
   },
   {
       "id": "bed36ea1.85c9d",
       "type": "signalk-send-pathvalue",
       "z": "3332bda9.e31492",
       "name": "",
       "source": "Y2K-Anchor-Alarm",
       "meta": "",
       "x": 650,
       "y": 80,
       "wires": []
   },
   {
       "id": "2821b233.65808e",
       "type": "inject",
       "z": "3332bda9.e31492",
       "name": "",
       "props": [
           {
               "p": "payload"
           },
           {
               "p": "topic",
               "vt": "str"
           }
       ],
       "repeat": "5",
       "crontab": "",
       "once": false,
       "onceDelay": "1",
       "topic": "",
       "payload": "",
       "payloadType": "date",
       "x": 170,
       "y": 80,
       "wires": [
           [
               "8fb41530.5ab9d8"
           ]
       ]
   },
   {
       "id": "b7be7b4d.1f36a8",
       "type": "signalk-subscribe",
       "z": "3332bda9.e31492",
       "name": "",
       "mode": "sendAll",
       "flatten": true,
       "context": "vessels.self",
       "path": "test",
       "source": "",
       "period": 1000,
       "x": 160,
       "y": 160,
       "wires": [
           [
               "8a090f94.4a5bc"
           ]
       ]
   },
   {
       "id": "f362dc99.127a6",
       "type": "debug",
       "z": "3332bda9.e31492",
       "name": "",
       "active": false,
       "tosidebar": true,
       "console": false,
       "tostatus": false,
       "complete": "false",
       "statusVal": "",
       "statusType": "auto",
       "x": 610,
       "y": 240,
       "wires": []
   },
   {
       "id": "f6a5a98c.f877f8",
       "type": "switch",
       "z": "3332bda9.e31492",
       "name": "TopicSelect",
       "property": "topic",
       "propertyType": "msg",
       "rules": [
           {
               "t": "eq",
               "v": "test",
               "vt": "str"
           }
       ],
       "checkall": "true",
       "repair": false,
       "outputs": 1,
       "x": 390,
       "y": 240,
       "wires": [
           [
               "f362dc99.127a6"
           ]
       ]
   },
   {
       "id": "aa246c17.01a46",
       "type": "signalk-on-delta",
       "z": "3332bda9.e31492",
       "name": "",
       "context": "vessels.self",
       "flatten": true,
       "x": 160,
       "y": 240,
       "wires": [
           [
               "f6a5a98c.f877f8"
           ]
       ]
   },
   {
       "id": "8a090f94.4a5bc",
       "type": "debug",
       "z": "3332bda9.e31492",
       "name": "",
       "active": false,
       "tosidebar": true,
       "console": false,
       "tostatus": false,
       "complete": "false",
       "statusVal": "",
       "statusType": "auto",
       "x": 610,
       "y": 160,
       "wires": []
   }
]

Thanks a lot.

Max
Reply
#7
(2021-05-04, 01:41 AM)Spidgrou Wrote: Hi,
yeah IT WORKS.

Always fun to see what's going on deeper down, but still can't see why you would ever want to read a delta you just wrote in node-red.. 

Signalk on slack would be the place to ask why it's hard coded like that, guessing to prevent loops.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)