Joined
·
5,395 Posts
This is literally the reasons forums exist. That will be the last thing I ever say to you, good sir.You clearly don't understand the bullshit Damien has gone through from this community -- to the point where he shut down support for Model X/S component development. Pull his name off this posting before he gets driven to a "fuckit" state of mind.
If you want software development or get coding advice, you should be on openinverter contributing to their work, trading their sweat for yours. Opensource means ANY development you do on their codebase gets thrown back jnto the pot.
This one. And the apparent 99,000 libraries that go with itI'm not familiar with that code, but I can take a stab at it for funzies. Which file(s) are you compiling ?
Well, that's the link to the repo... I took a quick glance at it, and I see a few "ino" files under the Software folder, I thought you were compiling one of those. Yes, it is of course expected that there will be a million libraries, and some libraries may not be available on some Arduino models. Either way, I can try to take a look if you give me more solid directionsThis one. And the apparent 99,000 libraries that go with it
![]()
GitHub - damienmaguire/Nissan-Leaf-Inverter-Controller: OpenSource Control Unit for the Nissan Leaf Gen 1 and Gen 2 inverter
OpenSource Control Unit for the Nissan Leaf Gen 1 and Gen 2 inverter - GitHub - damienmaguire/Nissan-Leaf-Inverter-Controller: OpenSource Control Unit for the Nissan Leaf Gen 1 and Gen 2 invertergithub.com
OK. Bear with me here, I'm a moron and don't know what I'm doing.Well, that's the link to the repo... I took a quick glance at it, and I see a few "ino" files under the Software folder, I thought you were compiling one of those. Yes, it is of course expected that there will be a million libraries, and some libraries may not be available on some Arduino models. Either way, I can try to take a look if you give me more solid directions![]()
Yes sir. 1.8.16Okay, I know what you did there. I will try to reproduce it locally now.
Edit: what IDE version are you using ? I assume official Arduino IDE ?
OK. So I have the two wire chip wired to my uno. There's plenty of can inferfaces on the web using that setupFor personal projects I use Eclipse with Arduino plugin. It is a bit convoluted for beginner use though.
Which library did you use for twi ? I get a compilation error due to missing twi.h when targetting Uno. Compiles fine for Due.
Basically here is the deal... those code examples rely on some capabilities in Due board, such as interrupt-driven timers and two-wire interface, which are expected to be present for the CAN library. Now either those interfaces need to be emulated, or the CAN library can be swapped out for another one that will work on Uno. In addition, there will be some wiring differences.
So really if Uno is all you got, the only thing this code is useful for is as a reference of the frame structure / communication protocol.
That last line calls the CAN library to send the frame out. That will need to be replaced with whatever other library can do the same stuff on Uno given your other hardware. Of course it's often not that simple, given library calls may take different arguments, require different initialization style, etc, etc. I think if you don't have a lot of expertise, you should just get the Due board.void Msgs100ms() ////100ms messages here
{
digitalWrite(led, !digitalRead(led)); //toggle led everytime we fire the 100ms messages.
outFrame.id = 0x50b; // Set our transmission address ID
outFrame.length = 7; // Data payload 8 bytes
outFrame.extended = 0; // Extended addresses - 0=11-bit 1=29bit
outFrame.rtr=1; //No request
// Statistics from 2016 capture:
// 10 00000000000000
// 21 000002c0000000
// 122 000000c0000000
// 513 000006c0000000
// Let's just send the most common one all the time
// FIXME: This is a very sloppy implementation
// hex_to_data(outFrame.data.bytes, "00,00,06,c0,00,00,00");
outFrame.data.bytes[0]=0x00;
outFrame.data.bytes[1]=0x00;
outFrame.data.bytes[2]=0x06;
outFrame.data.bytes[3]=0xc0;
outFrame.data.bytes[4]=0x00;
outFrame.data.bytes[5]=0x00;
outFrame.data.bytes[6]=0x00;
/*CONSOLE.print(F("Sending "));
print_fancy_inFrame(inFrame);
CONSOLE.println();*/
Can0.sendFrame(outFrame);
}
So what else are you intending to run on the Uno ? The only reason it's difficult to run Damien's code on Uno is the fact the code relies on hardware-optimized communication libraries written specifically for Due. If your other stuff is relatively hardware-intependent, it should work on Due.
Ten four. I'll save the uno for some other task.