The adapter PCB is pre-installed onto the M2 interface board. The PocketBeagle is also pre-installed onto the adapter board. Since the PocketBeagle is not keyed, if you remove, be sure to plug it in so that the USB ports are on the same side.
A USB wireless adapter can be plugged directly into the board, no powered USB hub required.
β
Step 2: Create a bootable SD card
Follow instructions hereto create a bootable SD card. Once you have a bootable SD card, plug it into the PocketBeagle. Latest images are found here.
Note: The P1 kit ships with pre-installed image on SD card!
Plug a microUSB cable into the PocketBeagle and your computer. After a minute or so, use your favorite terminal to ssh to beagle.local or 192.168.7.2:
Step 2.5: Change your password (optional but recommended)
We want to make sure that others wont be able to access your device to do this the main thing we are going to do is change the root password.
1
sudo passwd root
Copied!
Step 3: Connect to internet.
First thing we'll want to do is connect to the internet to be able to download the latest packages. To do that, we'll use WIFI. Type the commands as shown below
1
sudo connmanctl
2
connmanctl> disable wifi
3
Disabled wifi
4
connmanctl> enable wifi
5
Enabled wifi
6
connmanctl> scan wifi
7
Scan completed for wifi
8
connmanctl> services
Copied!
All of the hotspots that your setup can see will be listed here, and look something like this:
The following steps only need to be performed once. The correct pin configuration will then persist across reboots. Verify that that these files exist:
1
ls -lt /lib/firmware/PB-CAN0-00A0.dtbo
2
ls -la /lib/firmware/PB-CAN1-00A0.dtbo
Copied!
Edit the boot configuration so the CAN0 and CAN1 pins will be configured automatically:
save the file (ctrl-o) and exit (ctrl-x) and then reboot:
1
sudo reboot
Copied!
Next, we set up the CAN interface and turn it on. Note that we are setting rate at 250Kb/s here. Your car might be a different BAUD rate.
P1 is now set up! Step 6 and beyond are for testing and becoming more familiar with CAN on P1, try them if you'd like, or check out the P1 Mini-Projects.
Step 6: print out CAN messages
1
sudo ip link set can0 type can bitrate 250000 listen-only on
2
β
3
sudo ifconfig can0 up
Copied!
To see actual data, we need to do 2 things: 1. Plug M2/PocketBeagle into your car or an emulator (No need for hub, and WIFI dongle anymore - those can be unplugged) and 2. enter this command to print output to terminal screen:
1
candump -cae can0,0:0,#FFFFFFFF
Copied!
If everything is set up correctly, you should see something like this:
While this looks pretty cool, it is hard to see what is going on. Press CTRL+C to end output to terminal.
Logging CAN data to a file makes it easier to analyze the data. To do that, use this command to log data to current working directory:
1
candump -l any,0:0,#FFFFFFFF
Copied!
Optional:
Run these commands to enable the CAN1 interface and print anything received to the terminal:
1
sudo ip link set can1 type can bitrate 250000 listen-only on
2
β
3
sudo ifconfig can1 up
4
β
5
candump -cae can1,0:0,#FFFFFFFF
Copied!
Step 7: Sending CAN messages
This should be used for testing purposes only and caution should be taken before sending messages to a real car. Here are instructions on how to send CAN messages on the CAN0 interface.
1
sudo ip link set can0 type can bitrate 250000
2
β
3
sudo ip link set up can0
4
β
5
cansend can0 01a#11223344AABBCCDD
Copied!
Step 8: Going further.
You can test sending and receiving CAN a couple ways: