CanID's (and a picture of the startup screen
Here's a snippet of my Arduino Code where the CanId's are converted to values
if (canId == 0x0188)
{
SOC2 = buf[0];
// ?? byte 1 (always 0)
// ?? byte 2 (always 66, but 3 while charging in another session)
ChargeCycles = buf[3] + 256 * buf[4]; // byte 3 is number of charge cycles (probably byte 4 as well (highbyte)
CellBalance = buf[5]; // byte 5 could be Cel Balance value
// ?? byte 6 (always 0)
// ?? byte 7 (always 4 maybe number of bricks ?)
}
if (canId == 0x01C0)
{
// ?? byte 0 (fixed at 32)
// ?? byte 1 (fixed at 0)
DashTimeHours = buf[2]; // byte 2 is Dash Time Hours
DashTimeMinutes = buf[3]; // byte 3 is Dash Time Minutes
DashTimeSeconds = buf[4]; // byte 4 is Dash Time Seconds
NumberOfCanMessageSets = buf[5] + 258 * buf[6] + 256 * 256 * buf[7]; // byte 5 - 7 is number of canbus message SETS received since power on ??
}
if (canId == 0x0206) // this canID only appears during charging !!
{
// ?? byte 0 (batterypack temperature ??)
// ?? byte 1 (fixed at 2 during charging)
ChargerVoltage = buf[2] * 0.001 + buf[3] * 0.256 + buf[4] * 65.535; // byte 2-3-4 Charger voltage in mV (division by 1000 gets Volts)
// ?? byte 5 (fixed at 1)
// ?? byte 6 (fixed at 0)
// ?? byte 7 (fixed at 0)
}
if (canId == 0x240)
{
if (bitRead(buf[0],2) == 1) Mode = "Sport "; //A5 // CanID 0x0240 byte 0 = Mode
if (bitRead(buf[0],3) == 1) Mode = "Eco "; // A9
if (bitRead(buf[0],4) == 1) Mode = "Custom"; // B1
// ?? byte 1 = always 0F : unknown
Speed = (buf[2] * 0.01) + (buf[3] * 2.56); // byte 2 and 3 is Speed in kph
PowerBar = buf[4]; // ?? byte 4 is Power bar on dash ?? (It is power related)
TorqueBar = buf[5]; // ?? byte 5 is Torque bar on dash ?? (It is Torque related)
SOC = buf[6]; // byte 6 is State Of Charge on dash in %
// no Byte 7
}
if (canId == 0x0281)
{
MotorRPM = buf[0] + 256 * buf[1]; // ?? byte 0, 1 is motor RPM (same as canID 0x0340 byte 4 and 5)
// ?? byte 2 (fixed at 0)
// ?? byte 3 (fixed at 0)
ThrottlePosition = buf[4] + 256 * buf[5]; // ?? byte 4, 5 is throttle position (around 125 is closed, aroud 1200 is fully open)
MotorTemp = buf[6]; // ?? byte 6 is motor temperature (second time) this time in 1 byte , not 2 as in canid 440
// ?? byte 7 (fixed at 0)
}
if (canId == 0x0288)
{
Power = buf[0] + 256 * buf[1]; // byte 0, 1 Power in Watts
// ?? byte 2 (fixed at 231)
// ?? byte 3 (fixed at 0)
// ?? byte 4 (fixed at 50)
// ?? byte 5 (fixed at 114)
// ?? byte 6 (fixed at 0)
// ?? byte 7 (fixed at 18 not any temperature))
}
if (canId == 0x340)
{
Trip1 = buf[0] * 0.01 + buf[1] * 2.56; // byte 0, 1 is Trip 1
// ?? byte 2 (always 0)
// ?? byte 3 (always 0)
RPM = buf[4] + 256 * buf[5]; // byte 4, 5 is motor RPM
ErrorCode = buf[6]; // byte 6 (error code on dash, 44 is killswitch, 45 is kickstand etc)
// ?? byte 7 (always 0)
}
if (canId == 0x0381)
{
// ?? byte 0
// ?? byte 1
ControllerTemp = buf[2];
// ?? byte 3
// ?? byte 4
// ?? byte 6
// ?? byte 7
}
if (canId == 0x0388)
{
// ?? byte 0 (very random ?? 0-25 when speed = 0 , goes higher/lower when powering or regen)
// ?? byte 1 (very reandom ?? 246-248 when speed = 0, goes higher/lower when powering or regen)
// ?? byte 2 (always 15)
Vbatt = 0.001 * buf[3] + 0.256 * buf[4] + 65.535 * buf[5]; // byte 3, 4 and 5 are Vbatt in units of mV (divide by 1000 to get Volts)
// ?? byte 6 (always zero)
// ?? byte 7 (increases with torque/power and is negative with regen : could be power/torque/battery or motor amps
}
if (canId == 0x0408)
{
// byte 0
BatteryTemp = buf[1]; // byte 1 is battery temp in celcius
// byte 2 (same as byte 1) could be second temp sensor ?? needs change in battery temp)
BatteryAmps = buf[3] + 256 * buf[4]; // byte 3 battery amps, both when charging and
// byte 5 (fixed at 131)
// byte 6 (fixed at 0)
// byte 7 (fixed at 255)
}
if (canId == 0x0440)
{
Trip2 = buf[0] * 0.01 + buf[1] * 2.56; // byte 0, 1 is Trip 2 in units of 10 mtrs (divided by 100 to get KM)
// byte 2 (fixed at 0)
// byte 3 (fixed at 0)
Range = buf[4] * 0.01 + buf[5] * 2.56; // byte 4, 5 is range in units of 10 mtrs (divided by 100 to get KM)
MotorTemperature = buf[6] * 0.01 + buf[7] * 2.56; // byte 6, 7 is motortemperature in 0.01 degrees but only 2200, 2300, 2400 (divsion by 100 is immediate integer value)
}
if (canId == 0x0508)
{
// ?? byte 0,1 ,2 are number of seconds used or maybe even lifetime possibly bytes 3 and on also included (at feb-2019 bytes are (xxx,223,114,92,10,0,75,0)
// ?? byte 1
// ?? byte 2
// ?? byte 3
// ?? byte 4
// ?? byte 5
// ?? byte 6
// ?? byte 7
}
if (canId == 0x02C0)
{
ODO = 0.1 * buf[0] + 25.6 * buf[1] + 6553.5 * buf[2]; // byte 0, 1 and 2 are ODO in units of 100 mtrs (divided by 10 to get KM)
// ?? byte 3 (fixed at 0)
// ?? byte 4 (fixed at 0)
// ?? byte 5 (fixed at 0)
// ?? byte 6 (fixed at 16)
// ?? byte 7 (fixed at 0)
}
}