Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
Tips:
For a full reference visit the Markdown syntax.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I use the mosca to run a mqtt server,and use the esp32 as a mqtt client ,but the client can not connect the server,the server and the client are in different network,so how can i set up the host ?var ssid="wangnuan";
var password="wang1234";
var wifi=require('Wifi');
var host='xxxxxxxx';
var options={
};
wifi.connect(ssid, {password: password}, function() {
console.log('Connected to Wifi. IP address is:', wifi.getIP().ip);
console.log("Connected to access point");
var mqtt = require("MQTT").create(host);
mqtt.on("connected", function() {
});
console.log("Doing a connect");
mqtt.connect();
});