Crash when handling NFC events with Web IDE connected #2218
Replies: 23 comments
-
Posted at 2017-05-08 by @gfwilliams Strange - so you're saying that something like this:
is fine - it's just when you print text from the NFCon event that you have problems? And the Web IDE stays connected - it just no longer prints anything. What if you disconnect and reconnect? If you type I'd also be interested in whether:
works - so printing, but not right at the same time that NFC starts. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-08 by atkinchris It still experiences crashes when there's no Immediate commands work in the left pane - but not after it's crashed. Once it's crashed, it either disconnects immediately, or the Web IDE doesn't realise it's already disconnected until I try to issue a command. Your example with |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-08 by @gfwilliams It's strange - I've just tried again here with exactly your code and it seems to work great for me. I've done it probably 30 times now and it's rock solid. Please can you check |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-08 by atkinchris
So you get a |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-08 by @gfwilliams Looks fine then - that is strange. I'd be interested to see whether anyone else hits this? I'm using an old Nexus tablet so it's possible that different devices do NFC differently and can cause problems.
It's the device itself. Every command that is executed in the command prompt has the result of evaluating it returned with an |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-09 by atkinchris Playing with this more, crashes appear to be more common when the reader is removed, such as tapping the phone against the Puck then lifting it again. Doing this with |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-09 by @gfwilliams Wow, interesting - thanks! So you're doing this?
How many attempts does it take before you get a crash? And this is on your Nexus 5x? have you tried any other NFC reading devices? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-10 by atkinchris I've tried the Puck this evening with a N3DS - it reads the Puck (although it can't do anything with it) and I can see the |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-11 by @gfwilliams Very interesting - thanks for checking with another device! I guess it's time for a phone upgrade then... However if @AnticaT can reproduce with the bare Nordic NFC example (mentioned in the other thread) then we can go to Nordic with it, as it looks suspiciously like a problem with their NFC implementation. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-11 by atkinchris I've tried @AnticaT's FW with similar code ( |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-11 by @gfwilliams Yeah, I'm pretty sure it's an error internal to the NFC library - so no matter how it's used there would still be the problems. Much like me with Espruino, Nordic (the chip makers) find it hard to help if I just say 'it's not working with my code'. If I can show their simple NFC example code is broken then they'll be able to help though. If you (or anyone else) finds other devices that definitely work or definitely cause problems, please could you post them up? WorksNexus 10 Doesn't workNexus 5X Also, is there anyone in the UK that would be willing to lend me their Nexus 5X to test with? I could then test it with the nRF52 Devkit. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-11 by atkinchris Which app were you using with your Nexus 10 to test @gfwilliams? I used both NFC Tools and NFC TagInfo by NXP, the latter of which created far more NFC events. With both apps and @AnticaT's FW, I can see Select CL1 commands reaching the JS event system (would have expected these to be handled and not propagated). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-11 by @gfwilliams I literally just turned on NFC on the N10 and used the OS's scanning capability. Does the N5X work when you do the same? Or does it only cause problems when you run one of the other apps? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-11 by atkinchris Just using the NFC to launch the browser with an NDEF URL seems slightly slower than a real tag - but it doesn't crash the Puck. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-11 by @gfwilliams Ok, so actually in your case N5X works just fine normally - it's just when you use a special app on the N5x that there's trouble? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-11 by atkinchris Yep - any app that tries to read more from the tag than just it's basic NDEF message. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-11 by @gfwilliams Is this with the normal firmware, or the @AnticaT one? So both NFC Tools and NFC TagInfo can trigger problems, but only when trying to handle |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-11 by atkinchris Both - I was using NFC TagInfo gives me more information on a tag - and was much easier to trigger crashes with. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-24 by AntiCat I think, I've identified the possible source for this issue Source:
In some cases Btw: I also don't like that nordic is accessing data from this buffer without verifying, that the received amount of data makes some sense:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-25 by @gfwilliams Wow, that's great. And it makes sense that the third-party app could be triggering problems. Have you tried adding some checks and seeing if that fixes it? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-25 by AntiCat Yes, my branch is more stable now. However I'm not sure if I found the error @atkinchris had. The issue I fixed is definitely independent of the two former issues BLE on/off and can't stop and start NFC more then once.Attachments: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-25 by @gfwilliams Great, thanks! I've just pulled that in - hopefully that'll fix some problems. I didn't check, but I wonder if Nordic have made some improvements in the newer SDK that could be ported back. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-25 by AntiCat The code in newer SDKs looks significantly cleaner, they removed all the workarounds for silicon prototypes. I can't tell if they fixed anything. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-05-07 by atkinchris
I'm experiencing an issue with my new Puck when using it's NFC while connected to the Web IDE.
While the Web IDE is connected to the Puck, if my phone attempts to read the Puck as an NFC tag, after one or two successive reads, the Puck will appear to crash. It will no longer be seen as an NFC tag by the phone, and the Web IDE will either disconnect automatically, or realise it's disconnected after trying to issue a command. I won't be able to detect the tag, or see it again in the Web IDE, until the battery is reinserted.
If I upload the code, save it, disconnect the Web IDE (and lift the battery on the Puck) the NFC tag will be correctly identified - and does not crash, even after a many successive reads. (Uploading the code and scanning the Puck without lifting the battery often meant the tag was not detected)
My example code:
When the Web IDE is connected, I see a few
print
messages - but after 4 or 5 messages, the terminal output stops half way (Hello wo
) - and the Puck crashes. I don't have any issues with other functions when connected to the IDE, such as printing a message when the button is pressed, or setting LEDs.Has anyone else experienced issues with unreliable NFC behaviour when connected to the Web IDE?
Beta Was this translation helpful? Give feedback.
All reactions