Comments (8)
what is the port of your local MQTT server? The CLI uses port 1883
by default.
from pypms.
from pypms.
I do not know, what is the version of the Python MQTT library? (pip show paho-mqtt
)
Is that version compatible with your MQTT server?
from pypms.
1.6.1. I use this client for a MQTT generator that works nicely with mosquitto. I reproduced the error on a RPi running raspbian.
from pypms.
I have no idea what the problem could be. I just released a new version of the library and CLI, but I do not think that updating would help. BTW, what version of python and PyPMS are you using?
from pypms.
pypms 0.6.2, python 3.6.9 on ubuntu 18.04
pypms 0.6.2, python 3.7.3 on raspbian
from pypms.
Oddest thing, Topic is critical here:
I collect data and publish:
pms -m SPS30 -n 1 -i 10 -s /dev/ttyUSB1 mqtt --mqtt-host localhost --mqtt-port 1883 -t "home/dust/SPS30"
I try to collect with mosquitto:
mosquitto_sub -t "home/dust/SPS30"
This collects nothing, but this does:
mosquitto_sub -t "home/#" (or even "home/dust/#, "home/+/#")
Not sure why. I can't see Topic sent but I check that mosquitto[_sub,_pub] works as expected with Topic publish and subscribe.
Sent data looks like this:
true
PM1
sensor,unit,concentration
SPS30
μg/m3
1.107303261756897
PM2.5
sensor,unit,concentration
SPS30
μg/m3
1.7731504440307617
PM4
sensor,unit,concentration
SPS30
μg/m3
2.2605395317077637
PM10
sensor,unit,concentration
SPS30
μg/m3
2.3580174446105957
1.2040939331054688
1.5197216272354126
1.7191693782806396
1.759059190750122
false
I guess the numbers at the end are number concentrations and typical particle size. But which is which?
SDS198 seem to get a double concentration entry in the data:
true
PM100
sensor,unit,concentration
SDS198
μg/m3
7
7
false
from pypms.
I found the issue. The way data is sent to mqtt, you cannot expect to publish and subscribe to the same topic (like you would find in most examples). I found it by verbose subscription:
$ mosquitto_sub -v -t "#"
home/dust/SDS198/$online false
home/dust/SDS198/pm100/$type PM100
home/dust/SDS198/pm100/$properties sensor,unit,concentration
home/dust/SDS198/pm100/sensor SDS198
home/dust/SDS198/pm100/unit μg/m3
home/dust/SDS198/pm100/concentration 2
home/dust/SDS198/$online true
My apologies, I've should have read up more on MQTT before I started testing.
from pypms.
Related Issues (20)
- Add to pypi HOT 2
- SDS198 wrong message header HOT 5
- List all possible reader attributes in the README HOT 7
- Add instructions on how to use this package within a script or application
- MCU680 obs.pres typo
- Consistent attribute names HOT 5
- pip3 module not found HOT 2
- PMS5003T not recognized HOT 10
- Help to set up mqtt HOT 5
- unreliably identifying the SPS30 sensor HOT 12
- Cannot read HPMA115C0 HOT 9
- logging.basicConfig() conflicts with use as a library HOT 1
- pms: Command not found HOT 4
- RPi zero with SDS198 reboots after running command HOT 1
- Stop after a number of readings and "one-shot" mode HOT 1
- Broken travis environment
- capture and decode raw-data
- PMS5003T/PMS5003ST signed temperature
- PMS5003S/PMS5003ST HCHO unit/format HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pypms.