User Tools

Site Tools


cbus:socketcan-en

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cbus:socketcan-en [2019/01/10 14:27] rjversluiscbus:socketcan-en [2024/04/12 07:42] (current) – [Pi01CAN Interface] rjversluis
Line 1: Line 1:
 ====== SocketCAN ====== ====== SocketCAN ======
 [[:english|{{ :rocrail-logo-35.png}}]] [[:english|{{ :rocrail-logo-35.png}}]]
-[[:cbus:overview-en|{{ icons:uk.png}}]][[:cbus:overview-de|{{ icons:de.png}}]]+[[:cbus:overview-en|{{ icons:uk.png}}]][[:cbus:overview-de|{{ icons:de.png}}]][[:cbus:overview-fr|{{ icons:fr.png}}]]
 [[:english|Content]] -> [[:hardware-en|Hardware]] -> [[:hardware-en#gca-cbus|CANBUS]] [[:english|Content]] -> [[:hardware-en|Hardware]] -> [[:hardware-en#gca-cbus|CANBUS]]
   * [[:cbus:overview-en|CAN-GC Overview]]   * [[:cbus:overview-en|CAN-GC Overview]]
 +  * [[:cbus:overview-en#bus_termination|CAN Bus termination]]
  
  \\  \\
  
 //[[https://en.wikipedia.org/wiki/SocketCAN|"SocketCAN is a set of open source CAN drivers and a networking stack contributed by Volkswagen Research to the Linux kernel."]]// \\ //[[https://en.wikipedia.org/wiki/SocketCAN|"SocketCAN is a set of open source CAN drivers and a networking stack contributed by Volkswagen Research to the Linux kernel."]]// \\
- 
-{{:cbus:img_0393.jpg?400}}\\ 
  
  \\  \\
 =====Introduction===== =====Introduction=====
-The RPI-CAN MCP251x Interface board needs a Raspberry Pi 2/3.\\ +The __**[[:rocnet:pi01can-en|Pi01CAN]]**__ MCP251x Interface board needs a Raspberry Pi 2/3/4 with [[https://www.raspberrypi.org/downloads/|PiOS 32bit or 64bit]].((https://www.raspberrypi.org/forums/viewtopic.php?f=117&t=275370))\\ 
-SocketCAN is only available if the Rocrail server runs on the same Raspberry Pi with the RPi-MCP251x on it.\\ +SocketCAN is only available if the Rocrail server runs on the same Raspberry Pi with the PiCAN on it.\\ 
-The communication with CBUS(CAN) is direct and binary; No bidirectional conversion needed between the MERG Gridconnect ASCII framing.\\+The communication with RCAN((Supports also CBUS)) is direct and binary; No bidirectional conversion needed between the MERG Gridconnect ASCII framing.\\
 The 12VDC power supply for the connected CANGC* units can be provided wit a __**[[:gca08-en|GCA-08]]**__. See __**[[:cbus:overview-en#connection_cable|Cable connections]]**__ for more information.\\  The 12VDC power supply for the connected CANGC* units can be provided wit a __**[[:gca08-en|GCA-08]]**__. See __**[[:cbus:overview-en#connection_cable|Cable connections]]**__ for more information.\\ 
 +
    
  \\  \\
Line 26: Line 26:
  \\  \\
  
-===== RPI-CAN MCP251x Interface ===== +===== Pi01CAN Interface ===== 
-  * https://github.com/GBert/misc/tree/master/RPi-MCP2515 +  * **[[:rocnet:pi01can-en|PiCAN-01]]**
- +
-{{https://github.com/GBert/misc/raw/master/RPi-MCP2515/pictures/rpi-mcp2515_01_s.jpg}}\\+
  
 +[[:rocnet:pi01can-en|{{:rocnet:pi01can.jpg?400}}]]\\
 +//The I2C parts can be left out If the RocNet connection is not needed. (Just write a remark in case its ordered at GCA.)//\\
  \\  \\
 =====Raspi Setup=====  =====Raspi Setup===== 
Line 72: Line 72:
 </code> </code>
 //If the Pi-CAN should be used with MBUS, the bitrate must be set to 250000.//\\ //If the Pi-CAN should be used with MBUS, the bitrate must be set to 250000.//\\
 +
 +:!: **Note:** On newer PiOS versions add a file named /etc/network/interfaces.d/can0 with the content from above.\\
 ====Check==== ====Check====
 <code> <code>
-pi@keltenbahn:~ $ dmesg | egrep -i "can|spi" +dmesg | egrep -i "can|spi" 
 [    3.998382] CAN device driver interface [    3.998382] CAN device driver interface
 [    4.051102] mcp251x spi0.0 can0: MCP2515 successfully initialized. [    4.051102] mcp251x spi0.0 can0: MCP2515 successfully initialized.
Line 81: Line 83:
  
 ===== Rocrail Setup ===== ===== Rocrail Setup =====
-{{:cbus:cbus-socketcan-en.png}}\\+{{:cbus:rcan-setup-en.png}}\\
   * Select type SocketCAN   * Select type SocketCAN
   * Set Hostname(device name) to **can0** (If not set: can0 will be used.)   * Set Hostname(device name) to **can0** (If not set: can0 will be used.)
Line 98: Line 100:
  
  \\  \\
-=====Hardware===== 
-  * https://github.com/GBert/misc/raw/master/RPi-MCP2515/gerber/RPi-MCP2515_V1.1.ZIP 
-  * http://dirtypcbs.com/store/designer/details/GBert/6092/rpi-mcp2515-v1-1-zip 
-  * https://www.reichelt.de/?ACTION=20&AWKID=1344615 
  
- \\ 
 ===== CANService ===== ===== CANService =====
 As alternative to running Rocrail on the Raspberry Pi, it is also possible to use the __**[[:mbus:canservice-en|CANService]]**__.\\ As alternative to running Rocrail on the Raspberry Pi, it is also possible to use the __**[[:mbus:canservice-en|CANService]]**__.\\
 It behaves like a GC1e.\\ It behaves like a GC1e.\\
 +
 + \\
 +===== Alternative CAN Board =====
 +This low-cost //[[https://www.az-delivery.de/en/products/mcp2515-can-bus-modul|AZDelivery MCP2515 CAN Bus Shield]]// can be used as alternative if only CAN is needed:\\
 +{{:cbus:mcp2515_can_bus_modul_pinout.jpg?400}}\\
 +The Raspberry __[[#raspi_setup|Software Setup]]__ is the same as for the Pi01-CAN, except for the oscillator:
 +<code>
 +oscillator=8000000
 +</code>
 +Check the board which frequency the crystal has printed on it:\\
 +{{:cbus:azdelivery-canshield.jpg?200}}\\
 +This example shows 8000 kHz -> 8000000 Hz\\
 +For CAN speeds above 125kHz it is recommended to replace this crystal with a [[https://www.reichelt.de/standardquarz-grundton-16-mhz-iqd-lfxtal003240-p245409.html?search=16+mhz|16MHz type]]. (oscillator=16000000)\\
 +\\
 +|< >|
 +|  Wiring  ||||
 +^ Shield ^ Rpi ^ Rpi Pin number(s) ^ Remark ^
 +| VCC | 5V |  2, 4  | With 3V3 it will receive, but cannot send CAN packets. |
 +| GND | Masse (Ground) |  6, 9, 20, 25, 30, 34, 39  |
 +| CS | GPIO 8 (CE0) |  24  |
 +| SO | GPIO 9 (MISO) |  21  |
 +| SI | GPIO 10 (MOSI) |  19  |
 +| SCK | GPIO 11 (SCLK) |  23  |
 +| INT | GPIO 25 |  22  |
 +
 +**Notes:**
 +  * This board is __not isolated__. (ISO1050)
 +  * A ground connection on the screw terminal is missing, and it is __strongly recommended to connect the ground__ of the CAN cable to the GND pin of this board to avoid static voltage which could destroy the electronics.
 +
 +
  
cbus/socketcan-en.1547126837.txt.gz · Last modified: 2019/01/10 14:27 by rjversluis