Avatar for dashxdr

dashxdr

Member since Jan 2018 • Last active Jan 2020
  • 1 conversations
  • 6 comments

Most recent activity

  • in ESP32
    Avatar for dashxdr

    I've abandoned Espruino, its performance is just insufficient for my application. I've switched to a duktape javascript engine.

    https://github.com/nkolban/duktape-esp32

    Their bluetooth implementation hasn't been fleshed out. I think your work on the Espruino would translate well.

  • in ESP32
    Avatar for dashxdr

    Ok the root of the problem with the

    E (203529) uart: uart_read_bytes(857): uart driver error
    

    messages is in targets/esp32/jshardwareUart.c line 38 or so in function UartReset()
    if(serial2_initialized) uart_driver_delete(uart_Serial2);
    if(serial3_initialized) uart_driver_delete(uart_Serial3);
    These should set the corresponding flag serialX_initialized to false but they don't.
    if(serial2_initialized) {uart_driver_delete(uart_Serial2);serial2_initialized=false;}
    if(serial3_initialized) {uart_driver_delete(uart_Serial3);serial3_initialized=false;}

    Then reset(); ought to work fine without causing the spewing...

  • in ESP32
    Avatar for dashxdr

    Maybe you need to do your Serial2.setup() inside the onInit() function?

    The reset() function seems to not fully initialize the ESP32. But if you use ESP32.reboot() it seems to be very clean, just like a hardware poweron.

    If I do just
    reset(true);
    Serial3.setup(115200);
    save();
    ESP32.reboot();
    THEN try to use Serial3, it isn't really setup. But if I do:

    reset(true);
    function onInit() {Serial3.setup(115200);}
    save();
    ESP32.reboot();

    Then I can use Serial3, as in Serial3.write('foo!\r\n');

    BUT
    reset(); or reset(true); end up with those same
    E (13760) uart: uart_read_bytes(906): uart driver error
    messages in all cases. reset() on ESP32 isn't reliable, it seems.
    ESP32.reboot(); is reliable.

    SO:
    #1) Put your Serial2.setup() inside onInit()
    #2) Avoid reset() on ESP32 unless you want to do reset(true) to clear out the saved program.

    -Dave

  • in ESP32
    Avatar for dashxdr
    ret = esp_bt_controller_mem_release(ESP_BT_MOD­E_CLASSIC_BT);
     if(ret) {jsWarn("mem release failed:%x\n",ret); return;}
    

    This version does work. I left the ret = esp_ble_gatt_set_local_mtu(500); section in place at the end.

    Thanks--
    Dave

  • in ESP32
    Avatar for dashxdr

    I have a terminal connected to GPIO17 + GPIO16 and it can communicate fine with Serial3 at 115200:
    Serial3.setup(115200, {});
    When I do Serial3.setConsole() I lose console / js interaction on Serial1 but don't get it on Serial3. Is this a bug, or am I not doing it right?

    Ideally I want the default js console to appear on Serial2 or Serial3 always, so I can have a dedicated terminal always active, and the esptool_py can use Serial1 to reprogram the device as needed. I want to avoid having to keep exiting and reloading my terminal program.

    It seems as though either Espruino or ESP32 has made it as cryptic and difficult as possible to accomplish this goal.

    Thanks for any advice...
    -Dave

  • in ESP32
    Avatar for dashxdr

    I was able to get the ESP32 branch of Espruino to build with functional BT but I had to modify line 45 of targets/esp32/bluetooth.c

    if(ret) {jsWarn("mem release failed:%x\n",ret); /*return;*/}
    

    It always fails trying to release ESP_BT_MODE_BTDM and if it returns none of the following initialization gets executed.

    Is there any newer version of this? It seems like a work in progress...

Actions