今天在调试时发现一个localhost问题:
#define EMBER_AF_PLUGIN_TRANSPORT_MQTT_BROKER_ADDRESS "tcp://localhost:1883"
#define EMBER_AF_PLUGIN_TRANSPORT_MQTT_BROKER_ADDRESS_LENGTH (20)
当MQTT客户端设置本地地址为localhost:1883时,无法连接本地broker.
#define EMBER_AF_PLUGIN_TRANSPORT_MQTT_BROKER_ADDRESS "tcp://127.0.0.1:1883"
#define EMBER_AF_PLUGIN_TRANSPORT_MQTT_BROKER_ADDRESS_LENGTH (20)
修改localhost为127.0.0.1后问题解决
这里分析原因:
root@sun8i:/etc# ls
adb_profile etc_complete modules-boot.d rc.d
banner fstab modules.d res
banner.failsafe group mtab resolv.conf
camera.cfg hotplug.d openwrt_release shadow
cedarx.conf init.d openwrt_version shells
config inittab opkg ts.conf
crontabs localtime opkg.conf tslib-env.sh
device_info lost+found passwd