ESP32S not working Serial / UART

Posted on
  • Good day! Please help. ESP32S not working Serial / UART

    Serial2.setup(9600, { tx: D4, rx: D15 });
    Serial2.on('data', function(data) {
        console.log('Serial2: ', data);
    });
    //Serial2.print('Hello UART2');
    //Serial2.setup(115200);
    var  wifi = require("Wifi");
    function onInit() {
      print("STRAT>>>1");
       wifi.connect("INGRIFABCP", {password: "B73vFeX6se2"}, function() {
            console.log("connected!");
            console.log(wifi.getIP().ip);
         wifi.save();
       });
    }
    save();
    

    | |_ ___ ___ _ ||___ ___
    | |_ -| . | _| | | | | . |
    |
    || || |_|||_|_|

          |_| http://espruino.com
    

    1v94 Copyright 2016 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate

    E (123248) uart: uart_read_bytes(857): uart driver error
    E (124248) uart: uart_read_bytes(857): uart driver error
    =undefined
    Erasing Flash..................
    Writing......
    Compressed 80000 bytes to 3715
    Checking...
    Done!
    Running onInit()...
    STRAT>>>1
    ERROR: Prompt not detected - upload failed. Trying to recover...
    echo(1)
    =undefined
    Serial2.print('Hello UART2');
    =undefined

  • Does it work if you get rid of the oninit and save ?

    Just upload the code in the simple form and send something to serial2

  • Hi @Alexander,

    if you use save() in upload code than wrap it with setTimeout(save,2000) to be sure that code is completely upload before running save().

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

ESP32S not working Serial / UART

Posted by Avatar for Alexander @Alexander

Actions