Browse Source

hook up sml parsing to softserial interface

Thomas Buck 4 months ago
parent
commit
52577ab1b1
7 changed files with 125 additions and 377 deletions
  1. 1
    0
      .gitignore
  2. 5
    0
      include/lora.h
  3. 1
    0
      include/smart_meter.h
  4. 1
    0
      platformio.ini
  5. 63
    33
      src/lora.cpp
  6. 9
    5
      src/main.cpp
  7. 45
    339
      src/smart_meter.cpp

+ 1
- 0
.gitignore View File

@@ -1,2 +1,3 @@
1 1
 .pio
2 2
 .cache
3
+.directory

+ 5
- 0
include/lora.h View File

@@ -22,6 +22,11 @@ void lora_oled_print(String s);
22 22
 void lora_init(void);
23 23
 void lora_run(void);
24 24
 
25
+#ifdef FEATURE_SML
26
+void lora_sml_send(double SumWh, double T1Wh, double T2Wh,
27
+                   double SumW, double L1W, double L2W, double L3W);
28
+#endif // FEATURE_SML
29
+
25 30
 #endif // FEATURE_LORA
26 31
 
27 32
 #endif // __ESP_ENV_LORA__

+ 1
- 0
include/smart_meter.h View File

@@ -17,6 +17,7 @@
17 17
 #ifdef FEATURE_SML
18 18
 
19 19
 void sml_init(void);
20
+void sml_run(void);
20 21
 
21 22
 #endif // FEATURE_SML
22 23
 

+ 1
- 0
platformio.ini View File

@@ -61,6 +61,7 @@ lib_deps =
61 61
     https://github.com/Links2004/arduinoWebSockets.git#30d5e136665a52880f641ddd7245b3ba05ecd32b
62 62
     https://github.com/ropg/heltec_esp32_lora_v3.git#9f281354507849755a597ebcce3721582f3b59b8
63 63
     https://github.com/olliiiver/sml_parser.git#f256f6935a6c6cad1a7a7f40ea18ac7d2dd28f0a
64
+    https://github.com/plerup/espsoftwareserial.git#40038df467853f47dde4641769183fa46996decb
64 65
 
65 66
 [env:lorarx]
66 67
 platform = espressif32

+ 63
- 33
src/lora.cpp View File

@@ -24,13 +24,23 @@
24 24
 #include "DebugLog.h"
25 25
 #include "lora.h"
26 26
 
27
+// define LORA_TEST_TX to periodically transmit a test message
28
+//#define LORA_TEST_TX
29
+
27 30
 #define OLED_BAT_INTERVAL (10UL * 1000UL) // in ms
31
+
32
+#ifdef FEATURE_SML
33
+#define LORA_LED_BRIGHTNESS 1 // in percent, 50% brightness is plenty for this LED
34
+#else // FEATURE_SML
28 35
 #define LORA_LED_BRIGHTNESS 25 // in percent, 50% brightness is plenty for this LED
36
+#endif // FEATURE_SML
29 37
 
38
+#ifdef LORA_TEST_TX
30 39
 // Pause between transmited packets in seconds.
31 40
 // Set to zero to only transmit a packet when pressing the user button
32 41
 // Will not exceed 1% duty cycle, even if you set a lower value.
33 42
 #define PAUSE               10
43
+#endif // LORA_TEST_TX
34 44
 
35 45
 // Frequency in MHz. Keep the decimal point to designate float.
36 46
 // Check your own rules and regulations to see what is legal where you are.
@@ -139,8 +149,56 @@ void lora_init(void) {
139 149
         use_lora = false;
140 150
         return;
141 151
     }
152
+
153
+    // turn on Ve external 3.3V to power Smart Meter reader
154
+    heltec_ve(true);
155
+}
156
+
157
+static void lora_tx(String data) {
158
+    bool tx_legal = millis() > (last_tx + minimum_pause);
159
+    if (!tx_legal) {
160
+        //debug.printf("Legal limit, wait %i sec.\n", (int)((minimum_pause - (millis() - last_tx)) / 1000) + 1);
161
+        return;
162
+    }
163
+
164
+    debug.printf("TX [%s] ", String(counter).c_str());
165
+    radio.clearDio1Action();
166
+
167
+    heltec_led(LORA_LED_BRIGHTNESS);
168
+
169
+    bool success = true;
170
+    tx_time = millis();
171
+    RADIOLIB_CHECK(radio.transmit(data));
172
+    tx_time = millis() - tx_time;
173
+
174
+    heltec_led(0);
175
+
176
+    if (success) {
177
+        debug.printf("OK (%i ms)\n", (int)tx_time);
178
+    } else {
179
+        debug.println("fail");
180
+    }
181
+
182
+    // Maximum 1% duty cycle
183
+    minimum_pause = tx_time * 100;
184
+    last_tx = millis();
185
+
186
+    radio.setDio1Action(lora_rx);
187
+
188
+    success = true;
189
+    RADIOLIB_CHECK(radio.startReceive(RADIOLIB_SX126X_RX_TIMEOUT_INF));
190
+    if (!success) {
191
+        use_lora = false;
192
+    }
142 193
 }
143 194
 
195
+#ifdef FEATURE_SML
196
+void lora_sml_send(double SumWh, double T1Wh, double T2Wh,
197
+                   double SumW, double L1W, double L2W, double L3W) {
198
+
199
+}
200
+#endif // FEATURE_SML
201
+
144 202
 void lora_run(void) {
145 203
     heltec_loop();
146 204
 
@@ -164,7 +222,7 @@ void lora_run(void) {
164 222
         String data;
165 223
         RADIOLIB_CHECK(radio.readData(data));
166 224
         if (success) {
167
-            debug.printf("RX [%s]\n", data.c_str());
225
+            debug.printf("RX [%i]\n", data.length());
168 226
             debug.printf("  RSSI: %.2f dBm\n", radio.getRSSI());
169 227
             debug.printf("  SNR: %.2f dB\n", radio.getSNR());
170 228
         }
@@ -177,9 +235,9 @@ void lora_run(void) {
177 235
         }
178 236
     }
179 237
 
180
-    bool tx_legal = millis() > last_tx + minimum_pause;
181
-
238
+#ifdef LORA_TEST_TX
182 239
     // Transmit a packet every PAUSE seconds or when the button is pressed
240
+    bool tx_legal = millis() > last_tx + minimum_pause;
183 241
     if ((PAUSE && tx_legal && millis() - last_tx > (PAUSE * 1000)) || button.isSingleClick()) {
184 242
         // In case of button click, tell user to wait
185 243
         if (!tx_legal) {
@@ -187,37 +245,9 @@ void lora_run(void) {
187 245
             return;
188 246
         }
189 247
 
190
-        debug.printf("TX [%s] ", String(counter).c_str());
191
-        radio.clearDio1Action();
192
-
193
-        heltec_led(LORA_LED_BRIGHTNESS);
194
-
195
-        bool success = true;
196
-        tx_time = millis();
197
-        RADIOLIB_CHECK(radio.transmit(String(counter++).c_str()));
198
-        tx_time = millis() - tx_time;
199
-
200
-        heltec_led(0);
201
-
202
-        if (success) {
203
-            debug.printf("OK (%i ms)\n", (int)tx_time);
204
-        } else {
205
-            debug.printf("fail (%i)\n", _radiolib_status);
206
-        }
207
-
208
-        // Maximum 1% duty cycle
209
-        minimum_pause = tx_time * 100;
210
-        last_tx = millis();
211
-
212
-        radio.setDio1Action(lora_rx);
213
-
214
-        success = true;
215
-        RADIOLIB_CHECK(radio.startReceive(RADIOLIB_SX126X_RX_TIMEOUT_INF));
216
-        if (!success) {
217
-            use_lora = false;
218
-            return;
219
-        }
248
+        lora_tx(String(counter++).c_str());
220 249
     }
250
+#endif // LORA_TEST_TX
221 251
 }
222 252
 
223 253
 #endif // FEATURE_LORA

+ 9
- 5
src/main.cpp View File

@@ -97,16 +97,16 @@ void setup() {
97 97
     debug.println(F("Sensors"));
98 98
     initSensors();
99 99
 
100
-#ifdef FEATURE_SML
101
-    debug.println(F("SML"));
102
-    sml_init();
103
-#endif // FEATURE_SML
104
-
105 100
 #ifdef FEATURE_LORA
106 101
     debug.println(F("LoRa"));
107 102
     lora_init();
108 103
 #endif // FEATURE_LORA
109 104
 
105
+#ifdef FEATURE_SML
106
+    debug.println(F("SML"));
107
+    sml_init();
108
+#endif // FEATURE_SML
109
+
110 110
 #ifndef FEATURE_DISABLE_WIFI
111 111
 
112 112
     // Build hostname string
@@ -241,6 +241,10 @@ void setup() {
241 241
 void loop() {
242 242
     runSensors();
243 243
 
244
+#ifdef FEATURE_SML
245
+    sml_run();
246
+#endif // FEATURE_SML
247
+
244 248
 #ifndef FEATURE_DISABLE_WIFI
245 249
     runServers();
246 250
     runMQTT();

+ 45
- 339
src/smart_meter.cpp View File

@@ -15,322 +15,17 @@
15 15
 
16 16
 #include <Arduino.h>
17 17
 #include <sml.h>
18
+#include <SoftwareSerial.h>
18 19
 
19 20
 #include "config.h"
20 21
 #include "DebugLog.h"
22
+#include "lora.h"
21 23
 #include "smart_meter.h"
22 24
 
23
-const unsigned char ehz_bin[]  = {
24
-  0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x32,
25
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xbc,
26
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0xb2, 0x30,
27
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x33, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
28
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
29
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0x96, 0x76, 0x77, 0x07, 0x81, 0x81,
30
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
31
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
32
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
33
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
34
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
35
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
36
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
37
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
38
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
39
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
40
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
41
-  0x01, 0x01, 0x63, 0x8d, 0x72, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x34, 0x62, 0x00, 0x62, 0x00,
42
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0x42, 0x2b, 0x00,
25
+#define SML_TX 47
26
+#define SML_RX 48
43 27
 
44
-  0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
45
-  0xed, 0x73,
46
-
47
-  0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x35,
48
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xbd,
49
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0x81, 0xac,
50
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x36, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
51
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
52
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0x97, 0x76, 0x77, 0x07, 0x81, 0x81,
53
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
54
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
55
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
56
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
57
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
58
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
59
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
60
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
61
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
62
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
63
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
64
-  0x01, 0x01, 0x63, 0x12, 0xdf, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x37, 0x62, 0x00, 0x62, 0x00,
65
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0xf1, 0xd5, 0x00, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
66
-  0xb6, 0x14, 0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x38,
67
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xbe,
68
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0x09, 0x83,
69
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x39, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
70
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
71
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0x99, 0x76, 0x77, 0x07, 0x81, 0x81,
72
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
73
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
74
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
75
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
76
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
77
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
78
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
79
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
80
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
81
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
82
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
83
-  0x01, 0x01, 0x63, 0xa2, 0xea, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x3a, 0x62, 0x00, 0x62, 0x00,
84
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0x9f, 0x62, 0x00, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
85
-  0x35, 0x97, 0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x3b,
86
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xbf,
87
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0xf6, 0x9c,
88
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x3c, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
89
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
90
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0x9a, 0x76, 0x77, 0x07, 0x81, 0x81,
91
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
92
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
93
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
94
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
95
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
96
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
97
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
98
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
99
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
100
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
101
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
102
-  0x01, 0x01, 0x63, 0x93, 0xfa, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x3d, 0x62, 0x00, 0x62, 0x00,
103
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0x79, 0xc2, 0x00, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
104
-  0x6a, 0xf1, 0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x3e,
105
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xc0,
106
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0x2a, 0x90,
107
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x3f, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
108
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
109
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0x9c, 0x76, 0x77, 0x07, 0x81, 0x81,
110
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
111
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
112
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
113
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
114
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
115
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
116
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
117
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
118
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
119
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
120
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
121
-  0x01, 0x01, 0x63, 0x48, 0x65, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x40, 0x62, 0x00, 0x62, 0x00,
122
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0xdd, 0x2b, 0x00, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
123
-  0x19, 0x1d, 0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x41,
124
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xc1,
125
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0xee, 0x5e,
126
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x42, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
127
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
128
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0x9d, 0x76, 0x77, 0x07, 0x81, 0x81,
129
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
130
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
131
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
132
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
133
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
134
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
135
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
136
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
137
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
138
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
139
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
140
-  0x01, 0x01, 0x63, 0x9f, 0x26, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x43, 0x62, 0x00, 0x62, 0x00,
141
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0x6e, 0xd5, 0x00, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
142
-  0xb4, 0x6b, 0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x44,
143
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xc2,
144
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0xef, 0x7e,
145
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x45, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
146
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
147
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0x9e, 0x76, 0x77, 0x07, 0x81, 0x81,
148
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
149
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
150
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
151
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
152
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
153
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
154
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
155
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
156
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
157
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
158
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
159
-  0x01, 0x01, 0x63, 0x71, 0xaf, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x46, 0x62, 0x00, 0x62, 0x00,
160
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0xaa, 0xde, 0x00, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
161
-  0x07, 0xa5, 0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x47,
162
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xc3,
163
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0x10, 0x61,
164
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x48, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
165
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
166
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0xa0, 0x76, 0x77, 0x07, 0x81, 0x81,
167
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
168
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
169
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
170
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
171
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
172
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
173
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
174
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
175
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
176
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
177
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
178
-  0x01, 0x01, 0x63, 0x60, 0x44, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x49, 0x62, 0x00, 0x62, 0x00,
179
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0xe6, 0xc2, 0x00, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
180
-  0x7f, 0xe1, 0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x4a,
181
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xc4,
182
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0x21, 0xbd,
183
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x4b, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
184
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
185
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0xa1, 0x76, 0x77, 0x07, 0x81, 0x81,
186
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
187
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
188
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
189
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
190
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
191
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
192
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
193
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
194
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
195
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
196
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
197
-  0x01, 0x01, 0x63, 0x8f, 0x4b, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x4c, 0x62, 0x00, 0x62, 0x00,
198
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0x22, 0xc9, 0x00, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
199
-  0x01, 0x77, 0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x4d,
200
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xc5,
201
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0x12, 0x21,
202
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x4e, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
203
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
204
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0xa2, 0x76, 0x77, 0x07, 0x81, 0x81,
205
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
206
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
207
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
208
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
209
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
210
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
211
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
212
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
213
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
214
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
215
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
216
-  0x01, 0x01, 0x63, 0xbe, 0x5b, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x4f, 0x62, 0x00, 0x62, 0x00,
217
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0x91, 0x37, 0x00, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
218
-  0x62, 0xff, 0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x50,
219
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xc6,
220
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0x88, 0x11,
221
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x51, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
222
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
223
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0xa4, 0x76, 0x77, 0x07, 0x81, 0x81,
224
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
225
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
226
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
227
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
228
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
229
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
230
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
231
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
232
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
233
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
234
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
235
-  0x01, 0x01, 0x63, 0x28, 0x66, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x52, 0x62, 0x00, 0x62, 0x00,
236
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0xba, 0xf1, 0x00, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
237
-  0x0e, 0x48, 0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x53,
238
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xc7,
239
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0x77, 0x0e,
240
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x54, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
241
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
242
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0xa5, 0x76, 0x77, 0x07, 0x81, 0x81,
243
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
244
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
245
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
246
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
247
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
248
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
249
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
250
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
251
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
252
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
253
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
254
-  0x01, 0x01, 0x63, 0xb7, 0xcb, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x55, 0x62, 0x00, 0x62, 0x00,
255
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0x5c, 0x51, 0x00, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
256
-  0x69, 0xc1, 0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x56,
257
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xc8,
258
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0xac, 0x32,
259
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x57, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
260
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
261
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0xa7, 0x76, 0x77, 0x07, 0x81, 0x81,
262
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
263
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
264
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
265
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
266
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
267
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
268
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
269
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
270
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
271
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
272
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
273
-  0x01, 0x01, 0x63, 0x21, 0x27, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x58, 0x62, 0x00, 0x62, 0x00,
274
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0x32, 0xe6, 0x00, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
275
-  0xdb, 0xb3, 0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x59,
276
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xc9,
277
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0x16, 0xa1,
278
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x5a, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
279
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
280
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0xa8, 0x76, 0x77, 0x07, 0x81, 0x81,
281
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
282
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
283
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
284
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
285
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
286
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
287
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
288
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
289
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
290
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
291
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
292
-  0x01, 0x01, 0x63, 0x99, 0xd5, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x5b, 0x62, 0x00, 0x62, 0x00,
293
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0x81, 0x18, 0x00, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
294
-  0xb3, 0x78, 0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x5c,
295
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xca,
296
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0x17, 0x81,
297
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x5d, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
298
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
299
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0xa9, 0x76, 0x77, 0x07, 0x81, 0x81,
300
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
301
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
302
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
303
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
304
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
305
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
306
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
307
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
308
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
309
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
310
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
311
-  0x01, 0x01, 0x63, 0xd9, 0xe1, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x5e, 0x62, 0x00, 0x62, 0x00,
312
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0x45, 0x13, 0x00, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
313
-  0x38, 0x59, 0x1b, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x5f,
314
-  0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x01, 0x01, 0x76, 0x01, 0x01, 0x05, 0x04, 0xd6, 0x15, 0xcb,
315
-  0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x01, 0x01, 0x63, 0xe8, 0x9e,
316
-  0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x60, 0x62, 0x00, 0x62, 0x00, 0x72, 0x63, 0x07, 0x01, 0x77,
317
-  0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00, 0x04, 0xa0, 0x58, 0x2c, 0x07, 0x01, 0x00, 0x62,
318
-  0x0a, 0xff, 0xff, 0x72, 0x62, 0x01, 0x65, 0x06, 0x4b, 0x6e, 0xab, 0x76, 0x77, 0x07, 0x81, 0x81,
319
-  0xc7, 0x82, 0x03, 0xff, 0x01, 0x01, 0x01, 0x01, 0x04, 0x49, 0x53, 0x4b, 0x01, 0x77, 0x07, 0x01,
320
-  0x00, 0x00, 0x00, 0x09, 0xff, 0x01, 0x01, 0x01, 0x01, 0x0b, 0x09, 0x01, 0x49, 0x53, 0x4b, 0x00,
321
-  0x04, 0xa0, 0x58, 0x2c, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x00, 0xff, 0x65, 0x00, 0x00,
322
-  0x01, 0x82, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15,
323
-  0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x01, 0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69,
324
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x15, 0x01, 0x77, 0x07, 0x01, 0x00, 0x01, 0x08, 0x02,
325
-  0xff, 0x01, 0x01, 0x62, 0x1e, 0x52, 0x03, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
326
-  0x01, 0x77, 0x07, 0x81, 0x81, 0xc7, 0x82, 0x05, 0xff, 0x01, 0x01, 0x01, 0x01, 0x83, 0x02, 0x82,
327
-  0xd9, 0x2c, 0x87, 0x12, 0x0e, 0xf0, 0xf5, 0xdc, 0x12, 0x8e, 0xf0, 0x1d, 0x0f, 0x04, 0xfb, 0xf5,
328
-  0x48, 0x00, 0x7b, 0x82, 0x00, 0xf3, 0x46, 0x9c, 0x6d, 0xdd, 0x62, 0x15, 0xa9, 0x10, 0x83, 0x1c,
329
-  0xd7, 0x44, 0x83, 0x47, 0xaf, 0xa1, 0xa9, 0x58, 0x33, 0x3c, 0x37, 0xb7, 0x34, 0x77, 0x9a, 0x01,
330
-  0x01, 0x01, 0x63, 0xb4, 0xe3, 0x00, 0x76, 0x05, 0x0e, 0x82, 0x41, 0x61, 0x62, 0x00, 0x62, 0x00,
331
-  0x72, 0x63, 0x02, 0x01, 0x71, 0x01, 0x63, 0xc6, 0x9c, 0x00, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x00,
332
-  0xe9, 0xe1
333
-};
28
+static EspSoftwareSerial::UART port1, port2;
334 29
 
335 30
 static double SumWh = NAN, T1Wh = NAN, T2Wh = NAN;
336 31
 static double SumW = NAN, L1W = NAN, L2W = NAN, L3W = NAN;
@@ -389,46 +84,57 @@ static OBISHandler handlers[] = {
389 84
 };
390 85
 
391 86
 void sml_init(void) {
392
-    for (unsigned int n = 0; n < sizeof(ehz_bin); n++) {
393
-        unsigned char c = ehz_bin[n];
87
+    init_vars();
394 88
 
395
-        sml_states_t s = smlState(c);
89
+    port1.begin(9600, SWSERIAL_8N1, SML_RX, -1, false);
90
+    port2.begin(9600, SWSERIAL_8N1, SML_TX, -1, false);
91
+}
92
+
93
+void sml_run(void) {
94
+    if ((!port1.available()) && (!port2.available())) {
95
+        return;
96
+    }
396 97
 
397
-        if (s == SML_START) {
398
-            init_vars();
399
-        } else if (s == SML_LISTEND) {
400
-            // check handlers on last received list
401
-            for (unsigned int i = 0; i < (sizeof(handlers) / sizeof(handlers[0])); i++) {
402
-                if (smlOBISCheck(handlers[i].OBIS)) {
403
-                    handlers[i].Handler();
404
-                }
98
+    unsigned char c = port1.available() ? port1.read() : port2.read();
99
+    sml_states_t s = smlState(c);
100
+
101
+    if (s == SML_START) {
102
+        init_vars();
103
+    } else if (s == SML_LISTEND) {
104
+        for (unsigned int i = 0; i < (sizeof(handlers) / sizeof(handlers[0])); i++) {
105
+            if (smlOBISCheck(handlers[i].OBIS)) {
106
+                handlers[i].Handler();
405 107
             }
406
-        } else if (s == SML_FINAL) {
407
-            debug.println("SML Reading:");
108
+        }
109
+    } else if (s == SML_FINAL) {
110
+        debug.println("SML Reading:");
408 111
 
409
-            if (!isnan(SumWh))
410
-                debug.printf("Sum: %14.3lf Wh\n", SumWh);
112
+        if (!isnan(SumWh))
113
+            debug.printf("Sum: %14.3lf Wh\n", SumWh);
411 114
 
412
-            if (!isnan(T1Wh))
413
-                debug.printf(" T1: %14.3lf Wh\n", T1Wh);
115
+        if (!isnan(T1Wh))
116
+            debug.printf(" T1: %14.3lf Wh\n", T1Wh);
414 117
 
415
-            if (!isnan(T2Wh))
416
-                debug.printf(" T2: %14.3lf Wh\n", T2Wh);
118
+        if (!isnan(T2Wh))
119
+            debug.printf(" T2: %14.3lf Wh\n", T2Wh);
417 120
 
418
-            if (!isnan(SumW))
419
-                debug.printf("Sum: %14.3lf W\n", SumW);
121
+        if (!isnan(SumW))
122
+            debug.printf("Sum: %14.3lf W\n", SumW);
420 123
 
421
-            if (!isnan(L1W))
422
-                debug.printf(" L1: %14.3lf W\n", L1W);
124
+        if (!isnan(L1W))
125
+            debug.printf(" L1: %14.3lf W\n", L1W);
423 126
 
424
-            if (!isnan(L2W))
425
-                debug.printf(" L2: %14.3lf W\n", L2W);
127
+        if (!isnan(L2W))
128
+            debug.printf(" L2: %14.3lf W\n", L2W);
426 129
 
427
-            if (!isnan(L3W))
428
-                debug.printf(" L3: %14.3lf W\n", L3W);
130
+        if (!isnan(L3W))
131
+            debug.printf(" L3: %14.3lf W\n", L3W);
429 132
 
430
-            debug.println();
431
-        }
133
+        debug.println();
134
+
135
+#ifdef FEATURE_LORA
136
+        lora_sml_send(SumWh, T1Wh, T2Wh, SumW, L1W, L2W, L3W);
137
+#endif // FEATURE_LORA
432 138
     }
433 139
 }
434 140
 

Loading…
Cancel
Save