The gateway is compose of the following:
Raspbian(kernal 4.8) 32 bit
Raspberry Pi 3
The PiCan overlay is capable of supporting up to two independent buses via serial interface. Depending on the configuration, additional setup may be required to either the EVT Gateway Application or the interfaces. In addition, their is a terminator available if the node is needed to complete the CAN bus.
The Gateway module allows for the collection of data across both interfaces and displays basic motor controller state. The module is written in python and has the ability to be expanded upon if needed. See Gateway Module for installation, configuration and deployment.
Connecting to the gateway varies between laptop as the private IP address assigned by a computer could vary, follow directions below.
Requirements
Install nmap
Install Nmap
sudo apt-get install nmap
install Network-Manager
Install Network Manager
sudo apt-get install network-manager
Edit Wired Network connections
Change IpV4 settings to "Share to other computers"
Save Settings
Reboot
Figuring out PI address
Run /sbin/ifconfig eth1 | grep "Bcast" | awk -F: '{print $3}' | awk '{print $1}'
a. depending on your laptop you may need to change eth1. Double check by using ifconfig and find interface name assigned to Ethernet.
Figuring Private Network Range
/sbin/ifconfig eth1 | grep "Bcast" | awk -F: '{print $3}' | awk '{print $1}'
10.42.0.255
b.The output will give an ip address. In the case of my laptop this was 10.42.0.255.
2. Use this IP address to to run the following
a. nmap to discover PI address
nmap -n -sP 10.42.0.255/24
b. Following should appear
Running nmap command
Starting Nmap 6.40 ( http://nmap.org ) at 2016-02-20 23:07 CET
Nmap scan report for 10.42.0.1
Host is up (0.00031s latency).
Nmap scan report for 10.42.0.96
Host is up (0.0023s latency).
Nmap done: 256 IP addresses (2 hosts up) scanned in 2.71 seconds
10.42.0.1 is the interface of your computer. The other address, 10.42.0.96 is the address of the pi.
Logging In
Using the IP address you just found run
Login with ssh
ssh -Y pi@10.42.0.96
See Enabling SSH written by Shane for further information on how to do this.
The can0 network interface can be started by running:
$ sudo ip link set can0 up type can bitrate 250000
$ sudo ifconfig can0 up
To view incoming CAN messages, run:
$ candump can0
To send a message, run
$ cansend can0 000#11.2233.44556677.88
The three hex characters before the pound sign make up the id, while the 16 hex characters after it make up the message. Periods are used for visibility but don't affect the message.
The CAN bus only works when connected to 5V power in the barrel jack connector.