114 lines
4.0 KiB
Markdown
114 lines
4.0 KiB
Markdown
# 🔌 Echelon 83331 MEP Sniffer with ESP32
|
||
|
||
A project for reading raw data from the MEP port of the Echelon 83331 electricity meter using an ESP32. Data is read in RAW format for later parsing and decryption with a locally stored encryption key.
|
||
|
||
## 🎯 Purpose
|
||
|
||
- Read measurement data directly from the meter's MEP port.
|
||
- Avoid dependencies like SaveEye, cloud services, or MQTT.
|
||
- Store and parse all data 100% locally.
|
||
- Later send data to Home Assistant via REST API.
|
||
|
||
---
|
||
|
||
## 🔌 Hardware Connection
|
||
|
||
### 📟 Components
|
||
- ESP32 DevKit (WROOM recommended)
|
||
- RJ12 female socket or MEP adapter
|
||
- Optional logic level shifter (if MEP port uses RS-232 instead of TTL)
|
||
- Jumper wires
|
||
|
||
### ⚙️ MEP RJ12 Pinout (standard):
|
||
|
||
| Pin | Signal | Example ESP32 GPIO |
|
||
|-----|---------------|--------------------|
|
||
| 1 | GND | GND |
|
||
| 2 | VCC (3.3/5V) | 3.3V / 5V (check meter specs) |
|
||
| 3 | TX from meter | GPIO16 (RX) |
|
||
| 4 | RX to meter | GPIO17 (TX) |
|
||
| 5–6 | Not used | – |
|
||
|
||
> ⚠️ Double-check voltage and signal type – if RS-232 is used, insert a MAX3232 between ESP32 and the meter.
|
||
|
||
---
|
||
|
||
## 📊 Expected Data Output
|
||
|
||
Once decoding is active and the correct encryption key is implemented, the following output is expected from the meter:
|
||
|
||
| Field | Unit | Description |
|
||
|----------------------------|----------|------------------------------------------|
|
||
| `meterType` | String | Meter type (e.g., "MEP meter") |
|
||
| `meterSerialNumber` | String | Serial number of the meter |
|
||
| `wifiRssi` | dBm | Signal strength (only relevant for WiFi) |
|
||
| `activeActualConsumption` | Watt (W) | Instantaneous active consumption |
|
||
| `activeActualProduction` | Watt (W) | Instantaneous production (e.g., solar) |
|
||
| `activeTotalConsumption` | Wh/kWh | Accumulated consumption |
|
||
| `activeTotalProduction` | Wh/kWh | Accumulated production |
|
||
| `reactiveActualConsumption`| VAr | Instantaneous reactive consumption |
|
||
| `reactiveActualProduction` | VAr | Instantaneous reactive production |
|
||
| `rmsVoltage` (L1–L3) | Volt (V) | RMS voltage per phase |
|
||
| `rmsCurrent` (L1–L3) | mA / A | RMS current per phase |
|
||
| `powerFactor` | % | Power factor (e.g., 98 = 0.98 cos(φ)) |
|
||
|
||
> Note: Some values depend on the meter's firmware and configuration.
|
||
|
||
---
|
||
|
||
## 🔍 ESP32 Sniffer Code (Arduino C++)
|
||
|
||
Use this code to log raw data from the meter in HEX format for analysis:
|
||
|
||
```cpp
|
||
#include <HardwareSerial.h>
|
||
|
||
HardwareSerial MEP(2); // UART2
|
||
|
||
void setup() {
|
||
Serial.begin(115200);
|
||
MEP.begin(9600, SERIAL_8N1, 16, 17); // RX=GPIO16, TX=GPIO17
|
||
|
||
Serial.println("🔍 Starting MEP sniffer...");
|
||
}
|
||
|
||
void loop() {
|
||
while (MEP.available()) {
|
||
byte b = MEP.read();
|
||
if (b < 0x10) Serial.print("0");
|
||
Serial.print(b, HEX);
|
||
Serial.print(" ");
|
||
}
|
||
}
|
||
```
|
||
|
||
👉 Once connected and receiving data, bytes will appear in the Serial Monitor (baud: 115200).
|
||
|
||
---
|
||
|
||
## 🔐 Encryption Key
|
||
|
||
The project will later use the meter’s **private encryption key** (if required) to:
|
||
- Authenticate with the meter
|
||
- Decrypt binary data into readable values
|
||
|
||
### 🔒 Security Measures
|
||
- The key will be **hardcoded in firmware**.
|
||
- Changes require OTA or physical update – **no access via web or serial interface**.
|
||
- Key usage will be handled in a dedicated parsing section.
|
||
|
||
---
|
||
|
||
## 🧪 Next Steps
|
||
|
||
1. Use this sniffer to log a data dump from the meter.
|
||
2. Compare values with your known usage/voltage to identify structure.
|
||
3. We will implement parsing + decryption, and REST push to Home Assistant.
|
||
|
||
---
|
||
|
||
## 📬 Contact
|
||
|
||
> Developed and maintained by [Thomas Emil](https://www.linkedin.com/in/thomas-emil-b3497995/).
|
||
> For technical questions, reach out via GitHub Issues or ESP32 RF-beams 💡
|