Avatar for markopraakli

markopraakli

Member since Jan 2019 • Last active Mar 2019
  • 3 conversations
  • 5 comments

Most recent activity

  • in ESP32
    Avatar for markopraakli

    UP! Anyone?
    Many thanks!

  • in General
    Avatar for markopraakli

    Seems like v197 will work with PN532. But not in v198. Only change what I found is here:
    https://github.com/espruino/Espruino/com­mit/3739ee577d3bc11064b63db61942ac9910da­0e3a

    @Gordon can you figure out why PN532 does not work in newer versions?

  • in General
    Avatar for markopraakli

    Hello guys
    I've set my module to use I2C and using following example:

    I2C1.setup({scl:22, sda:21,});
    var nfc = require("PN532").connect(I2C1);
    print(nfc.getVersion());
    nfc.SAMConfig(); // start listening
    setInterval(function() {
     nfc.findCards(function(card) {
      print("Found card "+card);
      card = JSON.stringify(card);
      var leds = [LED1,LED2,LED3];
      if (card=="[147,239,211,128]") digitalWrite(leds,1);
      if (card=="[249,192,235,164]") digitalWrite(leds,2);
      if (card=="[4,99,129,114,72,52,128]") digitalWrite(leds,4);
     });
    }, 1000);
    

    And I got I2C errors:

     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| 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
    >
    WARNING: Scan stop failed
    WARNING: set rssi scan not implemeted yet
    WARNING: jshI2CSetup: driver installed, sda: 21 sdl: 22 freq: 1000000,
    ERROR: jshI2CWrite:, slave doesn't ACK the transfer.
    ERROR: jshI2CRead:, Operation timeout because the bus is busy.
    ERROR: jshI2CRead:, Operation timeout because the bus is busy.
    {
      "chip": "PN51c",
      "firmware": "232.254",
      "support": 63 }
    ERROR: jshI2CWrite:, Operation timeout because the bus is busy.
    ERROR: jshI2CRead:, Operation timeout because the bus is busy.
    ERROR: jshI2CRead:, Operation timeout because the bus is busy.
    

    Any ideas why basic example does not work? Using ESP32 module.

  • in ESP32
    Avatar for markopraakli

    Why simple button check will fail ??

    pinMode(16, 'input_pulldown');
    pinMode(17, 'input_pulldown');
    
    setWatch(function(e) {
      console.log("Button 17 pressed");
    }, 17, { repeat: true, edge: 'falling', debounce: 50 });
    
    setWatch(function(e) {
      console.log("Button 16 pressed");
    }, 16, { repeat: true, edge: 'falling', debounce: 50 });
    

    And result is:

    >ets Jun  8 2016 00:22:57
    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    flash read err, 1000
    ets_main.c 371
    ets Jun  8 2016 00:22:57
    rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (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:2364
    load:0x40078000,len:0
    load:0x40078000,len:10880
    entry 0x40078c4c
    WARNING: setsockopt(SO_REUSPORT) failed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    Button 17 pressed
    >/mnt/c/Users/rhys/esp32/EspruinoBuildTo­ols/esp32/build/esp-idf/components/freer­tos/./queue.c:1442 (xQueueGenericReceive)- assert failed!
    abort() was called at PC 0x4008a168 on core 0
    Backtrace: 0x4008c743:0x3ffdbfb0 0x4008c76f:0x3ffdbfd0 0x4008a168:0x3ffdbff0 0x40107bda:0x3ffdc030 0x40109f04:0x3ffdc050 0x4010a253:0x3ffdc070 0x4010b536:0x3ffdc0c0 0x40136075:0x3ffdc140 0x401af1b1:0x3ffdc170 0x4015b2bb:0x3ffdc190 0x4015b51c:0x3ffdc1b0 0x4012e39c:0x3ffdc210 0x4012999f:0x3ffdc230 0x40129b05:0x3ffdc2a0 0x4014a845:0x3ffdc2c0
    Rebooting...
    ets Jun  8 2016 00:22:57
    rst:0xc (SW_CPU_RESET),boot:0x13 (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:2364
    load:0x40078000,len:0
    load:0x40078000,len:10880
    entry 0x40078c4c
    Button 17 pressed
    WARNING: setsockopt(SO_REUSPORT) failed
    

    What could cause this :( ?
    Other ways is to use setInterval to check digitalRead pin state... but this is not the right way :(

    • 2 comments
    • 158 views
  • in ESP32
    Avatar for markopraakli

    Hello
    Is it possible to attach both corest to Espruino software? ESP32 has 2 cores. Core 0 with Task1 and Core 1 with Task2.
    Perhaps is possible to attach another Core via C++

    E.compiledC("xTaskCreatePinnedToCore(
                        Task2code,   /* Task function. */
                        "Task2",     /* name of task. */
                        10000,       /* Stack size of task */
                        NULL,        /* parameter of the task */
                        1,           /* priority of the task */
                        &Task2,      /* Task handle to keep track of created task */
                        1);");
    

    Thanks!

Actions