Skip to content

Commit

Permalink
update name of ESP32 CAN library from ThomasBarth-ESP32-CAN-Driver to…
Browse files Browse the repository at this point in the history
… miwagner-ESP32-Arduino-CAN

- this change is implemented as the README.md file states that the miwagner/ESP32-Arduino-CAN is used in a slightly modified form
  • Loading branch information
lenvm committed Nov 11, 2023
1 parent 1ae7d51 commit e1c84e3
Show file tree
Hide file tree
Showing 30 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions Software/Software.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
#include "HardwareSerial.h"
#include "USER_SETTINGS.h"
#include "src/battery/BATTERIES.h"
#include "src/devboard/can/ESP32CAN.h"
#include "src/devboard/config.h"
#include "src/devboard/modbus/mbServerFCs.h"
#include "src/inverter/INVERTERS.h"
#include "src/lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
#include "src/lib/adafruit-Adafruit_NeoPixel/Adafruit_NeoPixel.h"
#include "src/lib/eModbus-eModbus/Logging.h"
#include "src/lib/eModbus-eModbus/ModbusServerRTU.h"
#include "src/lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
#include "src/lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

//CAN parameters
CAN_device_t CAN_cfg; // CAN Config
Expand Down
4 changes: 2 additions & 2 deletions Software/src/battery/BMW-I3-BATTERY.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "BMW-I3-BATTERY.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

//TODO before using
// Map the final values in update_values_i3_battery, set some to static values if not available (current, discharge max , charge max)
Expand Down
2 changes: 1 addition & 1 deletion Software/src/battery/BMW-I3-BATTERY.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define BMW_I3_BATTERY_H
#include <Arduino.h>
#include "../../USER_SETTINGS.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

#define ABSOLUTE_MAX_VOLTAGE \
4040 // 404.4V,if battery voltage goes over this, charging is not possible (goes into forced discharge)
Expand Down
4 changes: 2 additions & 2 deletions Software/src/battery/CHADEMO-BATTERY.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "CHADEMO-BATTERY.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

/* Do not change code below unless you are sure what you are doing */
static unsigned long previousMillis100 = 0; // will store last time a 100ms CAN Message was send
Expand Down
2 changes: 1 addition & 1 deletion Software/src/battery/CHADEMO-BATTERY.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define CHADEMO_BATTERY_H
#include <Arduino.h>
#include "../../USER_SETTINGS.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

#define ABSOLUTE_MAX_VOLTAGE \
4040 // 404.4V,if battery voltage goes over this, charging is not possible (goes into forced discharge)
Expand Down
4 changes: 2 additions & 2 deletions Software/src/battery/IMIEV-CZERO-ION-BATTERY.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "IMIEV-CZERO-ION-BATTERY.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

//Code still work in progress, TODO:
//Figure out if CAN messages need to be sent to keep the system happy?
Expand Down
2 changes: 1 addition & 1 deletion Software/src/battery/IMIEV-CZERO-ION-BATTERY.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define IMIEV_CZERO_ION_BATTERY_H
#include <Arduino.h>
#include "../../USER_SETTINGS.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

#define ABSOLUTE_MAX_VOLTAGE \
4040 // 404.4V,if battery voltage goes over this, charging is not possible (goes into forced discharge)
Expand Down
4 changes: 2 additions & 2 deletions Software/src/battery/KIA-HYUNDAI-64-BATTERY.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "KIA-HYUNDAI-64-BATTERY.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

/* Do not change code below unless you are sure what you are doing */
static unsigned long previousMillis10 = 0; // will store last time a 10ms CAN Message was send
Expand Down
2 changes: 1 addition & 1 deletion Software/src/battery/KIA-HYUNDAI-64-BATTERY.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define KIA_HYUNDAI_64_BATTERY_H
#include <Arduino.h>
#include "../../USER_SETTINGS.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

#define ABSOLUTE_MAX_VOLTAGE \
4040 // 404.4V,if battery voltage goes over this, charging is not possible (goes into forced discharge)
Expand Down
4 changes: 2 additions & 2 deletions Software/src/battery/NISSAN-LEAF-BATTERY.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "NISSAN-LEAF-BATTERY.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

/* Do not change code below unless you are sure what you are doing */
static unsigned long previousMillis10 = 0; // will store last time a 10ms CAN Message was send
Expand Down
2 changes: 1 addition & 1 deletion Software/src/battery/NISSAN-LEAF-BATTERY.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define NISSAN_LEAF_BATTERY_H
#include <Arduino.h>
#include "../../USER_SETTINGS.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

#define ABSOLUTE_MAX_VOLTAGE \
4040 // 404.4V,if battery voltage goes over this, charging is not possible (goes into forced discharge)
Expand Down
4 changes: 2 additions & 2 deletions Software/src/battery/RENAULT-ZOE-BATTERY.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "RENAULT-ZOE-BATTERY.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

/* Do not change code below unless you are sure what you are doing */
#define LB_MAX_SOC 1000 //BMS never goes over this value. We use this info to rescale SOC% sent to Fronius
Expand Down
2 changes: 1 addition & 1 deletion Software/src/battery/RENAULT-ZOE-BATTERY.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define RENAULT_ZOE_BATTERY_H
#include <Arduino.h>
#include "../../USER_SETTINGS.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

#define ABSOLUTE_MAX_VOLTAGE \
4040 // 404.4V,if battery voltage goes over this, charging is not possible (goes into forced discharge)
Expand Down
4 changes: 2 additions & 2 deletions Software/src/battery/TESLA-MODEL-3-BATTERY.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "TESLA-MODEL-3-BATTERY.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

/* Do not change code below unless you are sure what you are doing */
/* Credits: Most of the code comes from Per Carlen's bms_comms_tesla_model3.py (https://gitlab.com/pelle8/batt2gen24/) */
Expand Down
2 changes: 1 addition & 1 deletion Software/src/battery/TESLA-MODEL-3-BATTERY.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define TESLA_MODEL_3_BATTERY_H
#include <Arduino.h>
#include "../../USER_SETTINGS.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

#define ABSOLUTE_MAX_VOLTAGE \
4030 // 403.0V,if battery voltage goes over this, charging is not possible (goes into forced discharge)
Expand Down
4 changes: 2 additions & 2 deletions Software/src/inverter/BYD-CAN.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "BYD-CAN.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

/* Do not change code below unless you are sure what you are doing */
static unsigned long previousMillis2s = 0; // will store last time a 2s CAN Message was send
Expand Down
2 changes: 1 addition & 1 deletion Software/src/inverter/BYD-CAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define BYD_CAN_H
#include <Arduino.h>
#include "../../USER_SETTINGS.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

extern uint16_t SOC;
extern uint16_t StateOfHealth;
Expand Down
4 changes: 2 additions & 2 deletions Software/src/inverter/PYLON-CAN.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "PYLON-CAN.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

#define SEND_0 //If defined, the messages will have ID ending with 0 (useful for some inverters)
//#define SEND_1 //If defined, the messages will have ID ending with 1 (useful for some inverters)
Expand Down
2 changes: 1 addition & 1 deletion Software/src/inverter/PYLON-CAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define PYLON_CAN_H
#include <Arduino.h>
#include "../../USER_SETTINGS.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

extern uint16_t SOC;
extern uint16_t StateOfHealth;
Expand Down
4 changes: 2 additions & 2 deletions Software/src/inverter/SMA-CAN.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "SMA-CAN.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

//TODO, change CAN sending routine once confirmed that 500ms interval is OK for this battery type

Expand Down
2 changes: 1 addition & 1 deletion Software/src/inverter/SMA-CAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define SMA_CAN_H
#include <Arduino.h>
#include "../../USER_SETTINGS.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

extern uint16_t SOC; //SOC%, 0-100.00 (0-10000)
extern uint16_t StateOfHealth; //SOH%, 0-100.00 (0-10000)
Expand Down
4 changes: 2 additions & 2 deletions Software/src/inverter/SOFAR-CAN.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "SOFAR-CAN.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

/* This implementation of the SOFAR can protocol is halfway done. What's missing is implementing the inverter replies, all the CAN messages are listed, but the can sending is missing. */

Expand Down
2 changes: 1 addition & 1 deletion Software/src/inverter/SOFAR-CAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define SOFAR_CAN_H
#include <Arduino.h>
#include "../../USER_SETTINGS.h"
#include "../devboard/can/ESP32CAN.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"

// These parameters need to be mapped for the inverter
extern uint16_t SOC; //SOC%, 0-100.00 (0-10000)
Expand Down
4 changes: 2 additions & 2 deletions Software/src/inverter/SOLAX-CAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#define SOLAX_CAN_H
#include <Arduino.h>
#include "../../USER_SETTINGS.h"
#include "../devboard/can/ESP32CAN.h"
#include "../devboard/config.h"

#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
#include "../lib/pierremolinaro-acan2515/ACAN2515.h"

extern ACAN2515 can;

extern uint16_t SOC;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef ESP32CAN_H
#define ESP32CAN_H

#include "../../lib/ThomasBarth-ESP32-CAN-Driver/CAN.h"
#include "../../lib/ThomasBarth-ESP32-CAN-Driver/CAN_config.h"
#include "../../lib/miwagner-ESP32-Arduino-CAN/CAN.h"
#include "../../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
extern uint8_t LEDcolor;

class ESP32CAN {
Expand Down

0 comments on commit e1c84e3

Please sign in to comment.