Skip to content

Commit a8b4f0e

Browse files
committed
Revert "Add LilyGo T-Can485 board support"
This reverts commit b1a20b6.
1 parent b1a20b6 commit a8b4f0e

File tree

5 files changed

+6
-115
lines changed

5 files changed

+6
-115
lines changed

README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,14 @@ HeidelBridge is a firmware for ESP32 microcontrollers. It allows you to bring yo
2121

2222
# Required Hardware
2323

24-
You have two options for the hardware setup:
25-
26-
## Option 1: ESP32 + External MAX485 Module
27-
You need two components: an ESP32 microcontroller and a MAX485 module. Both are available in large quantities and at reasonable prices on the Internet. You will also need a breadboard and a few jumper wires. All in all, it shouldn't cost you more than 10€.
24+
You only need two components for this project: an ESP32 microcontroller and a MAX485 module. Both are available in large quantities and at reasonable prices on the Internet. You will also need a breadboard and a few jumper wires. All in all, it shouldn't cost you more than 10€.
2825

2926
Parts list:
3027
- ESP32 microcontroller*
3128
- MAX485 breakout board
3229
- 6 jumper wires
3330
- A breadboard
3431

35-
## Option 2: LilyGo T-Can485 Board
36-
Alternatively, you can use a LilyGo T-Can485 board which has the RS485 transceiver already built-in, eliminating the need for an external MAX485 module.
37-
38-
Parts list:
39-
- LilyGo T-Can485 board (includes ESP32 + built-in RS485 transceiver)
40-
- 3 jumper wires (for connecting to the wallbox)
41-
4232
This should be enough for quickly putting together a fully functioning prototype.
4333
Of course a well designed PCB would be much nicer, but this is still work in progress. Once the design is ready, the schematics will be available *right here*.
4434

docs/SoftwareSetup.md

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -51,55 +51,8 @@ Then follow these steps:
5151

5252
- Start by cloning or downloading this repository.
5353
- Optional: change `board = ...` in platformio.ini to match the ESP32 board you are actually using.
54-
- Choose the appropriate build environment (see [Build Environments](#build-environments) below).
5554
- Compile the project.
5655
- Build the file system image via the PlatformIO command palette.
5756
- Now connect your ESP32 via USB.
5857
- Upload the file system image.
5958
- Upload the firmware.
60-
61-
## Build Environments
62-
63-
HeidelBridge supports multiple build environments to accommodate different hardware configurations:
64-
65-
### Standard ESP32 + External RS485 Module (`heidelberg`)
66-
This is the default build environment for regular ESP32 development boards with an external RS485 module.
67-
68-
**To compile:**
69-
```bash
70-
pio run -e heidelberg
71-
```
72-
73-
**Pin configuration:**
74-
- GPIO18 → RS485 RO (Receiver Output)
75-
- GPIO19 → RS485 DI (Driver Input)
76-
- GPIO21 → RS485 DE+RE
77-
78-
### LilyGo T-Can485 Board (`lilygo`)
79-
This build environment is specifically designed for the LilyGo T-Can485 board, which has built-in RS485 capabilities and **does not require an external MAX485 module**.
80-
81-
**To compile:**
82-
```bash
83-
pio run -e lilygo
84-
```
85-
86-
**Pin configuration:**
87-
- GPIO21 → RS485 RO (Receiver Output)
88-
- GPIO22 → RS485 DI (Driver Input)
89-
- GPIO21 → RS485 DE+RE
90-
91-
**Additional features:**
92-
- Automatic initialization of onboard RS485 transceivers
93-
- 5V power supply control
94-
- CAN bus support (hardware available but not used in current firmware)
95-
- **No external MAX485 module needed** - RS485 transceiver is built into the board
96-
97-
For detailed wiring information and hardware setup for the LilyGo T-Can485 board, please refer to the [discussion thread](https://github.com/BorisBrock/HeidelBridge/discussions/4).
98-
99-
### Dummy Wallbox (`dummy`)
100-
This build environment creates a simulation mode for testing without actual wallbox hardware.
101-
102-
**To compile:**
103-
```bash
104-
pio run -e dummy
105-
```

platformio.ini

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
default_envs = heidelberg
1313

1414
[env]
15-
platform = espressif32
16-
board = esp32dev
15+
platform = espressif32@^6.8.1
16+
board = esp32doit-devkit-v1
1717
upload_protocol = esptool
18-
upload_port = COM4
18+
upload_port = /dev/ttyUSB*
1919
framework = arduino
2020
board_build.partitions = partitions.csv
2121
monitor_speed = 115200
@@ -40,10 +40,4 @@ build_flags =
4040
build_flags =
4141
-O2
4242
-D DUMMY_WALLBOX
43-
-D LOGGING_LEVEL_DEBUG
44-
45-
[env:lilygo]
46-
build_flags =
47-
-O2
48-
-D LILYGO_BOARD
49-
-D LOGGING_LEVEL_ERROR
43+
-D LOGGING_LEVEL_DEBUG

src/Components/Modbus/ModbusRTU.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,6 @@ void ModbusRTU::Init()
2525
gMutex = xSemaphoreCreateMutex();
2626

2727
// Init serial conneted to the RTU Modbus
28-
29-
#ifdef LILYGO_BOARD
30-
//config for Lilygo ESP32 RS485 board
31-
pinMode(RS485_EN_PIN, OUTPUT);
32-
digitalWrite(RS485_EN_PIN, HIGH);
33-
34-
pinMode(RS485_SE_PIN, OUTPUT);
35-
digitalWrite(RS485_SE_PIN, HIGH);
36-
37-
pinMode(PIN_5V_EN, OUTPUT);
38-
digitalWrite(PIN_5V_EN, HIGH);
39-
// end config for Lilygo ESP32 RS485 board
40-
#endif
41-
4228
Logger::Info("Starting RS485 hardware serial");
4329
RTUutils::prepareHardwareSerial(gRs485Serial);
4430
gRs485Serial.begin(

src/Configuration/Pins.h

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,11 @@
22

33
namespace Pins
44
{
5-
#ifdef LILYGO_BOARD
6-
// Config for the Lilygo T-Can485 Board
7-
// Pin connections:
8-
// ESP32 GPIO21 -> MAXRS485 RO (Receiver Output)
9-
// ESP32 GPIO22 -> MAXRS485 DI (Driver Input)
10-
// ESP32 GPIO21 -> MAXRS485 DE+RE
11-
constexpr uint8_t PinRX = GPIO_NUM_21;
12-
constexpr uint8_t PinTX = GPIO_NUM_22;
13-
constexpr uint8_t PinRTS = GPIO_NUM_21;
14-
#else
15-
// Config for regular ESP32 boards + external RS485 module
165
// Pin connections:
176
// ESP32 GPIO18 -> MAXRS485 RO (Receiver Output)
187
// ESP32 GPIO19 -> MAXRS485 DI (Driver Input)
198
// ESP32 GPIO21 -> MAXRS485 DE+RE
209
constexpr uint8_t PinRX = GPIO_NUM_18;
2110
constexpr uint8_t PinTX = GPIO_NUM_19;
2211
constexpr uint8_t PinRTS = GPIO_NUM_21;
23-
#endif
24-
};
25-
26-
#ifdef LILYGO_BOARD
27-
#define PIN_5V_EN 16
28-
29-
#define CAN_TX_PIN 26
30-
#define CAN_RX_PIN 27
31-
#define CAN_SE_PIN 23
32-
33-
#define RS485_EN_PIN 17 // 17 /RE
34-
#define RS485_TX_PIN 22 // 21
35-
#define RS485_RX_PIN 21 // 22
36-
#define RS485_SE_PIN 19 // 22 /SHDN
37-
38-
#define SD_MISO_PIN 2
39-
#define SD_MOSI_PIN 15
40-
#define SD_SCLK_PIN 14
41-
#define SD_CS_PIN 13
42-
43-
#define WS2812_PIN 4
44-
#endif
12+
};

0 commit comments

Comments
 (0)