Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error after integrating mqtt.js with tabris.js #2270

Open
ilegoo88 opened this issue Jul 25, 2023 · 3 comments
Open

Error after integrating mqtt.js with tabris.js #2270

ilegoo88 opened this issue Jul 25, 2023 · 3 comments
Labels

Comments

@ilegoo88
Copy link

const options = {
clean: true,
connectTimeout: 4000,
protocolVersion: 5,
clientId: web_${Math.random().toString(16).slice(3)},
username: '',
password: ''
};
const connectUrl = 'ws://192.168.2.160:8083/mqtt';
const client = mqtt.connect(connectUrl, options);
client.on("connect", function (connack) {
if(!client.connected)
return;
console.log('ok.')
});

connect ok, Developer App error quit

@cookieguru
Copy link
Contributor

mqtt relies on several native node modules (like fs or path) that are not supported:

It is also compatible with many JavaScript libraries that do not require the DOM or native node modules.

There's also cordova-plugin-mqtt. I have not tried it

@ilegoo88
Copy link
Author

cordova-plugin-mqtt i have not tried it too.

@ilegoo88
Copy link
Author

websocket is ok, but I want to integrate mqtt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants