Setting up Savvycan (With M2RET and macchina) on OSX

GokulaKrishnan
Jan 14, 2018 · 2 min read

Got my macchina a week ago and today, I tried setting up macchina to work with savvycan via M2RET on my mac.

Testing out flashing onto macchina

  1. Macchina is based on Arduino due. Followed the steps along the Guide given. The guide was pretty much self explanatory. If everything goes well, and you upload the example sketch, a blue led glows for every 1 second.
  2. To Verify, Go to libraries (/Users/gokulakrishnanm/Library/) via Command + Shift + G (Go to folder command)
  3. /Users/gokulakrishnanm/Library/ is the location of the libraries file.
  4. Go into Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/
  5. These are the libraries installed along with Macchina package.

Adding M2RET

  1. Download the Collins repo
  2. Remove the -master suffix and paste them to Documents/Arduino/libraries/

Making changes to libraries that come along with macchina

  1. Go /Users/gokulakrishnanm/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/
  2. Replace due_can, due_wire, mcp2515 with Collins version of due_can , due_wire , mcp2515

As per Collins comment :

“I just put a binary updater for M2RET onto savvycan.com as well. This version should give you three working buses if used with the newest binary of SavvyCAN — two CAN, one single wire CAN. I’ve tested to be able to both read and write to single wire CAN with this new version. Word of caution for anyone trying to compile M2RET now — I’ve changed the MCP2515 library an awful lot. It now can use a common API with due_can so that you can write a sketch that works across any of the three buses with the exact same function calls. That’s handy but I did it by creating a third library “can_common” that due_can and mcp2515 now inherit from. That means you need can_common and you need the new version of both due_can and mcp2515 as well. And, you need my versions of all of those because it is not pushed to the Macchina repo and won’t be until everyone is sure that it’s a good idea to do that.”

3. Add can_common as mentioned along with other libraries

Verify and Uploading to M2

  1. Fire up Arduino IDE, goto File -> Examples -> M2RET and upload the M2RET.ino

Testing with Savvycan

  1. Open up savvy can.
  2. If everything was successful, you will see the below screen
Savvycan when M2 connected

Will be testing M2 in upcoming weeks with Savvycan.

GokulaKrishnan

Written by

Building self driving electric car in the morning, Dota 2 bots at night