• Hey Gang,

    I know there have been a few goes in Github around the "watch" function (which the rotary encoder module uses behind the scenes), on the ESP32, and generally it works fine for buttons. But when using a full encoder module, such as this one:

    https://www.ebay.com/p/5pcs-Ky-040-Rotar­y-Encoder-Module-for-Arduino-AVR-Pic/138­6840178

    I get continual restarts on 2v01 (it was the same on previous versions, so its not a regression).

    So lets take the standard code from the Espruino example page :

    https://www.espruino.com/Encoder

    var step = 0;
    require("Encoder").connect(D26,D25,funct­ion (direction) {
      step += direction;
      console.log("encoder step ",step);
    });
    

    What this causes on my ESP32s is basically this:

      >reset()
    =undefined
    WARNING: gap set scan error code = 103
    WARNING: set rssi scan not implemeted yet
     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v01 (c) 2018 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    >load()
    =undefined
    WARNING: gap set scan error code = 103
    WARNING: set rssi scan not implemeted yet
    encoder step  1
    encoder step  2
    encoder step  3
    encoder step  4
    encoder step  5
    encoder step  6
    encoder step  7
    encoder step  8
    encoder step  9
    /mnt/c/Users/rhys/esp32/V3.1/EspruinoBui­ldTools/esp32/build/esp-idf/components/f­reertos/queue.c:1616 (xQueueReceiveFromISR)- assert failed!
    abort() was called at PC 0x40093110 on core 0
    Backtrace: 0x400962cb:0x3ffbd810 0x40096423:0x3ffbd830 0x40093110:0x3ffbd850 0x40084b72:0x3ffbd870 0x40084c71:0x3ffbd8b0 0x40084d1f:0x3ffbd8d0 0x4012def9:0x3ffbd8f0 0x4008501c:0x3ffbd910 0x40084ecc:0x3ffbd940 0x40084fe7:0x3ffbd960 0x400836a9:0x3ffbd980 0x401d3003:0x3ffbd970 0x7ffffffc:0x4009497c
    Rebooting...
    ets Jun  8 2016 00:22:57
    rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_d­rv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:2
    load:0x3fff0018,len:4
    load:0x3fff001c,len:2588
    load:0x40078000,len:7192
    load:0x40080000,len:5288
    entry 0x40080278
    E (518) spiram: SPI RAM enabled but initialization failed. Bailing out.
    WARNING: Bluetooth is disabled per ESP32.enableBLE(false)
    ERROR: Wifi: event_handler STA_START: esp_wifi_connect: 12298(SSID is invalid)
    encoder step  -1
    encoder step  -2
    encoder step  -3
    encoder step  -4
    encoder step  -5
    encoder step  -6
    encoder step  -7
    encoder step  -8
    encoder step  -9
    encoder step  -10
    encoder step  -11
    encoder step  -12
    encoder step  -13
    encoder step  -14
    encoder step  -15
    encoder step  -16
    encoder step  -17
    encoder step  -18
    encoder step  -19
    encoder step  -20
    encoder step  -21
    encoder step  -22
    encoder step  -23
    encoder step  -24
    encoder step  -25
    encoder step  -26
    encoder step  -27
    encoder step  -28
    encoder step  -29
    encoder step  -30
    New interpreter error: FIFO_FULL
    encoder step  -31
    encoder step  -32
    encoder step  -33
    encoder step  -34
    encoder step  -35
    encoder step  -36
    encoder step  -37
    encoder step  -38
    encoder step  -39
    encoder step  -40
    encoder step  -41
    encoder step  -42
    encoder step  -43
    encoder step  -44
    encoder step  -45
    encoder step  -46
    encoder step  -47
    encoder step  -48
    encoder step  -49
    encoder step  -50
    encoder step  -51
    encoder step  -52
    encoder step  -53
    encoder step  -54
    > 
    

    .. and these restarts continue until I stop rotating the encoder, after which the ESP32 restarts a last time and continues normal functioning. So any ideas?

    Thanks :)

    -=hfc

About