如果家裡、公司或學校要使用物聯網開發專案,或者控制家裡的物聯網設備,透過免費的MQTT SEVER,那應該....
就是單純做玩具而已,所以會建議安裝再一些微型的裝置上,例如樹梅派或小型主機,可以用無頭模式的,如果家裡有一台一直開機的伺服器,1883 port沒被占用的話,拿就拿來用吧
有關MQTT SEVER的教學....我自己有安裝使用,但是教學沒有比這一篇大大的好,我就直接摘錄連結了
mosquitto-2.0.7.tar.gz (319kB) (GPG signature)
Git source code repository (github.com)
Older downloads are available at https://mosquitto.org/files/
The binary packages listed below are supported by the Mosquitto project. In many cases Mosquitto is also available directly from official Linux/BSD distributions.
mosquitto-2.0.7-install-windows-x64.exe (64-bit build, Windows Vista and up, built with Visual Studio Community 2019)
mosquitto-2.0.7-install-windows-x32.exe (32-bit build, Windows Vista and up, built with Visual Studio Community 2019)
Older installers can be found at https://mosquitto.org/files/binary/.
See also README-windows.md after installing.
Mosquitto can be installed from the homebrew project. See brew.sh and then use brew install mosquitto
snap install mosquitto
Mosquitto is now in Debian proper. There will be a short delay between a new release and it appearing in Debian as part of the normal Debian procedures.
There are also Debian repositories provided by the mosquitto project, as described at https://mosquitto.org/2013/01/mosquitto-debian-repository
Mosquitto is available through the main repository.
There are also Debian repositories provided by the mosquitto project, as described at https://mosquitto.org/2013/01/mosquitto-debian-repository/
Mosquitto is available in the Ubuntu repositories so you can install as with any other package. If you are on an earlier version of Ubuntu or want a more recent version of mosquitto, add the mosquitto-dev PPA to your repositories list - see the link for details. mosquitto can then be installed from your package manager.
sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
sudo apt-get update
安裝完成後,到C:\Program Files\mosquitto
開啟readme.txt就會有以下說明
下載對應的 Win64 OpenSSL 1.1.0* Light 檔案(我是64位元),下載於C:\Program Files\mosquitto,並執行(確認資料夾裡有沒有)
libssl-1_1.dll, libcrypto-1_1.dll or libssl-1_1-x64.dll, libcrypto-1_1-x64.dll
主要是要把mosquitto當成一個Service
確認亮各DLL檔案
下載執行檔
安裝Win64 OpenSSL 1.1.0* Light
libmosquitto on Windows is currently compiled without thread support, so
neither of mosquitto_loop_start() nor "mosquitto_pub -l" are available.
A better solution that the old pthreads-win32 is being looked into, so support
will return in the future. If you need thread support, the code still supports
it just fine. Support has been dropped to simplify installation.
Dependencies
------------
* OpenSSL
Link: http://slproweb.com/products/Win32OpenSSL.html
Install "Win32 OpenSSL 1.1.0* Light" or "Win64 OpenSSL 1.1.0* Light"
Required DLLs: libssl-1_1.dll, libcrypto-1_1.dll or libssl-1_1-x64.dll, libcrypto-1_1-x64.dll
Please ensure that the required DLLs are on the system path, or are in the same directory as
the mosquitto executable - usually C:\Program Files (x86)\mosquitto or C:\Program Files\mosquitto.
Windows Service
---------------
If you wish, mosquitto can be installed as a Windows service so you can
start/stop it from the control panel as well as running it as a normal
executable.
When running as a service, the configuration file used is mosquitto.conf in the
directory that you installed to.
If you want to install/uninstall mosquitto as a Windows service run from the
command line as follows:
C:\Program Files\mosquitto\mosquitto install
C:\Program Files\mosquitto\mosquitto uninstall
Logging
-------
If you use `log_dest file ...` in your configuration, the log file will be
created with security permissions for the current user only. If running as a
service, this means the SYSTEM user. You will only be able to view the log file
if you add permissions for yourself or whatever user you wish to view the logs.
我很窮阿,沒人要找我去賺零用錢...
以系統管理員身分開啟CMD
接下來到"服務"裡找mosquitto這個服務
點兩下開啟視窗來修改設定
更改為 手動
點擊 啟動
因為不想開機就啟動
檢查防火牆狀態
新增規則
TCP
自己命名
恭喜設定完成
建議到服務當中,重新啟動mosquitto
輸入:netstat -an
檢查有沒有一行
TCP 127.0.0.1:1883 0.0.0.0:0 LISTENING
如果有,恭喜您啦