• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NPIX-RCAN with node-red-contrib-canbus node
#1
Information 
The standard "node-red-contribute-canbus" node is not able to parameterize the interface.
But the attached flow can do it. The interface name of the NPIX-RCAN is "can0".

For immediate use you can use the "hilschernetpi/node-red" Docker Image. This this includes the "node-red-contribute-canbus" node.

You can buy the CAN module at NIOT-E-NPIX-RCAN

   

Node-RED flow
Code:
[{"id":"4d07c78.7bb0238","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"e5be7b4b.3043c8","type":"canconfig","z":"","channel":"can0","bitrate":"1000000"},{"id":"eb182264.f344f","type":"candump","z":"4d07c78.7bb0238","name":"candump","vconfig":"e5be7b4b.3043c8","x":120,"y":140,"wires":[["620e867b.c95678"]]},{"id":"620e867b.c95678","type":"debug","z":"4d07c78.7bb0238","name":"","active":true,"console":"false","complete":"true","x":310,"y":140,"wires":[]},{"id":"cca38704.e615e","type":"exec","z":"4d07c78.7bb0238","command":"ip link set can0 down","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Interface down","x":320,"y":60,"wires":[["60373f1f.8fd19"],[],[]]},{"id":"e6062ba0.bee45","type":"exec","z":"4d07c78.7bb0238","command":"ip link set can0 type can triple-sampling on bitrate ","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Interface setup","x":660,"y":60,"wires":[["b6405ee3.c72bc"],[],[]]},{"id":"b6405ee3.c72bc","type":"exec","z":"4d07c78.7bb0238","command":"ip link set can0 up","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Interface up","x":850,"y":60,"wires":[[],[],[]]},{"id":"bef5bf08.aa042","type":"inject","z":"4d07c78.7bb0238","name":"Init can0","topic":"","payload":"","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":60,"wires":[["cca38704.e615e"]]},{"id":"60373f1f.8fd19","type":"change","z":"4d07c78.7bb0238","name":"1MBit","rules":[{"t":"set","p":"payload","pt":"msg","to":"1000000","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":60,"wires":[["e6062ba0.bee45"]]}]
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Accessing Siemens S7 PLCs over Node-RED Armin@netPI 0 11 August-23rd-2019, 08:01 AM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)