SF Bay Music Tech

2017/01/14

BeagleBone Green: Enable CAN on Startup

Filed under: analog3,BeagleBone,CAN — Gan @ 6:03 PM

Three steps:

  1. Enable CAN overlay by configuring cape manager
  2. Configure network interface
  3. Install startup program

1. Enable CAN overlay

Add following line in /etc/default/capemgr

2. Configure network interface

Add following lines in /etc/network/interfaces

3. Install startup program

Setting the CAN interface to /etc/network/interface does not enable the CAN interface on startup for some reason. In order to workaround this problem, I installed a startup program as follows.

Following link was helpful:

Running a script on Beaglebone Black boot/ startup

The startup script to run on startup is as follows. This script also turns off wi-fi power management, thus I removed a cron entry I added before to disable the power management.

Following are the steps to create and enable a service that runs on startup.

  • Create the service
  • Edit the above file as necessary to invoke the different functionalities like network. Enable these only if the code needs that particular service. Disable unwanted ones to decrease boot time.
  • Create a symbolic link to let the device know the location of the service.
  • Make systemd reload the configuration file, start the service immediately (helps to see if the service is functioning properly) and enable the unit files specified in the command line.
  • Restart BBB immediately to see if it runs as intended.

 

2017/01/10

Test CAN connection between BeagleBone and MIDI/CAN converter

Filed under: analog3,BeagleBone,CAN — Gan @ 5:55 PM

1. Enabled CAN at 1Mbps on BeagleBone:

Following operations seem to be necessary every BeagleBone boot. TBD to setup auto configuration on startup.

2. Wired CAN ports

Used MCP2551 for CAN transceiver.

3. Connected with MIDI/CAN converter via CAN bus

See the picture above.

4. Monitor MIDI/CAN converter via serial interface

5. Monitor packets on BeagleBone and play

Serial port monitor:

2016/12/25

Enable CAN on the BeagleBone Green

Filed under: analog3,BeagleBone,CAN,tech notes — Gan @ 8:42 AM

I’ve tried to enable CAN on my BeagleBone Green board. I had to stop the work before verification, because my logic analyzer is unavailable now. I record what I did in this article to make things reproducible when the logic analyzer is back.

There are several helpful links:

http://www.embedded-things.com/bbb/enable-canbus-on-the-beaglebone-black/

http://electronics.stackexchange.com/questions/195416/beaglebone-black-can-bus-setup

https://groups.google.com/forum/embed/?place=forum/beagleboard&showsearch=true&showpopout=true&showtabs=false&hideforumtitle=true&parenturl=http%3A%2F%2Fbeagleboard.org%2Fdiscuss%23bone_forum_embed#!category-topic/beagleboard/can/SjWwVngIPh8

Readings to understand device tree overlay:

Device Tree for Dummies:
http://events.linuxfoundation.jp/sites/events/files/slides/petazzoni-device-tree-dummies.pdf

Device Tree Overlays (in adafruit)
https://learn.adafruit.com/introduction-to-the-beaglebone-black-device-tree/device-tree-overlays

Here are what I did:

Then I have to stop here.

2016/12/24

BeagleBone notes

Filed under: analog3,BeagleBone,CAN,tech notes — Gan @ 4:03 PM

How to login from MacOS:

  1. Connect to the BeagleBone by a USB cable.
  2. MacOS restart is necessary for some reason.
  3. SSH to 192.168.7.2

WiFi setup:

Use connmanctl as described in /etc/network/interfaces.

… and so on

Following links give useful information:
http://xx-prime.hatenablog.com/entry/2016/08/13/012059 (in Japanese)

https://www.mail-archive.com/beagleboard@googlegroups.com/msg40785.html

The wlan0 device power management can be turned off by

TBD how to turn this off permanently.

Take SD backup

  1. Insert the SD into the MacBook
  2. “diskutil list” to know the path to the device.
  3. run “sudo dd if=<device_name> conv=sync,noerror | gzip -c > archive.img.gz

Following link is helpful to know how to backup disks in several styles:

https://wiki.archlinux.org/index.php/disk_cloning

Connecting to the host via serial port

Useful when the SSH access has a problem:

2016/07/22

MCP2515 beyond 1MHz

Filed under: analog3,CAN,tech notes — Gan @ 9:50 PM

For archival purpose:

http://can-bus.996267.n3.nabble.com/Anybody-ever-run-an-MCP2515-at-greater-than-1Mbps-td1859.html

you are certainly right about 1Mbps being the maximum speed of the official CAN spec. However, some of us like to break the rules :)

I do :)
I’m using CAN for a purpose different from controlling automobile so my breaking rule would not cause any death.

Powered by WordPress