modpoll 0.7.0__tar.gz → 0.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {modpoll-0.7.0 → modpoll-0.7.1}/PKG-INFO +42 -28
- {modpoll-0.7.0 → modpoll-0.7.1}/README.md +41 -27
- {modpoll-0.7.0 → modpoll-0.7.1}/pyproject.toml +1 -1
- {modpoll-0.7.0 → modpoll-0.7.1}/LICENSE +0 -0
- {modpoll-0.7.0 → modpoll-0.7.1}/modpoll/__init__.py +0 -0
- {modpoll-0.7.0 → modpoll-0.7.1}/modpoll/__main__.py +0 -0
- {modpoll-0.7.0 → modpoll-0.7.1}/modpoll/arg_parser.py +0 -0
- {modpoll-0.7.0 → modpoll-0.7.1}/modpoll/main.py +0 -0
- {modpoll-0.7.0 → modpoll-0.7.1}/modpoll/modbus_task.py +0 -0
- {modpoll-0.7.0 → modpoll-0.7.1}/modpoll/mqtt_task.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: modpoll
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.1
|
|
4
4
|
Summary: A New Command Line Tool for Modbus
|
|
5
5
|
Home-page: https://helloysd.gitlab.io/modpoll
|
|
6
6
|
License: MIT
|
|
@@ -107,8 +107,9 @@ pipx upgrade modpoll
|
|
|
107
107
|
Let's start exploring *modpoll* with *modsim* device, run the following command to get a first glimpse,
|
|
108
108
|
|
|
109
109
|
```bash
|
|
110
|
-
modpoll
|
|
111
|
-
|
|
110
|
+
modpoll \
|
|
111
|
+
--tcp modsim.topmaker.net \
|
|
112
|
+
--config https://raw.githubusercontent.com/gavinying/modpoll/master/examples/modsim.csv
|
|
112
113
|
```
|
|
113
114
|
|
|
114
115
|
<p align="center">
|
|
@@ -187,17 +188,19 @@ docker run -p 5020:5020 helloysd/modsim
|
|
|
187
188
|
It will create a virtual Modbus TCP device running at `localhost:5020`, and then you can poll it using *modpoll* tool,
|
|
188
189
|
|
|
189
190
|
```bash
|
|
190
|
-
modpoll
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
modpoll \
|
|
192
|
+
--tcp localhost \
|
|
193
|
+
--tcp-port 5020 \
|
|
194
|
+
--config https://raw.githubusercontent.com/gavinying/modpoll/master/examples/modsim.csv
|
|
193
195
|
```
|
|
194
196
|
|
|
195
197
|
> Use `sudo` before the docker command if you want to use the standard port `502`.
|
|
196
198
|
|
|
197
199
|
```bash
|
|
198
200
|
sudo docker run -p 502:5020 helloysd/modsim
|
|
199
|
-
modpoll
|
|
200
|
-
|
|
201
|
+
modpoll \
|
|
202
|
+
--tcp localhost \
|
|
203
|
+
--config https://raw.githubusercontent.com/gavinying/modpoll/master/examples/modsim.csv
|
|
201
204
|
```
|
|
202
205
|
|
|
203
206
|
### Publish data to MQTT broker
|
|
@@ -207,9 +210,10 @@ This is a useful function of this new *modpoll* tool, which provides a simple wa
|
|
|
207
210
|
The following example uses a public MQTT broker `mqtt.eclipseprojects.io` for test purpose. You can also set up your own MQTT broker locally using [mosquitto](https://mosquitto.org/download/).
|
|
208
211
|
|
|
209
212
|
```bash
|
|
210
|
-
modpoll
|
|
211
|
-
|
|
212
|
-
|
|
213
|
+
modpoll \
|
|
214
|
+
--tcp modsim.topmaker.net \
|
|
215
|
+
--mqtt-host mqtt.eclipseprojects.io \
|
|
216
|
+
--config https://raw.githubusercontent.com/gavinying/modpoll/master/examples/modsim.csv
|
|
213
217
|
```
|
|
214
218
|
|
|
215
219
|
With successful data polling and publishing, you can subscribe the topic `modpoll/modsim` on the same MQTT broker `mqtt.eclipseprojects.io` to view the collected data.
|
|
@@ -247,7 +251,7 @@ The *modpoll* tool will subscribe to the topic `<mqtt_topic_prefix>/<deviceid>/s
|
|
|
247
251
|
```
|
|
248
252
|
|
|
249
253
|
|
|
250
|
-
## Run
|
|
254
|
+
## Run with docker
|
|
251
255
|
|
|
252
256
|
A docker image has been provided for user to directly run the program without local installation,
|
|
253
257
|
|
|
@@ -257,17 +261,23 @@ A docker image has been provided for user to directly run the program without lo
|
|
|
257
261
|
|
|
258
262
|
It shows the version of the program by default.
|
|
259
263
|
|
|
260
|
-
Similar to the above *modsim* test, we can poll data with `docker run`,
|
|
264
|
+
Similar to the above *modsim* test, we can poll data with `docker run`, in order to avoid printing out received data, the argument `--daemon` or `-d` is recommended to use with docker.
|
|
261
265
|
|
|
262
266
|
```bash
|
|
263
|
-
docker run helloysd/modpoll
|
|
267
|
+
docker run helloysd/modpoll \
|
|
268
|
+
modpoll -d \
|
|
269
|
+
--tcp modsim.topmaker.net \
|
|
270
|
+
--config https://raw.githubusercontent.com/gavinying/modpoll/master/examples/modsim.csv
|
|
264
271
|
```
|
|
265
272
|
|
|
266
273
|
If you want to load a local configure file, you need to mount a local folder onto container volume,
|
|
267
274
|
for example, if the child folder `examples` contains the config file `modsim.csv`, we can use it via the following command,
|
|
268
275
|
|
|
269
276
|
```bash
|
|
270
|
-
docker run -v $(pwd)/examples:/app/examples helloysd/modpoll
|
|
277
|
+
docker run -v $(pwd)/examples:/app/examples helloysd/modpoll \
|
|
278
|
+
modpoll -d \
|
|
279
|
+
--tcp modsim.topmaker.net \
|
|
280
|
+
--config /app/examples/modsim.csv
|
|
271
281
|
```
|
|
272
282
|
|
|
273
283
|
|
|
@@ -276,34 +286,38 @@ for example, if the child folder `examples` contains the config file `modsim.csv
|
|
|
276
286
|
- Connect to Modbus TCP device
|
|
277
287
|
|
|
278
288
|
```bash
|
|
279
|
-
modpoll
|
|
280
|
-
|
|
289
|
+
modpoll \
|
|
290
|
+
--tcp 192.168.1.10 \
|
|
291
|
+
--config examples/modsim.csv
|
|
281
292
|
```
|
|
282
293
|
|
|
283
294
|
- Connect to Modbus RTU device
|
|
284
295
|
|
|
285
296
|
```bash
|
|
286
|
-
modpoll
|
|
287
|
-
|
|
288
|
-
|
|
297
|
+
modpoll \
|
|
298
|
+
--rtu /dev/ttyUSB0 \
|
|
299
|
+
--rtu-baud 9600 \
|
|
300
|
+
--config contrib/eniwise/scpms6.csv
|
|
289
301
|
```
|
|
290
302
|
|
|
291
303
|
- Connect to Modbus TCP device and publish data to MQTT broker
|
|
292
304
|
|
|
293
305
|
```bash
|
|
294
|
-
modpoll
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
306
|
+
modpoll \
|
|
307
|
+
--tcp modsim.topmaker.net \
|
|
308
|
+
--tcp-port 5020 \
|
|
309
|
+
--mqtt-host mqtt.eclipseprojects.io \
|
|
310
|
+
--config examples/modsim.csv
|
|
298
311
|
```
|
|
299
312
|
|
|
300
313
|
- Connect to Modbus TCP device and export data to local csv file
|
|
301
314
|
|
|
302
315
|
```bash
|
|
303
|
-
modpoll
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
316
|
+
modpoll \
|
|
317
|
+
--tcp modsim.topmaker.net \
|
|
318
|
+
--tcp-port 5020 \
|
|
319
|
+
--export data.csv \
|
|
320
|
+
--config examples/modsim.csv
|
|
307
321
|
```
|
|
308
322
|
|
|
309
323
|
|
|
@@ -84,8 +84,9 @@ pipx upgrade modpoll
|
|
|
84
84
|
Let's start exploring *modpoll* with *modsim* device, run the following command to get a first glimpse,
|
|
85
85
|
|
|
86
86
|
```bash
|
|
87
|
-
modpoll
|
|
88
|
-
|
|
87
|
+
modpoll \
|
|
88
|
+
--tcp modsim.topmaker.net \
|
|
89
|
+
--config https://raw.githubusercontent.com/gavinying/modpoll/master/examples/modsim.csv
|
|
89
90
|
```
|
|
90
91
|
|
|
91
92
|
<p align="center">
|
|
@@ -164,17 +165,19 @@ docker run -p 5020:5020 helloysd/modsim
|
|
|
164
165
|
It will create a virtual Modbus TCP device running at `localhost:5020`, and then you can poll it using *modpoll* tool,
|
|
165
166
|
|
|
166
167
|
```bash
|
|
167
|
-
modpoll
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
modpoll \
|
|
169
|
+
--tcp localhost \
|
|
170
|
+
--tcp-port 5020 \
|
|
171
|
+
--config https://raw.githubusercontent.com/gavinying/modpoll/master/examples/modsim.csv
|
|
170
172
|
```
|
|
171
173
|
|
|
172
174
|
> Use `sudo` before the docker command if you want to use the standard port `502`.
|
|
173
175
|
|
|
174
176
|
```bash
|
|
175
177
|
sudo docker run -p 502:5020 helloysd/modsim
|
|
176
|
-
modpoll
|
|
177
|
-
|
|
178
|
+
modpoll \
|
|
179
|
+
--tcp localhost \
|
|
180
|
+
--config https://raw.githubusercontent.com/gavinying/modpoll/master/examples/modsim.csv
|
|
178
181
|
```
|
|
179
182
|
|
|
180
183
|
### Publish data to MQTT broker
|
|
@@ -184,9 +187,10 @@ This is a useful function of this new *modpoll* tool, which provides a simple wa
|
|
|
184
187
|
The following example uses a public MQTT broker `mqtt.eclipseprojects.io` for test purpose. You can also set up your own MQTT broker locally using [mosquitto](https://mosquitto.org/download/).
|
|
185
188
|
|
|
186
189
|
```bash
|
|
187
|
-
modpoll
|
|
188
|
-
|
|
189
|
-
|
|
190
|
+
modpoll \
|
|
191
|
+
--tcp modsim.topmaker.net \
|
|
192
|
+
--mqtt-host mqtt.eclipseprojects.io \
|
|
193
|
+
--config https://raw.githubusercontent.com/gavinying/modpoll/master/examples/modsim.csv
|
|
190
194
|
```
|
|
191
195
|
|
|
192
196
|
With successful data polling and publishing, you can subscribe the topic `modpoll/modsim` on the same MQTT broker `mqtt.eclipseprojects.io` to view the collected data.
|
|
@@ -224,7 +228,7 @@ The *modpoll* tool will subscribe to the topic `<mqtt_topic_prefix>/<deviceid>/s
|
|
|
224
228
|
```
|
|
225
229
|
|
|
226
230
|
|
|
227
|
-
## Run
|
|
231
|
+
## Run with docker
|
|
228
232
|
|
|
229
233
|
A docker image has been provided for user to directly run the program without local installation,
|
|
230
234
|
|
|
@@ -234,17 +238,23 @@ A docker image has been provided for user to directly run the program without lo
|
|
|
234
238
|
|
|
235
239
|
It shows the version of the program by default.
|
|
236
240
|
|
|
237
|
-
Similar to the above *modsim* test, we can poll data with `docker run`,
|
|
241
|
+
Similar to the above *modsim* test, we can poll data with `docker run`, in order to avoid printing out received data, the argument `--daemon` or `-d` is recommended to use with docker.
|
|
238
242
|
|
|
239
243
|
```bash
|
|
240
|
-
docker run helloysd/modpoll
|
|
244
|
+
docker run helloysd/modpoll \
|
|
245
|
+
modpoll -d \
|
|
246
|
+
--tcp modsim.topmaker.net \
|
|
247
|
+
--config https://raw.githubusercontent.com/gavinying/modpoll/master/examples/modsim.csv
|
|
241
248
|
```
|
|
242
249
|
|
|
243
250
|
If you want to load a local configure file, you need to mount a local folder onto container volume,
|
|
244
251
|
for example, if the child folder `examples` contains the config file `modsim.csv`, we can use it via the following command,
|
|
245
252
|
|
|
246
253
|
```bash
|
|
247
|
-
docker run -v $(pwd)/examples:/app/examples helloysd/modpoll
|
|
254
|
+
docker run -v $(pwd)/examples:/app/examples helloysd/modpoll \
|
|
255
|
+
modpoll -d \
|
|
256
|
+
--tcp modsim.topmaker.net \
|
|
257
|
+
--config /app/examples/modsim.csv
|
|
248
258
|
```
|
|
249
259
|
|
|
250
260
|
|
|
@@ -253,34 +263,38 @@ for example, if the child folder `examples` contains the config file `modsim.csv
|
|
|
253
263
|
- Connect to Modbus TCP device
|
|
254
264
|
|
|
255
265
|
```bash
|
|
256
|
-
modpoll
|
|
257
|
-
|
|
266
|
+
modpoll \
|
|
267
|
+
--tcp 192.168.1.10 \
|
|
268
|
+
--config examples/modsim.csv
|
|
258
269
|
```
|
|
259
270
|
|
|
260
271
|
- Connect to Modbus RTU device
|
|
261
272
|
|
|
262
273
|
```bash
|
|
263
|
-
modpoll
|
|
264
|
-
|
|
265
|
-
|
|
274
|
+
modpoll \
|
|
275
|
+
--rtu /dev/ttyUSB0 \
|
|
276
|
+
--rtu-baud 9600 \
|
|
277
|
+
--config contrib/eniwise/scpms6.csv
|
|
266
278
|
```
|
|
267
279
|
|
|
268
280
|
- Connect to Modbus TCP device and publish data to MQTT broker
|
|
269
281
|
|
|
270
282
|
```bash
|
|
271
|
-
modpoll
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
283
|
+
modpoll \
|
|
284
|
+
--tcp modsim.topmaker.net \
|
|
285
|
+
--tcp-port 5020 \
|
|
286
|
+
--mqtt-host mqtt.eclipseprojects.io \
|
|
287
|
+
--config examples/modsim.csv
|
|
275
288
|
```
|
|
276
289
|
|
|
277
290
|
- Connect to Modbus TCP device and export data to local csv file
|
|
278
291
|
|
|
279
292
|
```bash
|
|
280
|
-
modpoll
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
293
|
+
modpoll \
|
|
294
|
+
--tcp modsim.topmaker.net \
|
|
295
|
+
--tcp-port 5020 \
|
|
296
|
+
--export data.csv \
|
|
297
|
+
--config examples/modsim.csv
|
|
284
298
|
```
|
|
285
299
|
|
|
286
300
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|