-
• #2
Hi!
Possibly just a typo in the forum post, but may work checking:
-b 11520
<< Should be115200
, a0
is missing
You wrotewchusbserial1410
, but the list showswchusbserial1420
(10
vs20
at the end) -
• #3
Thanks @AkosLukacs
with the updates you mentioned (I wonder how I didn't noticed it before ?!) and installingserialport
I am one step further.Now the upload seems to load, but I am getting syntax error - probably because of my ES6 notation - do you know why I can't use ES6 if on web IDE it works fine ?
-
• #4
Don't know, can you post your code & the error you get?
-
• #5
// REQUIRE const D1 = NodeMCU.D1; const D2 = NodeMCU.D2; const wifi = require("Wifi"); // CONSTS const MQTT_SERVER_IP = ""; const SSID = ""; const PASS = ""; // FNS const connectWifi = () => new Promise((resolve, reject) => { wifi.connect(SSID, { password: PASS }, function(e) { if (e) { console.log("error during connect:", e); wifi.disconnect(); reject(e); } else { console.log("connected to", SSID); wifi.stopAP(); resolve(wifi); } }); }); const connectDisplay = () => new Promise((resolve, reject) => { console.log(1); I2C1.setup({ scl: D1, sda: D2 }); console.log(2); // OLED driver and graphic library const g = require("SSD1306").connect(I2C1, () => { resolve(g); }); }); let g = null; const writeText = text => { g.clear(); g.setRotation(2); g.setColor(1); g.setFontVector(15); g.drawString(text, 0, 10); g.flip(); }; const startApp = () => { connectDisplay() .then(newG => { g = newG; writeText("Init..."); }) .then(() => { return connectWifi(); }) .then(() => { writeText("Wifi - OK"); const mqtt = require("MQTT").connect({ host: MQTT_SERVER_IP }); mqtt.on("disconnected", () => { writeText("Disconnected"); }); mqtt.on("connected", () => { writeText("MQTT - OK"); mqtt.subscribe("wemos/#"); const topic = "wemos/start"; const message = "Demo!"; mqtt.publish(topic, message); mqtt.on("publish", pub => { writeText(pub.message); }); }); }) .catch(() => { writeText("Error!"); }); }; //startApp(); E.on("init", startApp); save();
-
• #6
Ok, got the error.
const connectWifi = () => new Promise((resolve, reject) => { wifi.connect(SSID, { password: PASS }, function(e) { if (e) { console.log("error during connect:", e); wifi.disconnect(); reject(e); } else { console.log("connected to", SSID); wifi.stopAP(); resolve(wifi); } }); });
has to be
const connectWifi = () => { return new Promise((resolve, reject) => { wifi.connect(SSID, { password: PASS }, function(e) { if (e) { console.log("error during connect:", e); wifi.disconnect(); reject(e); } else { console.log("connected to", SSID); wifi.stopAP(); resolve(wifi); } }); }); };
difficult to track, because both formats are valid, and text editor can't catch the issue :/
Hi,
I can successfully upload the code via Espruino Web IDE. The port I have to select on Web IDE is:
/dev/cu.wchusbserial1410
However if I run
espruino --list
I can't see that port, instead I see (among others/dev/tty.*
)/dev/tty.wchusbserial1410
- however there is any/dev/cu.*
)Regardless the port I try to use cli upload doesn't work for me.
At times I am getting an info that the port was not found (although its on the list).
The full command I am running is:
and
Any ideas ? Thanks.