-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPS30 to mosquitto socket error #36
Comments
what is the port of your local MQTT server? The CLI uses port |
Hei,
$ sudo lsof -i :1883
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mosquitto 13717 mosquitto 4u IPv4 13416743 0t0 TCP *:1883 (LISTEN)
Any other test with mosquitto, eg. with a mqtt generator works fine. It's
just pms that I can't seem to get a response from. Some fragments of data
in mosquitto.db suggests partial transfer:
$ sudo cat /var/lib/mosquitto/mosquitto.db
?mosquitto db
?Wbkhome/dust/SDS198[home/dust/SDS198/$onlinefalse_akhome/dust/SDS198[$home/dust/SDS198/pm100/concentration9[_khome/dust/SDS198[ome/dust/SDS198/pm100/unitμg/m3]^khome/dust/SDS198[home/dust/SDS198/pm100/sensorSDS198u]khome/dust/SDS198["home/dust/SDS198/pm100/$propertiessensor,unit,concentration[\khome/dust/SDS198[home/dust/SDS198/pm100/$typePM100T6ihome/dust/SPS30[home/dust/SPS30/$onlinefalsel5ihome/dust/SPS30["home/dust/SPS30/pm10/concentration1.0711179971694946l4ihome/dust/SPS30["home/dust/SPS30/pm04/concentration1.0711179971694946l3ihome/dust/SPS30["home/dust/SPS30/pm25/concentration1.0711175203323364k2ihome/dust/SPS30["home/dust/SPS30/pm01/concentration1.012913465499878Wihome/dust/SPS30[home/dust/SPS30/pm10/unitμg/m3Xihome/dust/SPS30[ome/dust/SPS30/pm10/sensorSPS30qihome/dust/SPS30[
home/dust/SPS30/pm10/$propertiessensor,unit,concentrationVihome/dust/SPS30[pm04/$propertiessensor,unit,concentrationUSPS30[home/dust/SPS30/pm04/unitμg/m3Xihome/dust/SPS30[ome/dust/SPS30/pm04/sensorSPS30qihome/dust/SPS30[
home/dust/SPS30/pm04/$typePM4W
ihome/dust/SPS30[
home/dust/SPS30/pm25/unitμg/m3X
ihome/dust/SPS30[ ome/dust/SPS30/pm25/sensorSPS30q ihome/dust/SPS30
home/dust/SPS30/pm25/$propertiessensor,unit,concentrationihome/dust/SPS30[home/dust/SPS30/pm25/$typePM2.5Wihome/dust/SPS30[home/dust/SPS30/pm01/unitμg/m3Xihome/dust/SPS30[ome/dust/SPS30/pm01/sensorSPS30qihome/dust/SPS30[
home/dust/SPS30/pm01/$propertiessensor,unit,concentrationUihome/dust/SPS30[home/dust/SPS30/pm01/$typePM1q?3/home/dustsensor/SPS3taarhaug[/home/dustsensor/SPS30/$onlinefalse??3/home/dustsensor/SPS3taarhaug[)/home/dustsensor/SPS30/pm10/concentration2.2494430541992188??3/home/dustsensor/SPS3taarhaug[)/home/dustsensor/SPS30/pm04/concentration2.1583328247070312??3/home/dustsensor/SPS3taarhaug[)/home/dustsensor/SPS30/pm25/concentration1.7027814388275146??3/home/dustsensor/SPS3taarhaug[)/home/dustsensor/SPS30/pm01/concentration1.0779598951339722t?3/home/dustsensor/SPS3taarhaug[
/home/dustsensor/SPS30/pm10/unitμg/m3u?3/home/dustsensor/SPS3taarhaug["/home/dustsensor/SPS30/pm10/sensorSPS30??3/home/dustsensor/SPS3taarhaug['/home/dustsensor/SPS30/pm10/$propertiessensor,unit,concentrations?3/home/dustsensor/SPS3taarhaug[!/home/dustsensor/SPS30/pm10/$typePM10t?3/home/dustsensor/SPS3taarhaug[
/hom'/home/dustsensor/SPS30/pm04/$propertiessensor,unit,concentrationr?3/home/dustsensor/SPS3taarhaug[sorSPS30??3/home/dustsensor/SPS3taarhaug[
!/home/dustsensor/SPS30/pm04/$typePM4t?3/home/dustsensor/SPS3taarhaug[
/home/dustsensor/SPS30/pm25/unitμg/m3u?3/home/dustsensor/SPS3taarhaug[
"/home/dustsensor/SPS30/pm25/sensorSPS30??3/home/dustsensor/SPS3taarhaug'/home/dustsensor/SPS30/pm25/$propertiessensor,unit,concentrationt?3/home/dustsensor/SPS3taarhaug[!/home/dustsensor/SPS30/pm25/$typePM2.5t?3/home/dustsensor/SPS3taarhaug[
/home/dustsensor/SPS30/pm01/unitμg/m3u?3/home/dustsensor/SPS3taarhaug["/home/dustsensor/SPS30/pm01/sensorSPS30??3/home/dustsensor/SPS3taarhaug['/home/dustsensor/SPS30/pm01/$propertiessensor,unit,concentrationr?3/home/dustsensor/SPS3taarhaug[!/home/dustsensor/SPS30/pm01/$typePM14?Utest[test/pm01/$typePM1P?Utest[test/pm01/$propertiessensor,unit,concentration7?Utest[test/pm01/sensorSPS306?Utest[test/pm01/unitμg/m36?Utest[test/pm25/$typePM2.5P?Utesttest/pm25/$propertiessensor,unit,concentration7?Utest[
test/pm25/sensorSPS306?Utest[
test/pm25/unitμg/m34?Utest[
test/pm04/$propertiessensor,unit,concentration7?Utest[test/pm04/sensorSPS306?Utest[test/pm04/unitμg/m35?Utest[test/pm10/$typePM10P?Utest[test/pm10/$propertiessensor,unit,concentration7?Utest[test/pm10/sensorSPS306?Utest[test/pm10/unitμg/m3KVtest[test/pm01/concentration0.7843115329742432KVtest[test/pm25/concentration0.9657123684883118KVtest[test/pm04/concentration1.0760493278503418Jtest[test/pm10/concentration1.0981163978576663Vtest[
test/$onlinefals????????????????????????????????????6ii
i
i
45b\]^_ak
|
I do not know, what is the version of the Python MQTT library? ( |
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. |
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? |
pypms 0.6.2, python 3.6.9 on ubuntu 18.04 |
Oddest thing, Topic is critical here: I collect data and publish: I try to collect with mosquitto: 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 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 |
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 "#" My apologies, I've should have read up more on MQTT before I started testing. |
Hei,
Using latest version of pms on ubuntu, I cannot make the mqtt connection to mosquitto 1.4.15 work:
pms -m SPS30 -n 1 -i 10 -s /dev/ttyUSB1 mqtt --mqtt-host localhost -t "test" throws no error, but I cannot subscribe to the feed.
mosquitto log indicates socket error:
1670442753: New client connected from 192.168.50.100 as test (c1, k60).
1670442769: Socket error on client test, disconnecting.
I have used pms serial and influx successfully for a long time, but for mqtt I could not get pms to work.
pms installed with pip: python3 -m pip install pypms[mqtt,influxdb]
The text was updated successfully, but these errors were encountered: