Pixl.js NFC does not want to work

Posted on
  • I recently got a Pixl.js and a Puck.js

    NFC is working fine on my puck.js but I can't get it working on my pixl.js.

    This is my code:

    NRF.nfcURL("http://espruino.com");
    NRF.on('NFCon', () => LED1.write(true));
    NRF.on('NFCoff', () => LED1.write(false));
    

    I've tried:

    • resetting the pixl
    • hard resetting the pixl
    • jamming the phone right up to the chip
    • battery vs usb connection
    • NRF.nfcURL() followed by NRF.nfcURL('https://google.com')
    • disconnecting from the web ide

    Am I doing something wrong or could my pixl be broken? :(

  • Thr 2019.03.07

    Let's start with the version of Espruino. Flashed to most current?

    process.env

    How powered, CR2032, Lipo, Micro USB ?

    If CR2032, possible low or flat?

  • It got shipped with the latest version:

    >process.env
    ={
      VERSION: "2v01",
      GIT_COMMIT: "748a4d3",
      BOARD: "PIXLJS",
      FLASH: 524288, RAM: 65536,
      SERIAL: "51ce5f62-7b5098e4",
      CONSOLE: "Bluetooth",
      MODULES: "Flash,Storage,hea" ... "el,graphical_menu",
      EXPTR: 536882408 }
    

    I am powering it via micro usb. I've also tried a CR2032 (brand new).

  • Hi - the NFC aerial is basically where the CR2032 battery is - so you'd need to get the phone's NFC aerial over the right-hand side of the screen.

    Unfortunately the NFC isn't quite as strong as it is on the Puck because you're having to communicate through the LCD display itself, but it should still work fine.

    If you were hovering the phone over the chip itself then it's pretty unlikely to work though as the aerial is over the other side of the board.

  • Hi @Gordon. Thanks for clarifying. I just noticed the backlight going off while holding the phone near it.

    So I changed my code to this:

    NRF.nfcURL("http://espruino.com");
    NRF.on('NFCon', function() { console.log('nfc on'); });
    NRF.on('NFCoff', function() { console.log('nfc off'); });
    

    The result is that i get nfc off like 30 times (but never nfc on) when i move my phone near the pixl (back or front – doesn't really matter) but nothing opened on my phone. It worked with the puck. I've also tried a nfc detection app, no luck.

  • Thanks - I'd be pretty sure the hardware's working then.

    I think what may have happened is there's a bug in Nordic's NFC library which means that occasionally firmware builds just don't work correctly. I was pretty sure the 2v01 firmware for Pixl.js had been tested, but it might be the issue crept in somewhere (doing the exact same build on a different computer can produce different results).

    I've just tested and if you install the firmware from http://www.espruino.com/binaries/travis/­4e1cd825a2e1deff9890454b227e75c834f1f1d1­/ (which is currently the absolute latest development build) then it works great here, so hopefully it will for you as well.

  • That did the trick!

    It could have been me not holding it in the right spot in the first place to be honest, i'm not sure.
    There is still something that i don't get:

    I've started counting NFCon and NFCoff events and my stats look like this:

    on: 38
    off: 714
    

    is that normal? I would assume that those numbers should be identical, no?
    I get a lot of off events when my phone is near the pixl but not in the "right spot".

  • Yes, I think that's to be expected. It's exactly what the NFC stack passes back to Espruino (Espruino doesn't check to see if it was on before sending an off message).

    I think you only get NFCon if the NFC connection has progressed to a certain point, but you get NFCoff if anything happened but then stopped - so the proportion of off to on events probably gets greater the further you are from the Pixl (and so the more unreliable the connection).

  • I can reproduce the issue with a new Pixl.js board (ordered in the same batch) from a colleague running 2v01. So it indeed seems to be a firmware issue.

  • Mon 2019.03.11

    Hi @fiws, I'm puzzled by your response concerning 'issue.' Is the issue related to this thread title "NFC Does not want to work," or the difference between the number of NFCon and NFCoff events?

    Please elaborate.

  • Sorry for the vague response @Robin. As @Gordon stated the difference of events is normal.

    The issue is that NFC with the shipped 2V01 firmware does not work at all on the Pixl.js
    That is what I observed with our 2 devices.

  • Tue 2019.03.12

    Thank you @fiws for the response, but is sounds like you are still in a bit of a pickle?

    So it indeed seems to be a firmware issue.
    The issue is that NFC with the shipped 2V01 firmware does not work at all on the Pixl.js

    One more clarification for Gordon please, did you flash Pixl with the new version, link provided in #6,#7 and that doesn't work?

    ?? ref #7 That did the trick!

    So is it then; did in fact flash, . . . and:
    Yes (functional) to development version, No (fails) to original shipped version??

    meaning there was just a verification testing (fails) on both 2v01 boards?

  • did you flash Pixl with the new version, link provided in #6,#7 and that doesn't work?

    I did not for my colleagues pixl, because i thought there might be more to test on the shipped version – and also … it's not mine. I only flashed the development version on my pixl. Do you want me to test the development version on his pixl as well?

    Yes (functional) to development version, No (fails) to original shipped version. ??

    That's right. NFC is now working on my pixl with 2v01.69 (from the link in #6) but it did not work previously with the shipped version (2v01)

    To clarify: I just wanted to report that: I think the shipped 2v01 firmware has NFC problems on the Pixl.

  • Thank you @fiws that makes it crystal clear.

    I would assume that those numbers should be identical, no?
    So it indeed seems to be a firmware issue.

    I wanted to make sure you were up and running, but thought it was understood the firmware was to blame for the count mismatch between NFCon vs NFCoff. Your last response cleared that up. Was attempting to avoid having Gordon wake to find there was still an issue, even after testing and release of 2v01.69 then wait in wonderment pondering what might have gone wrong, while waiting for your direct response. Didn't want to waste his precious time when a clarification would clear it up.

    Do you want me to test the development version on his pixl as well?

    As you have confirmed functionality and Gordon would have done testing on the development version before upload, I doubt that further trials on your end would be needed. Will defer the final decision to him.

    Thank you for identifying the anomaly, testing the development version and updating your comments here, as I'm sure that will assist others that may have the same issue. Hope I didn't muddy the waters too much in asking for that clarification.

  • Thanks - I was with you after your initial post @fiws.

    So yeah, it's all fine. @Robin as I'd mentioned in http://forum.espruino.com/conversations/­331533/#14648037 the lack of NFC is an issue with the 2v01 firmware, and having more NFCoff than NFCon is to be expected.

    When I do a 2v02 release I'll make sure NFC is working for it - however the issue with Nordic's libraries makes this difficult. Because I have multiple nRF52 builds (Puck.js, Pixl.js and MDBT42) I'll find that maybe one of the boards isn't working for a particular build - but if I modify something and get one board working, one of the others might stop!

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

Pixl.js NFC does not want to work

Posted by Avatar for fiws @fiws

Actions