Setting up M2RET on M2

I’m having issues with uploading M2RET to M2

ERROR:
macchina\M2RET-master\M2RET\M2RET.ino:33:89: fatal error: Arduino_Due_SD_HSCMI.h: No such file or directory
#include <Arduino_Due_SD_HSCMI.h> // This creates the object SD (HSCMI connected sdcard)
compilation terminated.
exit status 1
Error compiling for board Macchina M2.

I downloaded all my libraries that were stated in.
http://showcase.macchina.cc/libraries.html
and added them thru Add ZIP Library

any help plz.

In the M2RET.ino you need to change the text from “Arduino_Due_SD_HSCMI.h” to “Arduino_Due_SD_HSMCI.h”

Yeah, I don’t know what happened. Somewhere along the way the library got misnamed and that other wrong name persisted for a while. I really should change it to be the proper name.

Yes thank you I was going to try to find how to post an issue on github, but computers issues.

Github has now been updated to use the proper library name so people shouldn’t run into this any longer. It should have been obvious that there was a transposition error as some places said HSMCI and some said HSCMI but I never caught it.

same thing with <sw_can.h> is this for Single-Wire-CAN-master?

M2RET uses a different Single-Wire-CAN library. For now use https://github.com/collin80/SW_CAN.

I am currently working on clarifying the existence of two different SWCAN libraries (I’m a few hours into the task; it takes a while to get everything reorganized organized).

auto spell correct messed my post.
I meant with sw_can.h same thing.
is this for single wire can

That’s probably a little bit of a mess right now. When I wrote M2RET there was a library called SW_CAN that had everything in it. That’s changing to use the MCP2515 library and then an add-on library that implements single wire CAN over top of the MCP2515 library but separate. I’m not sure whether that’s complete yet.

You might need to grab SW_CAN from my repos at https://github.com/collin80/SW_CAN in order to compile right now. Eventually the dust will settle around the single wire CAN libraries and then we can all switch to the official M2 libraries.

thx collin, got it to work. I’m not a pro at arduino as you can see.

A guide how to set up and use m2ret would be nice, a lot of bakers are getting their m2 within next couple of weeks.

Agreed! That is on the list of tutorials to write up sooner than later. If you wanted to give it a shot or take some screenshots while you work through the process, we’d be happy to post them up to the docs for everyone to benefit from.

Doubt a anyone cares, but for background see: JoaoDiogoFalcao/Arduino_Due_SD_HSCMI#3, JoaoDiogoFalcao/Arduino_Due_SD_HSCMI#6, macchina/M2_SD_HSMCI#6

Next couple of days, hopefully. I think I just finished but still have testing to do. If anyone wants the bleeding edge, see: https://github.com/macchina-dev/Single-Wire-CAN-mcp2515

There is definitely a need there. I’m currently working at it indirectly because once libraries settle down, the process of installing M2RET can be highly optimized by macchina/arduino-boards-sam#30. I might even start shipping M2RET with the board configuration :sunglasses:.

I’m seeing an error in both the prior version (I’d fixed the library typo myself) and the current one:

M2RET:255: error: cannot convert ‘MassStorage::Init’ from type ‘void (MassStorage::)()’ to type 'bool’
if (SD.Init) {
^

The block of code where it occurs is this, from M2RET.ino:

if (SysSettings.useSD) {
    if (SD.Init()) {
        FS.Init();
        SysSettings.SDCardInserted = true;
        if (settings.autoStartLogging) {
            SysSettings.logToFile = true;
            Logger::info("Automatically logging to file.");
            //Logger::file("Starting File Logging.");
        }
    } else {
        Logger::error("SDCard not inserted. Cannot log to file!");
        SysSettings.SDCardInserted = false;
    }
}

Any ideas? I’ve used the libraries linked to from the M2RET Github page, so I’m pretty sure I have my libs right.

The error really suggests you have a wrong version of the library. Any chance you downloaded the library more than 7 days ago? There was a [brief] period of time where M2RET started linking to the Macchina version of the library, but the Macchina version did not include all the needed changes (because it was trying to get them merged upstream first).

To avoid any ambiguity, the version to use with your M2 and with M2RET is https://github.com/macchina/M2_SD_HSMCI. (Yes, the URL at M2RET is currently different, but you will notice it redirects).

Okay, I removed the library (assuming I did the right one) and re-downloaded/re-added it, but no difference. Pasted below is more detail, including the libraries in use and their versions:

/Users/rogueshoten/Documents/Arduino/M2RET/M2RET.ino: In function ‘void setup()’:
M2RET:255: error: cannot convert ‘MassStorage::Init’ from type ‘bool (MassStorage::)()’ to type 'bool’
if (SD.Init) {
^
Using library due_can-master at version 2.0.1 in folder: /Users/rogueshoten/Documents/Arduino/libraries/due_can-master
Using library M2_SD_HSMCI-master at version 0.0.1 in folder: /Users/rogueshoten/Documents/Arduino/libraries/M2_SD_HSMCI-master
Using library due_wire-master in folder: /Users/rogueshoten/Documents/Arduino/libraries/due_wire-master (legacy)
Using library SPI at version 1.0 in folder: /Users/rogueshoten/Library/Arduino15/packages/arduino/hardware/sam/1.6.11/libraries/SPI
Using library LIN-master at version 2.0 in folder: /Users/rogueshoten/Documents/Arduino/libraries/LIN-master
Using library SW_CAN-master in folder: /Users/rogueshoten/Documents/Arduino/libraries/SW_CAN-master (legacy)
exit status 1
cannot convert ‘MassStorage::Init’ from type ‘bool (MassStorage::)()’ to type ‘bool’

6 posts were split to a new topic: Single-wire CAN (MCP2515) library

I’ll release a new version of the board configuration tomorrow (I am giving it one more day for a couple of people to get back to me regarding the changes). With the new version, running M2RET should be as simple as opening M2RET.ino and uploading.

Rogueshoten
When adding libraries from a zip file after unpacking you need to remove the -master from the end of the file name.
An alternative is to place the zip file in your library directory & use the arduino IDE & install the library from a zip file.
Check all your libraries in the library folder & remove the -master from the file name.

Tony

Version 0.2.0 of the board files has been released and the M2RET stuff works as I previously stated. Unfortunately, it only seems to work with the Macchina M2 (Beta). I am getting an error in the SD Card library when I try to compile with the Macchina M2 board.

I’ll have to try to investigate tomorrow, if no one beats me to it.