Avatar for user155724

user155724

Member since Jun 2023 • Last active May 2024
  • 2 conversations
  • 4 comments

Most recent activity

  • in Interfacing
    Avatar for user155724

    Hi,

    I would like to create an NFC tag reader using a PN532. In the end I would like to read NDEF messages from any NDEF tag.

    The general interfacing already works. I wired up the MDBT42Q breakout and a PN532 breakout board.

    Using the PN532 module I am able to read the card id, as it's shown in the tutorial.

    Now, I would like to read all bytes and parse an NDEF message with the library https://github.com/andijakl/ndef-nfc/.

    The idea is to read all bytes of the NDEFMessage and then parse them with the following call:

    var ndefMessage = NdefLibrary.NdefMessage.fromByteArray(by­teArray);
    

    I managed to load the minified version of the library within espruino, I just need to read all the bytes of the tag.
    So I started modifying the PN532 module in an own fork and created the function findCardsAllBytes, which looks like this:

    PN532.prototype.findCardsAllBytes = function(callback) {
      this.cmd([C.PN532_COMMAND_INLISTPASSIVET­ARGET,
                 1, // max targets (max=2)
                 C.PN532_BRTY_ISO14443A // modulation type
                ]);
      var p = this;
      setTimeout(function() { // wait for NFC poll (30ms)
        var d = p.i2c.readFrom(C.PN532_I2C_ADDRESS, 20+1).slice(1);
        if (d[6]==C.PN532_COMMAND_INLISTPASSIVETARG­ET+1) {
          if (d[7]!=1) print("Expecting 1 tag, got "+d[7]);
          callback(d);
        }
      }, 30);
    };
    

    Do you have an idea which I2C commands I need to read all the raw bytes of the tag?

    Thank you!
    Martin

  • in Puck.js, Pixl.js and MDBT42
    Avatar for user155724

    Hi,

    Oh, I was primarily thinking of adding a tutorial about accessibility use cases to the puck-js documentation.
    Here are 2 documented tutorials:
    https://www.asterics.eu/manuals/asterics­-grid/514_uart-action-tutorials.html#uar­t-action-tutorials

    It's up to you!
    Martin

  • in Puck.js, Pixl.js and MDBT42
    Avatar for user155724

    Hi Gordon,

    Thanks for the hint, we have finally managed it by doing some modifications in our fork:
    https://github.com/asterics/EspruinoWebT­ools

    Your Espruino devices and the fact that you can easily program then via Web Bluetooth and Javascript are really awesome. This enables also a lot of possibilities for people with disabilities in combination with our AAC software AsTeRICS Grid.
    We have added a UART action which allows to communicate with your devices and enable interfacing accessible toys or using the puckmote webpage and the IR-database to do environmental control for people with disabilities:
    https://www.asterics.eu/manuals/asterics­-grid/05_actions.html#uart-action

    We will also use new feature this week in a series of workshops in Nairobi in Kenia.
    I would be happy, if you could share the AsTeRICS Grid integration also in your platforms.

    Thanks
    Martin

  • in Puck.js, Pixl.js and MDBT42
    Avatar for user155724

    Hi,

    I am trying to add puckjs support for the Open Source AsTeRICS Grid AAC software in order to have an IR device or to remote controll battery-powerd toys using the FET output (see PR#340).

    Is there a way to handle bluetooth disconnect or write error when using Puck.writefunction?
    I would like to notify the user in such a case and maybe trigger a reconnect.

    I also tried to use Puck.connect(), but this always forces me to reconnect to the device. If there was a previous successful connection, I would like to reuse it, not having to ask the user again.

    Thanks for you help.

Actions