Skip to content

meatpiHQ/mpUSB-CAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 

Repository files navigation

All applications are available Here, follow the insturctions to Flash new Firmware

1. SocketCAN Firmware (VSCOM API):

SocketCAN is similar CANtact firmware below, but support some extra features like BUSMaster compatiblity and availability of APIs in different languages such as LabView, C#, VB.Net, Delphi, Python and more.

BUSMaster

You need to download the right version of BUSMaster provided in the Link above. Here is how to setup the hardware. Remember to set both Acceptance Code and Mask to '00000000'.

  1. Select VSCom CAN-API by clicking on 'Driver Selection -> VSCom CAN-API"
  2. Then Click on 'Channel Configuration -> Advanced'
  3. Click on 'Search for Devices on COM-Ports', the device should appear in the drop downlist or fill the right COM port number
  4. Check the 'Hardware Timestamps' check box.
  5. Choose the Baudrate.
  6. Most importantly set both Acceptance Code and Mask to '00000000'.
  7. Click 'OK', then Click the Connect button on the top left corner.

image

2. CANtact Firmware:

CANtact firmware is compatible with slcan-interface and can be used with socketcan and slcand with Linux. Under Windows it can be directly driven by the serial interface.

Drivers: On windows mpCAN-USB will appear as a comport (COMxx) in the devices manager. Under Linux and Mac as a USB CDC device, /dev/ttyUSBX for linux and /dev/cu.usbmodemXXXX on MacOS

Windows and Mac application:

CANtact App can be used to monitor and send packets on CAN bus. No drivers are needed just choose the right serial port and set the baud rate and it's all set. image

Linux:

In Linux CAN interface can be brought up using slcand. Example:

sudo slcand -o -c -s0 /dev/ttyUSB0 can0

sudo ifconfig can0 up

sudo ifconfig can0 txqueuelen 1000

cansend can0 123#11223344 # Send a CAN frame ID:0x123 payload:0x11223344

candump can0 # Receive CAN packets on CAN0

Python-CAN:

import can

bus = can.interface.Bus(bustype='slcan', channel='COM70', bitrate=500000)           #Windows
#bus = can.interface.Bus(bustype='slcan', channel='/dev/ttyACM0', bitrate=500000)   #Linux
msg = can.Message(arbitration_id=0x112233,
                  data=[1, 2, 3, 4, 5, 6, 7, 8],
                  is_extended_id=True)
try:
    bus.send(msg)
    print("Message sent")
except can.CanError:
    print("Message NOT sent")
for msg in bus:
    print(msg)  ## Print received messages

3. candleLight Firmware:

candleLight firmware generally has a better performance than slcan. Under Windows and Ubuntu it can be used with MicroBus or Cangaroo APP.

Linux: candleLight is natively supported under linux using gs_usb driver. Just plug it in and using this command:

ip link set can0 up type can bitrate 500000

candleLight Python: For development you can install candle-driver

image

4. CAN-Analyzer

CAN-Analyzer firmware is based on slcan firmware, it also uses CDC serial interface. This firmware was ported for the sole purpose of interfacing with realdash.

realdash

Flash new Firmware:

image Download mpFlasher Tool. Link

  1. Set the 1.27mm DFU jumper
  2. Plug in the USB cable, both LEDs should start blinking
  3. Once in DFU mode, the device will appear as "USB Serial Device"
  4. If you have multiple USB Serial devices connected make sure to choose the right one
  5. Click the "Three Dots" button to select the firmware file
  6. Then Click flash button.

© 2022 meatPi Electronics | www.meatpi.com | PO Box 5005 Clayton, VIC 3168, Australia

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published