IoT를 처음 사용합니다. 방금 내 rpi에 모스투토를 설치하고이 튜토리얼을 사용하여 Watson IoT Platform에 내 장치와 게이트웨이를 등록했습니다. https://developer.ibm.com/recipes/tutorials/using-mosquitto-as-a-gateway-for-watson-iot/모스 퀴토와 ibm watson iot on Raspberry pi 연결이 거부되었습니다.
Mosquitto는 정밀 로컬 모드를 작동합니다.
mosquitto_sub -d -h pxci52.messaging.internetofthings.ibmcloud.com -i 'g:pxci52:myfstream:gateway' -t iot-2/type/myfstream/id/gateway/evt/status/fmt/raw
하고 여기에
sudo mosquitto_pub -d -h pxci52.messaging.internetofthings.ibmcloud.com -i 'g:pxci52:myfstream:gateway' -t iot-2/type/myfstream/id/gateway/evt/status/fmt/raw -m "hello"
내 conf의 파일입니다 : 내가 볼
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest topic
log_type error
log_type warning
log_type notice
log_type information
connection_messages true
log_timestamp true
include_dir /etc/mosquitto/conf.d
connection bridge-to-watsoniot
address pxci52.messaging.internetofthings.ibmcloud.com:1883
cleansession true
try_private false
bridge_attempt_unsubscribe false
notifications false
notification_topic iot-2/type/myfstream/id/gateway/evt/status/fmt/raw
remote_username token
remote_password xxxxxx
remote_clientid g:pxci52:myfstream:gateway
notifications true
topic iot-2/type/+/id/+/cmd/+/fmt/+ in iot-2/type/+/id/+/cmd/+/fmt/+
topic iot-2/type/+/id/+/evt/+/fmt/+ out iot-2/type/+/id/+/evt/+/fmt/+
connection_messages true
모든 3 개의 프로그램 (mosquitto, mosquitto_sub & mosquitto_pub)이 동일한 클라이언트 ID를 사용하고 있습니다. 작동하지 않으며 각 연결마다 고유 한 ID가 필요합니다. – hardillb
또한 암호를 설정 파일에 저장했습니다. 이 질문을 삭제하고 비밀번호를 다시 입력해도 암호를 다시 입력해도 암호가 여전히 기록에 남아있게됩니다. – hardillb
ps : 기기를 삭제하고 테스트 목적으로 새 것을 시작하기가 쉽습니다. – Ninja