• 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
  IoT Edge Gateway: Node-RED - ARRAY -> OPC UA AxelHa2111 5 4,656 May-21st-2021, 05:13 PM
Last Post: Armin@netPI
  Configuring S7-1200 PLC to communicate with node-red ... Cman587 3 5,052 January-27th-2021, 11:01 AM
Last Post: Armin@netPI
  InfluxDB, Node-RED and Grafana Armin@netPI 0 3,610 January-6th-2021, 02:36 PM
Last Post: Armin@netPI
  PROFINET to OPC UA data conversion with Node-RED Armin@netPI 0 3,481 July-7th-2020, 12:20 PM
Last Post: Armin@netPI
  Accessing Siemens S7 PLCs over Node-RED Armin@netPI 3 9,063 February-24th-2020, 06:44 PM
Last Post: jacp

Forum Jump:


Users browsing this thread: 1 Guest(s)