-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
无法连接,出现AMQJS0007E #25
Comments
希望可以帮我解决这个问题,谢谢 |
现在又遇到一个问题,Error:AMQJS0013E Invalid argument mqtt://192.168.22.149:1883 for host |
解决了吗 老铁 |
Fri, 05 Mar 2021 05:59:42 GMT - ERROR - Failed to connect. [Error Message: AMQJS0007E Socket error:undefined.] |
This Library uses web-sockets. Your Port should be of the web-socket, not TCP port. E.g: In the link above you see that for this broker: Broker: broker.emqx.io //.................................................. TCP Port: 1883 Websocket Port: 8083 I changed to this web-socket port . It fixed the error. |
代码:
import { AsyncStorage }from'react-native';
import init from 'react_native_mqtt';
init({
size: 10000,
storageBackend: AsyncStorage,
defaultExpires: 1000 * 3600 * 24,
enableCache: true,
reconnect: true,
sync: {}
});
//第一步:创建
// 地址,端口,路径(这么写就行了),connectId(随便写) :地址和端口,都是后台给,或者你自己弄个mqtt的服务
//完整路径为:mqtt://192.168.22.149:1883
let client = new Paho.MQTT.Client('192.168.22.149',1883,'/mqtt','aaa')
版本:
"react": "16.9.0",
"react-native": "0.61.1",
"react_native_mqtt": "^1.3.1"
报错信息:
失败
{"errorCode":7,"errorMessage":"AMQJS0007E Socket error:undefined.","invocationContext":undefined}
The text was updated successfully, but these errors were encountered: