DLTCan is used to log CAN message into a DLT TCP connection to a DLT Viewer. It is developed for an Arduino SW running on a Wemos Mini D1 HW and an MCP2515 Adapter.
For further information about DLT visit the DLT Viewer project:
https://github.com/GENIVI/dlt-viewer
The following Hardware is currently supported:
- Relais Boards: Arduino Wemos Mini D1 + MCP2515 Board
- Wemos D1 R1 Board + Keyestudio CAN-BUS Shield
- Wemos D1 R1 Board + DiyMore CAN-BUS Shield
The following parts are needed to setup a CAN board:
- Wemos D1 Mini Buy at Amazon Germany Buy at AliExpress
- Optional: Triple Base or Dual Base Buy at Amazon Germany Buy at AliExpress Triple Base Buy at AliExpress Dual Base
- Optional: Protoype Shield: Buy at Amazon Germany Buy at AliExpress
- MCP2515 Board: Buy at Amazon Germany Buy at AliExpress
CAUTION: Wemos D1 Mini needs 3.3V logic level, if not ESP8266 will be damaged. Pin 18 of MCP2515 must be unsoldered and connected to 3.3V
The following pins from the Wemos D1 Mini to the MCP2515 Board must be connected:
- 3.3V -> Pin18 MCP2515
- 5V -> VCC
- GND -> GND
- D5 -> SCK
- D6 -> MISO SO
- D7 -> MOSI SI
- D8 -> CS
- D2 -> INT
The following parts are needed to setup a CAN board:
- Wemos D1 Amazon Germany AliExpress
- Keyestudio CAN_BUS Shield Eckstein Shop AliExpress
CAUTION: Wemos D1 R1 needs 3.3V logic level, if not ESP8266 will be damaged. Pin 18 of MCP2515 must be unsoldered and connected to 3.3V
The following pins from the Wemos D1 R1 are connected to the CAN Bus shield:
- 13 -> D5 SCK
- 12 -> D6 MISO
- 11 -> D7 MOSI
- 10 -> D10 CS
- 8 INT -> D8
- 3.3V -> Pin18 MCP2515
- 5V -> 5V
- GND -> GND
- RST -> RST
The following parts are needed to setup a CAN board:
- Wemos D1 Amazon Germany AliExpress
- Keyestudio CAN_BUS Shield AliExpress
CAUTION: Wemos D1 R1 needs 3.3V logic level, if not ESP8266 will be damaged. Pin 18 of MCP2515 must be unsoldered and connected to 3.3V
The following pins from the Wemos D1 R1 are connected to the CAN Bus shield:
- 13 -> D5 SCK
- 12 -> D6 MISO
- 11 -> D7 MOSI
- 10 -> D10 CS
- 2 INT -> D2
- 3.3V -> Pin18 MCP2515
- 5V -> 5V
- GND -> GND
- RST -> RST
The following Arduino SW is needed
WemosD1MiniCAN.ino WemosD1R1CANDiymore.ino WemosD1R1CANKeyestudio.ino
The Arduino SW is based on the Wemos Library:
Clone or copy the Wemos Library into the Arduino Libraries folder before compiling the sketch.
Compile, upload and run the SW with the Arduino IDE.
Select the right Board Wemos D1 Mini or Wemos D1 R1 in the Arduino Studio.
Select in the Source code the right CAN configuration for your board
The Arduino SW provides the following Features:
- Init status
- Forward Standard and Extended CAN message
- Send two specific messages cyclical (optional)
The Wemos D1 Mini is connected by a virtual serial device on USB. The serial port settings are 115.200 Baud with 8N1 and no handshake.
A USB driver is needed which can be found here:
https://www.wemos.cc/en/latest/ch340_driver.html
The protocol is binary.
Each message starts with the byte "0x7f". If the payload of a message contains the byte "0x7f", two bytes with "0x7f" are sent.
The following commands are used
- "0x7f 0x00": Init ok
- "0x7f 0x01": Send ok
- "0x7f 0x02": Watchdog
- "0x7f 0x80 length 2BytesId payload": Standard CAN message
- "0x7f 0x81 length 4BytesId payload": Extended CAN message
- "0x7f 0xfe": Send error
- "0x7f 0xff": Init error
- CAN <hex id> <hex message>
- CANCYC1 <decimal time ms> <hex id> <hex message>
- CANCYC1 off
- CANCYC2 <decimal time ms> <hex id> <hex message>
- CANCYC2 off
To build this SW the Qt Toolchain must be used.
-
DLTCan.exe [options] configuration
-
Options:
-
-?, -h, --help Help
-
-v, --version Version
-
-a Autostart Communication
-
Arguments:
-
configuration Configuration file
Contibutions are always welcome! Please provide a Pull Request on Github.
https://github.com/alexmucde/DLTPower
If you find this SW useful and you want to donate my work please select one of the following donations:
Paypal Donation:
Github Sponsors:
v0.1.1:
- Fixed serial port configuration
- Improved DLT output
- Update build script to Qt 5.15.2 and MSVC 2019
v0.1.0:
- Remove automatic port name detection
- Support additional CAN Board
v0.0.2:
- Add DLT injection interface
v0.0.1:
- Initial version
- Send messages function added
Alexander Wenzel [email protected]
This code is licensed under GPLv3.