Всем добрый день. Возникла проблема. Имеем следующее
root@server:/etc/mosquitto# dpkg -l|grep mosquitto
ii libmosquitto1:i386 2.0.10-0mosquitto2~xenial1 i386 MQTT version 3.1/3.1.1 client library
ii libwebsockets12:i386 2.4.2-0~mosquitto1~xenial6 i386 lightweight C websockets library
ii mosquitto 2.0.10-0mosquitto2~xenial1 i386 MQTT version 3.1/3.1.1 compatible message broker
ii mosquitto-clients 2.0.10-0mosquitto2~xenial1 i386 Mosquitto command line MQTT clients
Вот с такими настройками подключения
- Без имени-2.jpg (65.8 КБ) 1591 просмотр
Данные отсутствуют.
Смотрим логи.
1652591777: New connection from 127.0.0.1:45136 on port 1883.
1652591777: New client connected from 127.0.0.1:45136 as MJDM (#62808ca1603c5) (p2, c1, k10, u'xxx').
1652592270: New connection from ::1:33224 on port 1883.
1652592270: New client connected from ::1:33224 as auto-12BAEF4C-4243-2A1B-C30A-DF328DA3B8C1 (p2, c1, k60, u'xxx').
1652592282: Client auto-12BAEF4C-4243-2A1B-C30A-DF328DA3B8C1 disconnected.
1652592298: New connection from 127.0.0.1:45260 on port 1883.
1652592298: New client connected from 127.0.0.1:45260 as MJDM (#62808eaa4b6bc) (p2, c1, k10, u'xxx').
1652592302: Client MJDM (#62808eaa4b6bc) closed its connection.
1652592386: New connection from 127.0.0.1:45286 on port 1883.
1652592386: New client connected from 127.0.0.1:45286 as MJDM (#62808f02b8d6b) (p2, c1, k10, u'xxx').
1652592400: Client MJDM (#62808f02b8d6b) closed its connection.
1652592509: Client MJDM (#62808ca1603c5) closed its connection.
1652592540: New connection from 127.0.0.1:45320 on port 1883.
1652592540: New client connected from 127.0.0.1:45320 as MJDM (#62808f9c3df37) (p2, c1, k10, u'xxx').
В логах все нормально.
Проверяем циклом.
root@server:/var/log/mosquitto# php /server/www/majordomo/scripts/cycle_mqtt.php
08:26:26 Topics to watch: # (Total: 1)
08:26:26 Path: #
08:26:26 Subscribing to: #
2022-05-15 08:26:27 Received from /DHT_Room/h : 46
2022-05-15 08:26:27 Received from /DHT_Room/t : 24
2022-05-15 08:26:30 Received from /DHT_Bathroom/h : 32
2022-05-15 08:26:30 Received from /DHT_Bathroom/t : 28
2022-05-15 08:26:30 Received from /DHT_Kitchen/h : 34
2022-05-15 08:26:30 Received from /DHT_Kitchen/t : 27
2022-05-15 08:26:32 Received from /DHT_Room/h : 46
2022-05-15 08:26:32 Received from /DHT_Room/t : 24
2022-05-15 08:26:35 Received from /DHT_Bathroom/h : 32
2022-05-15 08:26:35 Received from /DHT_Bathroom/t : 28
2022-05-15 08:26:35 Received from /DHT_Kitchen/h : 34
2022-05-15 08:26:35 Received from /DHT_Kitchen/t : 27
2022-05-15 08:26:37 Received from /DHT_Room/h : 46
2022-05-15 08:26:37 Received from /DHT_Room/t : 24
2022-05-15 08:26:40 Received from /DHT_Bathroom/h : 32
2022-05-15 08:26:40 Received from /DHT_Bathroom/t : 28
2022-05-15 08:26:40 Received from /DHT_Kitchen/h : 34
2022-05-15 08:26:40 Received from /DHT_Kitchen/t : 27
В цикле все работает.
Почему нет данных на устройстве MQTT?