You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a docker enthusiast I prefer to utilize a dockerized version of esptool.py by bind-mounting the current working directory to `/src` and assuming that `smlreader.bin` is existing in the current working directory:
Wrote 378528 bytes (266738 compressed) at 0x00000000 in 23.6 seconds (effective 128.1 kbit/s)...
90
+
Hash of data verified.
91
+
92
+
Leaving...
93
+
Hard resetting via RTS pin...
94
+
```
95
+
96
+
---
97
+
98
+
### Using your IDE for building and flashing
99
+
100
+
You should be able to use your preferred IDE to build and flash SMLReader if you take care of the dependencies and the build flags configured in the `platform.io` file.
101
+
I strongly recommend using PlatformIO as it takes care of that itself.
102
+
103
+
#### Configuration
42
104
43
105
The configuration of the reading heads is done by editing `src/config.h` and adjusting `SENSOR_CONFIGS` (see below).
44
106
45
107
```c++
46
108
staticconst SensorConfig SENSOR_CONFIGS[] = {
47
-
{.pin = D2, // GPIO Pin
109
+
{.pin = D2, // GPIO pin of the phototransistor
48
110
.name = "1", // Sensor name used in MQTT topic
49
-
.numeric_only = false // If "true", only numeric values are being published via MQTT
111
+
.numeric_only = false, // If "true", only numeric values are being published via MQTT
112
+
.status_led_enabled = true, // Flash status LED (3 times) when an SML start sequence has been found
113
+
.status_led_inverted = true, // Some LEDs (like the ESP8266 builtin LED) require an inverted output signal
114
+
.status_led_pin = LED_BUILTIN // GPIO pin used for sensor status LED
50
115
},
51
116
{.pin = D5,
52
117
.name = "2",
53
-
.numeric_only = false
118
+
.numeric_only = false,
119
+
.status_led_enabled = true,
120
+
.status_led_inverted = true,
121
+
.status_led_pin = LED_BUILTIN
54
122
},
55
123
{.pin = D6,
56
-
.name = "3",
57
-
.numeric_only = false
124
+
.name = "3",
125
+
.numeric_only = false,
126
+
.status_led_enabled = true,
127
+
.status_led_inverted = true,
128
+
.status_led_pin = LED_BUILTIN
58
129
}
59
130
};
60
131
```
61
132
*Attention: Multi-sensor support is experimental and has not been tested due to the lack of multiple meters. For testing purposes I connected one reading head to multiple GPIO pins of my WeMos D1 mini.*
62
133
63
-
WiFi and MQTT are configured via the web interface provided by [IotWebConf](https://github.com/prampec/IotWebConf) and which can be reached after joining the WiFi network named SMLReader and heading to http://192.168.4.1.
64
-
If the device has already been configured, the web interface can be reached via the IP address obtained from your local network's DHCP server.
65
-
66
-
*Attention: You have to change the AP Password (empty by default), otherwise SMLReader won't work.*
67
-
68
-
---
69
-
70
-
### Flashing
71
-
72
-
There are several ways to flash SMLReader to your ESP8266.
73
-
I personally prefer the docker way using my dockerized version of esptool.py.
74
134
75
-
#### IDE
135
+
#### Building
76
136
77
-
You should be able to use your preferred IDE to build and flash SMLReader if you take care of the dependencies and the build flags configured in the `platform.io` file.
78
-
I strongly recommend using PlatformIO as it takes care of that itself.
137
+
Building SMLReader in PlatformIO is straight forward and can be done by executing the build task matching your environment (i.e. `d1_mini`).
79
138
80
-
#### esptool.py
139
+
In case you get the following error, it is time to install a Git client (https://git-scm.com/downloads) and to make sure that the path to `git` is covered by the PATH variable and `git` is thus executable from everywhere.

102
153
103
154
---
104
155
105
156
106
157
### Running
107
158
108
-
If everything is configured properly and running with a sensor in place, SMLReader will publish the metrics and values received from the meter to the configured MQTT broker:
159
+
WiFi and MQTT are configured via the web interface provided by [IotWebConf](https://github.com/prampec/IotWebConf) and which can be reached after joining the WiFi network named SMLReader and heading to http://192.168.4.1.
160
+
If the device has already been configured, the web interface can be reached via the IP address obtained from your local network's DHCP server.
161
+
162
+
*Attention: You have to change the AP Password (empty by default), otherwise SMLReader won't work.*
163
+
164
+
If everything is configured properly and running with a sensor in place, SMLReader will publish the metrics and values received from the meter to the configured MQTT broker:
Verbose serial logging can be enabled by setting `SERIAL_DEBUG_VERBOSE=true` in the `platformio.ini` file.
199
+
Serial logging can be enabled by setting `SERIAL_DEBUG=true` in the `platformio.ini` file before building.
200
+
To increase the log level and to get the raw SML data, also set `SERIAL_DEBUG_VERBOSE=true`.
201
+
202
+
#### Serial port monitor
203
+
204
+
A serial port monitor can be attached using the corresponding function of your IDE or by invoking a terminal client like `miniterm` which comes shipped with `python-serial`.
0 commit comments