collin80 / m2ret Goto Github PK
View Code? Open in Web Editor NEWGVRET fork to Macchina M2 board
License: MIT License
GVRET fork to Macchina M2 board
License: MIT License
Hi,
I'm logging my CAN bus and I know (from a different test with another lib, Afterglow/arduino-gmlan) that eg sending to address
10644040
with data
0 0 FF
dims the interior lights of my Camaro.
That's with arduino-gmlan:
can_send_29bit_message(0x10644040,3, {0,0,0xff})
I try to port this to work with M2Ret (which I use as a boilerplate) and I do see this log message when logging with M2Ret:
10716486 - 10644040 X 2 3 0 0 FF
so, I think, it should be correct to do
frame.id = 0x10644040;
frame.length = 3;
frame.data.byte[0] = 0x00;
frame.data.byte[1] = 0x00;
frame.data.byte[2] = 0xFF;
sendFrame(&SWCAN, frame);
But nothing happens. I tried all different sorts of modifying the frame, like setting priority, rtr, etc. but to no avail.
Macchina has published a custom board configuration for the Arduino IDE. Because that configuration uses different pin [array index] numbers, sketches (such as M2RET) which utilize SamNonDuePin
will not work because Due-based numbers are used.
Is switching to use the M2 board configuration on M2RET's roadmap and/or wold you consider merging a pull request making the change?
Read Me points to the Macchina repo for mcp2515 but code needs updates added to Collin's fork. Either the read me should point to Collin's fork or a pull request to the Macchina repo should be created.
Is there any documentation?
I'm wondering how the output from M2RET is formatted. Is it binary? ASCII? Can you send commands to M2RET, and if so how? Etc..
Hi,
iam new to using the M2 to tinker around with my 2016 Skoda Octavia III and wanted to get M2RET running on my M2 with SavvyCAN at first.
I've installed the newest Arduino Software and also installed the Board Configuration described on the Macchina page and was also able to upload and test the "LED Blink" Example, so the basic things seem to work.
Then i "git clone"ed all the libraries here (due_can, wire, mcp...) to ~/Documents/Arduino/libraries with their normal "git clone" names. Then i tried to Compile the also latest master clone of M2RET and got the following errors (i think the double libraries found thing is not a problem). Can you help me?
Thanks, Martin
Error:
`Arduino: 1.8.5 (Mac OS X), Board: "Macchina M2"
/Users/martinseener/Documents/Arduino/M2RET/M2RET.ino: In function 'void setup()':
M2RET:310: error: 'class SWcan' has no member named 'setListenOnlyMode'
SWCAN.setListenOnlyMode(true);
^
M2RET:314: error: 'class SWcan' has no member named 'setListenOnlyMode'
SWCAN.setListenOnlyMode(false);
^
/Users/martinseener/Documents/Arduino/M2RET/M2RET.ino: In function 'void sendFrame(CAN_COMMON*, CAN_FRAME&)':
M2RET:392: error: comparison between distinct pointer types 'CAN_COMMON*' and 'SWcan*' lacks a cast
if (bus == &SWCAN) whichBus = 2;
^
/Users/martinseener/Documents/Arduino/M2RET/M2RET.ino: In function 'void loop()':
M2RET:705: error: no matching function for call to 'SWcan::GetRXFrame(CAN_FRAME&)'
if (SWCAN.GetRXFrame(incoming)) {
^
/Users/martinseener/Documents/Arduino/M2RET/M2RET.ino:705:34: note: candidate is:
In file included from /Users/martinseener/Documents/Arduino/libraries/Single-Wire-CAN-mcp2515/src/MCP2515_sw_can.h:34:0,
from /Users/martinseener/Documents/Arduino/M2RET/M2RET.ino:37:
/Users/martinseener/Documents/Arduino/libraries/mcp2515/src/MCP2515.h:67:7: note: bool MCP2515::GetRXFrame(Frame&)
bool GetRXFrame(Frame &frame);
^
/Users/martinseener/Documents/Arduino/libraries/mcp2515/src/MCP2515.h:67:7: note: no known conversion for argument 1 from 'CAN_FRAME' to 'Frame&'
M2RET:959: error: cannot convert 'SWcan*' to 'CAN_COMMON*' for argument '1' to 'void sendFrame(CAN_COMMON*, CAN_FRAME&)'
if (out_bus == 2) sendFrame(&SWCAN, build_out_frame);
^
Multiple libraries were found for "due_can.h"
Used: /Users/martinseener/Documents/Arduino/libraries/due_can
Not used: /Users/martinseener/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/due_can
Multiple libraries were found for "Arduino_Due_SD_HSMCI.h"
Used: /Users/martinseener/Documents/Arduino/libraries/M2_SD_HSMCI
Not used: /Users/martinseener/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/M2_SD_HSMCI
Not used: /Users/martinseener/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/M2_SD_HSMCI
Not used: /Users/martinseener/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/M2_SD_HSMCI
Not used: /Users/martinseener/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/M2_SD_HSMCI
Multiple libraries were found for "due_wire.h"
Used: /Users/martinseener/Documents/Arduino/libraries/due_wire
Not used: /Users/martinseener/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/due_wire
Multiple libraries were found for "lin_stack.h"
Used: /Users/martinseener/Documents/Arduino/libraries/LIN
Not used: /Users/martinseener/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/LIN
Not used: /Users/martinseener/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/LIN
Not used: /Users/martinseener/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/LIN
Not used: /Users/martinseener/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/LIN
Multiple libraries were found for "MCP2515_sw_can.h"
Used: /Users/martinseener/Documents/Arduino/libraries/Single-Wire-CAN-mcp2515
Not used: /Users/martinseener/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/Single-Wire-CAN-mcp2515
Not used: /Users/martinseener/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/Single-Wire-CAN-mcp2515
Not used: /Users/martinseener/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/Single-Wire-CAN-mcp2515
Not used: /Users/martinseener/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/Single-Wire-CAN-mcp2515
Multiple libraries were found for "MCP2515.h"
Used: /Users/martinseener/Documents/Arduino/libraries/mcp2515
Not used: /Users/martinseener/Library/Arduino15/packages/macchina/hardware/sam/0.2.1/libraries/mcp2515
exit status 1
'class SWcan' has no member named 'setListenOnlyMode'
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
`
Interestingly, I tried using the newest version of bossac (1.9.1) to flash M2RET and it didn't work. I just get:
No device found on cu.Bluetooth-Incoming-Port
even though I set
stty -f /dev/tty.usbmodem14201 1200 cs8 cread clocal
If I use the bossac included here (1.3a) then it works fine.
Readme needs to include a reference to the can_common library for people building M2RET from scratch.
As discussed on the ESP32RET repo, the SuperB support is not working M2RET. Reopening the issue here so it's in the right place.
I was trying to get LAWICEL mode working on on an M2, I found that it worked fine if the SysSettings.lawicelMode
variable is set to true. I was able to do this either by sending the 'V' command manually over the serial port, or by changing how the 'O' command was handled (although I suspect that this isn't the proper way to fix this behavior):
diff --git a/SerialConsole.cpp b/SerialConsole.cpp
index 740025d..5bb6b37 100644
--- a/SerialConsole.cpp
+++ b/SerialConsole.cpp
@@ -196,8 +196,8 @@ void SerialConsole::handleShortCmd()
//Lawicel specific commands
case 'O': //LAWICEL open canbus port (first one only because LAWICEL has no concept of dual canbus
- Can0.disable_autobaud_listen_mode();
- Can0.begin(settings.CAN0Speed, 255);
+ //Can0.disable_autobaud_listen_mode();
+ //Can0.begin(settings.CAN0Speed, 255);
Can0.enable();
SerialUSB.write(13); //send CR to mean "ok"
SysSettings.lawicelMode = true;
After making this change I was able to use slcand to be able to use the Linux socketcan utilities:
$ sudo slcand -o -c /dev/ttyACM0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.