나는 모스 닛토 브로커가있는 라즈베리를 가지고 있고 아마존 IoT 서비스로 연결되어있다. https://aws.amazon.com/es/blogs/iot/how-to-bridge-mosquitto-mqtt-broker-to-aws-iot/지속성을 사용하는 mosquitto MQTT 브로커를 amazon IoT 서비스로 변환
이 내 mosquitto.conf 파일입니다
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
이
# =================================================================
# Bridges to AWS IOT
# =================================================================
# AWS IoT endpoint, use AWS CLI 'aws iot describe-endpoint'
connection awsiot
address xxxxxxxxx.iot.eu-central-1.amazonaws.com:8883
# Specifying which topics are bridged
topic awsiot_to_localgateway in 1
topic localgateway_to_awsiot/iot out 1
topic both_directions both 1
# Setting protocol version explicitly
bridge_protocol_version mqttv311
bridge_insecure false
# Bridge connection name and MQTT client Id,
# enabling the connection automatically when the broker starts.
cleansession true
clientid bridgeawsiot
start_type automatic
notifications false
log_type all
# =================================================================
# Certificate based SSL/TLS support
# -----------------------------------------------------------------
#Path to the rootCA
bridge_cafile /etc/mosquitto/certs/rootCA.pem
# Path to the PEM encoded client certificate
bridge_certfile /etc/mosquitto/certs/cert.crt
# Path to the PEM encoded client private key
bridge_keyfile /etc/mosquitto/certs/private.key
모든 작품을 잘 /etc/mosquitto/conf.d 내부에있는 bridge.conf이다. 하지만, 만약 내가 이더넷 케이블을 제거하여 페니스를 테스트하십시오. 통신이 다시 시작될 때. 브로커는 amazon IoT 서비스에 반복적 인 메시지를 보냅니다.
이것은 내가
char dataToSend[] = "Message Id: ";
counter++;
snprintf(dataToSend, sizeof(dataToSend) + 10, "Message Id: %d", counter);
app_mqtt_publish(&dataToSend);
이 정상적인 행동인가를 보낸다 메시지는?
해당 구성에서 브리지의 세부 정보를 포함하지 않았습니다. 또한 어떤 종류의 메시지를 보내고 있습니까? QOS는 무엇입니까? – hardillb
죄송합니다. @hardillb ... 질문이 수정되었습니다. QOS는 1입니다. – JosepB