• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

IoTmaker

사물인터넷에 대한 모든 것 여기서 해결하셔요!

  • 홈
  • 책:마이크로파이썬을 활용한 사물인터넷
  • 책:따라 하면서 배우는 사물인터넷
  • 온라인 교육 코스
  • 새로운 소식
  • 의견보내기
  • 내 수강정보
  • 로그인
  • 회원가입

윈도우즈에 설치한 Mosquitto에 원격 접속허용하기

2021-08-23 작성자 IoTmaker 댓글 달기

책에서 사용하는 부품 구입하기

 1  Mosquitto는 초기설정으로는 동일 기기내에서만 접속이 됩니다.

윈도우즈에 Mosquitto를 설치하면 기본적으로 동일 기기(로컬 머신)에서만 접속이 허용됩니다.

외부 기기에서 원격 접속이 가능하도록 하기 위해서는 Mosquitto 설치 디렉토리에 있는 mosquitto.conf 파일의 내용을 다음과 같이 수정하여야 합니다.

mosquitto.conf 파일은 디렉토리 c:\Program Files\Mosquitto 또는 c:\Program Files (x86)\Mosquitto 안에 있습니다. 다만 이 파일은 일반 사용자 자격으로는 수정이 되지 않으므로 이 글 뒷부분의 mosquitto.conf 파일 수정하는 방법을 확인하시기 바랍니다.

해당 파일의 내용이 많으므로 두 군데만 표시합니다.

listner 1883을 지정합니다.
# On systems that support Unix Domain Sockets, it is also possible
# to create a # Unix socket rather than opening a TCP socket. In
# this case, the port number should be set to 0 and a unix socket
# path must be provided, e.g.
# listener 0 /tmp/mosquitto.sock
#
# listener port-number [ip address/host name/unix socket path]
listener 1883

# By default, a listener will attempt to listen on all supported IP protocol
# versions. If you do not have an IPv4 or IPv6 interface you may wish to
# disable support for either of those protocol versions. In particular, note
# that due to the limitations of the websockets library, it will only ever
# attempt to open IPv6 sockets if IPv6 support is compiled in, and so will fail
# if IPv6 is not available.
모든 사용자에게 접속을 허용할 때는 allow_anonymous true를 지정합니다.
# Defaults to false, unless there are no listeners defined in the configuration
# file, in which case it is set to true, but connections are only allowed from
# the local machine.
allow_anonymous true

# -----------------------------------------------------------------
# Default authentication and topic access control
# -----------------------------------------------------------------

# Control access to the broker using a password file. This file can be
# generated using the mosquitto_passwd utility. If TLS support is not compiled
# into mosquitto (it is recommended that TLS support should be included) then
# plain text passwords are used, in which case the file should be a text file
mosquitto.conf을 수정하여 저장한 후 다음과 같은 명령어로 mosquitto를 다시 실행합니다. mosquitto가 이미 실행중일 때는 그 터미널 화면을 종료하면 됩니다.

윈도우즈 키 + R을 누르면 팝업 화면이 나옵니다. cmd를 입력하면 윈도우즈 터미널 환경이 됩니다. 다음 명령어로 mosquitto를 실행합니다.

설치된 Mosquitto가 64비트 윈도우즈 버전일 때
cd c:\Program Files\Mosquitto
mosquitto -c mosquitto.conf -v
설치된 Mosquitto가 32비트 윈도우즈 버전일 때
cd c:\Program Files (x86)\Mosquitto
mosquitto -c mosquitto.conf -v

 2  mosquitto.conf 파일 수정하는 방법

mosquitto.conf 파일은 시스템 파일이므로 일반적인 사용자 자격으로는 수정이 수정이 불가능합니다. 다음의 링크에 그 파일을 수정할 수 있는 방법이 안내되어 있습니다.

mosquitto.conf 파일 수정이 거부되었을 때 해결 방법

카테고리:ESP32, IoTbook

Reader Interactions

답글 남기기 응답 취소

로그인을 해야 댓글을 남길 수 있습니다.

소셜 로그인
naver

Primary Sidebar

최신 글

  • 윈도우즈에서 Node-RED에 인증서 등록하고 SSL 적용하기
  • 윈도우즈에 Openssl 설치하고 인증서 만들기
  • 윈도우즈에 Node-RED 설치하고 실행하기
  • 아두이노 2.0 설치하고 ESP8266/ESP32 보드매니저 설정하기
  • 윈도우즈에 설치한 Mosquitto에 원격 접속허용하기

최신 댓글

    보관함

    • 2023년 3월
    • 2023년 2월
    • 2021년 8월
    • 2021년 2월
    • 2020년 10월
    • 2020년 8월
    • 2020년 7월

    카테고리

    • ESP32
    • ESP8266
    • IoT
    • IoTbook
    • Node-RED
    • 분류안됨

    메타

    • 로그인
    • 엔트리 피드
    • 댓글 피드
    • WordPress.org

    Footer

    Copyright © 2025 ·로그인