VSCP over CANbus with Atmel devices - PART 2 - Get messages in Works

This page is the next step after PART 1

If you have done the PART 1, you should have a working CAN bus.

The purpose of this page is to show you how you can fetch CAN messages from your computer using VSCP Works.

Since I use Linux only I will not cover how to install the interface with Windows.

Hardware interface

The interface used in this howto is the USB2CAN interface from 8devices that you can get from the shop: http://www.frogshop.se/index.php?route=product/product&path=73&product_id=56

I re-used an old serial cable to connect it to the breadboard

  • yellow (3) = ground
  • red (2) = CAN_Low
  • brown (7) = CAN_High):

When you connect the interface without loading the driver, its LED should be steady red.

Linux driver

You need to have the driver compiled, either as a module or within the kernel, below is the kernel option for inkernel driver:

If the driver is correctly loaded you should be able to see the CAN interface when issuing the command sudo ip link:

Bring the interface up

Once the Linux driver is loaded you can bring the interface up:

sudo ip link set can0 up type can bitrate 125000 sample-point 0.875

The LED on the USB2CAN interface should turn green, showing that the interface is up.

You can also bring it down:

sudo ip link set can0 down

Read messages in WORKS

Make sure you loaded the Linux driver and the interface is up, then open VSCP Works, go to the VSCP menu, select VSCP client window, and add an interface as per below:

Once the interface is added, select it and click OK.

If you have nodes on the bus sending messages you will get all the events listed in the window, clicking on an event will display detailed information on the right-hand side:

Where to go from here

You can now use the daemon to fetch the events from the bus and process them to do whatever you like.

That will be the subject of the PART 3.

 
howto/vscp_can_atmel_part2.txt · Last modified: 2014/11/06 21:01 by waaslandwolf
[unknown button type]
 
Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki