openwrt installs mosquitto to make it an MQTT intermediate server

 

Background introduction:

Many routers can flash the Openwrt system, and the MQTT protocol is a very good Internet of Things protocol. Therefore, installing an MQTT intermediate server on the Openwrt router can turn the router into an "Internet of Things Center in the LAN".

 

Here's how to do it:

Use pytty to log in to the router and write the following commands one by one.

opkg update
opkg install mosquitto
opkg install mosquitto-client
opkg install libmosquitto

//The latter three can also be installed together
//opkg install mosquitto mosquitto-client libmosquitto

After installation, remember to start mosquitto in the "startup item" of the router and set it to boot. So that mobile devices such as mobile phones can access it.

 

Error handling:

Collected errors: * opkg_install_cmd: Cannot install package mosquitto. * opkg_install_cmd: Cannot install package mosquitto-client. * opkg_install_cmd: Cannot install package libmosquitto. Unknown package 'mosquitto'. Unknown package 'mosquitto-client'. Unknown package 'libmosquitto'. 

 

If you encounter the above errors, it may be because the foreign source is blocked. You can replace it with the domestic Tsinghua source. Search for keywords such as "OpenWrt software source Tsinghua University mirror" and you should be able to find relevant information.

 

Note that the version of the source must be consistent with the version of the system~

Guess you like

Origin blog.csdn.net/niupipiniupipi/article/details/104337375