Skip to content

Commit 87cdea9

Browse files
authored
Update SML Driver Doc
Add another Meter (Landis + Gyr) and explain the new function for changing baudrate while operating.
1 parent 8ddc07f commit 87cdea9

File tree

1 file changed

+44
-13
lines changed

1 file changed

+44
-13
lines changed

peripherals/Smart-Meter-Interface.md

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
23
!> **This feature is not included in precompiled binaries.**
34
To use it you must [compile your build](compile-your-build). Add the following to `user_config_override.h`:
45
```
@@ -128,32 +129,62 @@ with the '=' char at the beginning of a line you may do some special decoding
128129
example:
129130
`2,=h==================` insert a separator line
130131

131-
- With a few Meters, it is necessary to request the Meter to send its data using a specific character string.
132-
This string must be sent at a very slow baudrate. (300Baud)
133-
If you answer the Meter with an acknowledge and ask the Meter for a new baudrate of 9600 baud, the baudrate of the SML driver has to change, too.
132+
- With a few meters, it is necessary to request the meter to send its data using a specific character string. This string has to be send at a very low baudrate. (300Baud)
133+
If you reply the meter with an acknowledge and ask the it for a new baudrate of 9600 baud, the baudrate of the SML driver has to be changed, too.
134+
135+
136+
To change the baudrate:
137+
>sml(`METERNUMBER` 0 `BAUDRATE`)
138+
139+
For sending a specific character string:
140+
141+
>sml(`METERNUMBER` 1 `STRING`)
134142
135143
That works like this:
136144

137145

138146
> `>D`
139-
res=0
140-
; In this Example in the >F section
141-
>`>F`
142-
; Set the Baudrate on Meter 1 to 300 Baud
143-
res=sml(1 0 300)
144-
;Set the Hex String on Meter 1
147+
res=0
148+
scnt=0
149+
150+
>;For this Example in the >F section
151+
> `>F`
152+
;count 100ms
153+
scnt+=1
154+
switch scnt
155+
case 6
156+
;set sml driver to 300 baud and send /?! as HEX to trigger the Meter
157+
res=sml(1 0 300)
145158
res=sml(1 1 "2F3F210D0A")
146-
;At this point must be a delay to give the Meter some time to answer befor sending another string. Look at the full Example to see how to do that.
159+
160+
>;1800ms later \> Send ACK and ask for switching to 9600 baud
161+
case 18
147162
res=sml(1 1 "063035300D0A")
148-
;Set the Baudrate on Meter 1 to 9600 Baud
163+
164+
>;2000ms later \> Switching sml driver to 9600 baud
165+
case 20
149166
res=sml(1 0 9600)
150167

168+
>;Restart sequence after 50x100ms
169+
case 50
170+
; 5000ms later \> restart sequence
171+
scnt=0
172+
ends
173+
151174
> `>M 1`
152175
+1,3,o,0,9600, ,1
153176
...etc.
154177

155-
You can find the full Example [here](#landis--gyr-zmr120ares2r2sfcs-obis).
156-
178+
You can find the example [here.](#landis--gyr-zmr120ares2r2sfcs-obis)
179+
180+
Attention, this procedure is only necessary, if the meter explicitly asks for 300 baud. The most meters work directly with 9600 baud. Therefore it is easier to give this method a try:
181+
182+
`Meter#,GPIO# Input,OBIS,FLAG,Baudrate,JSONNAME,GPIO# Output,TX Period,Character string`
183+
> \+ 1,3, O, 0,9600, energy, 1,1,2F3F210D0A
184+
185+
Example: [here.](#Iskra-MT-174)
186+
187+
157188
158189

159190
## Smart Meter Descriptors

0 commit comments

Comments
 (0)