Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mstegen authored Feb 7, 2025
1 parent 1fbca5e commit 746f94f
Showing 1 changed file with 73 additions and 14 deletions.
87 changes: 73 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,84 @@
# Sensorbox-2
Sensorbox2 measures the current(A) and current direction for up to three phases with CT's and a MAINS voltage input.
It can also receive these measurements directly from a (D)SMR5 smart meters P1 port.
These measurements are then sent every two seconds to the connected SmartEVSE(s).
Sensorbox2 measures the current(A) and current direction for up to three phases with CT's and a MAINS voltage input.<br>
It can also receive these measurements directly from a (D)SMR5 smart meters P1 port.<br>
These measurements are then sent every two seconds to the connected SmartEVSE(s).<br>

The Sensorbox2 uses a PIC microcontroller which does the CT measurements and sends this information to the ESP32.
The ESP32 processes the P1 port (Smart Meter connection) data and RS485 communication to the SmartESVE.
The PIC will be (re)programmed by the ESP32 module. At powerup the ESP32 looks for a PIC18F26K40.hex file in the /data folder and, when found programs the PIC18F26K40 microcontroller.
The Sensorbox2 uses a PIC microcontroller which does the CT measurements and sends this information to the ESP32.<br>
The ESP32 sends both the P1 port (Smart Meter connection) and CT measurement data over the RS485 bus to the SmartEVSE.<br>

# Upgrading firmware
## Connecting to Wifi (and updating firmware)

Versions 2.1.0 and higher have wifi, webserver and MQTT active on your Sensorbox-2; it all works similarly to the SmartEVSEv3. To upgrade from your old, non-wifi Sensorbox-2 firmware,
upgrade your SmartEVSE firmware to version v3.7.2 or higher.
To upgrade from your old, non-wifi Sensorbox-2 firmware, upgrade your SmartEVSE firmware to version v3.7.2 or higher.

Once your SmartEVSEv3 detects your Sensorbox-2's old firmware, it will present the LCD screen with a new option: SB2 WIFI, with default <Disabled>.
Select <Setup>, the Sensorbox will presents itself as a Wifi Acces Point "smartevse-xxxx"; the password is shown on the LCD screen.
Once your SmartEVSEv3 detects your Sensorbox-2's old firmware, it will present the LCD screen with a new option: **SB2 WIFI**, with default `Disabled`.
Select `Setup`, the Sensorbox will presents itself as a Wifi Acces Point "smartevse-xxxx"; the password is shown on the LCD screen.
Connect with your phone to that access point, go to http://192.168.4.1/ and configure your Wifi password.

THIS IS A ONE TIME OPERATION!
Once the Sensorbox2 is connected to your Wifi, you can find it's IP address on the SmartEVSE's SB2 WIFI menu option.<br>
Browse to this ip address, and you will see the old Sensorbox2's wifi status page.<br>

After you updated your Sensorbox-2 to v2.1.0 or higher, this function will not work anymore, and it will not be shown in your SmartEVSEv3 menu.
You are supposed to update your firmware through the /update page on the Sensorbox-2 webserver, or through the ESPtouch or USB procedure as described in the SmartEVSEv3 docs.
If you want to upgrade your Sensorbox2's firmware, browse to http://sensorbox-ip/update where "sensorbox-ip" is the ip address of the sensorbox2.<br>
First update the spiffs partition, by uploading spiffs.bin (https://github.com/SmartEVSE/Sensorbox-2/releases/download/v2.1.0/spiffs.bin)<br>
Then proceed by uploading the main firmware (https://github.com/SmartEVSE/Sensorbox-2/releases/download/v2.1.0/firmware.bin)<br>

After you updated your Sensorbox-2 to v2.1.0 or higher, the SB2 WIFI option will not be shown anymore on the SmartEVSE menu.<br>
The procedure to connect to WiFi has now also changed:

## Connecting to Wifi (ESPTouch app)

Versions 2.1.0 and higher have wifi, webserver and MQTT active on your Sensorbox2; it works similarly to the SmartEVSEv3.

On your smartphone:
- connect your smartphone to the wifi network you want your Sensorbox connected to.
- download and run the ESPTouch app from your favorite app store
[Android](https://play.google.com/store/apps/details?id=com.fyent.esptouch.android&hl=en_US:) (please ignore the strange Author name) or
[Apple](https://apps.apple.com/us/app/espressif-esptouch/id1071176700) or [Github](https://github.com/EspressifApp/EsptouchForAndroid) (for source code).
- choose EspTouch V2.
- fill in the password of the wifi network.
- fill in "1" in device count for provisioning.
- fill in the key "0123456789abcdef" in the AES key field.
- leave Custom Data empty.

On the sensorbox unplug, and reconnect the green connector.
- After a few seconds the blink pattern on the sensorbox should become Orange-Red (every two seconds).
- if you have left the mains cable connected the pattern will be blink-blink-blink-Red, where blink can be Green or Orange, depending on the current flow measured.
- note that from this point on, you have two minutes to finish this procedure!

Now on your smartphone:
- press "Confirm", within 30 seconds the app will confirm a MAC address and an IP address.
- You are connected now. If you want special stuff (static IP address, special DNS address), configure them on your AP/router.

## Connecting to Wifi (terminal)

If you don't get it to work with the ESPTouch app, there is a backup procedure:
- connect your Sensorbox2 with a USB cable to your PC.
- install the USB driver (Windows) or not (Linux) for wch ch340 chipset.
- connect your favorite serial terminal to the appropriate port, use the following settings: 115200bps, 8 bits, no parity, 1 stopbit
- press 'enter', and on your terminal window you should see a request to enter your WiFi access point name and password.
- the sensorbox should now connect to WiFi.
- and it's IP address is displayed on your terminal.

## Status Led

The status Led sequence depends on the working mode of the Sensorbox:

1 blink:
- Green: P1 measurement. Orange: CT measurement (no direction of currents)

2 blinks:
- Green: P1 measurement. Orange: CT measurement (no direction of currents)
- Green: connected to WiFi, Red: waiting to connect

3 blinks:
1. Phase L1: Green = export, Orange = import
2. Phase L3: Green = export, Orange = import
3. Phase L3: Green = export, Orange = import

4 blinks:
1. Phase L1: Green = export, Orange = import
2. Phase L3: Green = export, Orange = import
3. Phase L3: Green = export, Orange = import
4. Green: connected to WiFi, Red: waiting to connect


## Modbus Registers
Expand Down

0 comments on commit 746f94f

Please sign in to comment.