NFC vCard #3151
Replies: 30 comments
-
Posted at 2018-01-15 by @gfwilliams That's awesome - thanks! You know there's If so, I wonder how many people actually use |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-16 by AntiCat Yes
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-17 by @gfwilliams Aha, that makes more sense - thanks! Are you interested in getting those modules listed on the Espruino site? Wow, so vCard NFC actually works on iPhones? I assumed they were only used for Apple Pay. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-18 by AntiCat Yes, iPhone 7, 8, X with iOS11 (released in September 2017) feature a NFC reader API for NDEF records. (No write support and no arbitrary tag type support, just NDEF read.) I'd like to have I've come up with an additional example:
This code creates an empty tag with 768 bytes of writable storage. The |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-19 by @gfwilliams That's great! So the NFC URL is possible with an app on iOS, even it's not enabled in the OS yet. It'd be helpful if you could open a PR for the vCard and actual tag - I'm not sure if you've done it before, but just stick stuff in EspruinoDocs/modules (as it's not actual hardware) with a markdown file with an example or two of how to use it. Otherwise I could do that based on this thread? I think the native vCard might be more useful as a module, but the NFCTag library itself is amazingly useful on its own, and the vCard implementation for it would probably be good in the docs, to compare to what happens for nfcRaw. It's quite exciting that something like:
should mean you can write JS code via NFC then press the button to execute it :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-19 by AntiCat I'll open a pull request for About downloading arbitrary data using NFC: Wrap and unwrap is missing from Pucks JS-Engine, namely:
If there is interest I would invest some time into a MIME record wrap unwrap module. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-18 by Tesseract-Developer Is there an example of using this posted anywhere? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-18 by AntiCat Can you be a little more specific? The documentation for the NFCTag module is available here: I've tested the library with iOS13 (now also featuring write!!!) using a recently released App (not by me): https://apps.apple.com/ch/app/nfc-tools/id1252962749 iOS is a little more picky than Android so tuning some static data is required:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-21 by Tesseract-Developer Hi @AnticaT, thank you for your response. I'd like to specifically use code like what you posted in #1 above, with the NFC vCard in more human readable format. I attempted to simply change the "NFCvCard" to "NFCTag", but hit the following error:
If what I'm trying to do isn't possible - please let me know. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-21 by Robin Mon 2019.10.21
Answers to the request would depend on where the substitution was made. Within the 'require' statement in post #9 example at: or a substitution within the class declaration in code file 'NFCvCard.js' from post #1 ? Without that detail, would have to be a pure guess. Please post your code so others can easily grasp a snapshot of the coding attempt direction. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-22 by Tesseract-Developer Hi @robin, in order to get this working "as-is", I ended up having to use the NFCvCard.js as a local module per post #1 above. I'm still unable to do any reading, but the code is the same as well:
Also using the same NFC Reader app as post #1. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-22 by Robin
So, I presume the original code module from post #1 is working then?
Is the module 'NFCTag.js' also used locally, and physically there as implied in post #12 ? If so, is the suggestion that the errors as shown in post #10 do occur, by only inserting the single statement as shown in post #12 verbatim, and no other statements acting on var 'tag'? (e.g. other code currently in memory or not all the code is posted) I also note from the heading 'Example' using link from post #9 > https://www.espruino.com/NFCTag that the first six bytes must use six initializer bytes as described in the table shown there. The 'human readable' form as indicated in post #10 doesn't appear to follow that example.
EDIT: I see in file 'NFCvCard.js' function 'publish()' that line(s) ex: this._record.set(data, C.HEADER.length); creates a payload based on the data passed and the header constant 'C' so those initialization bytes are included there.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-22 by Tesseract-Developer @robin - let me clarify, as of post #12 no error is reported on the Send to Espruino, however nothing appears on the NFC reader either. After clicking send in the WebIDE, the following is reported:
...not that I can confirm using the same NFC Reader app as post #1.
No. However internally NFCvCard has the To replicate what I am doing in its entirety, download the NFCvCard.js locally to your modules folder, paste the following code in your editor, and upload.
Once the upload completes, attempt to verify the values with the NFC reader. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-22 by Robin
The 'NFCTag.js' file is viewable from within a browser, so agreed - should load. Does entering Still puzzled on this sentence as I'm not seeing the substitution part in the responses.
Could this now be bad information perhaps? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-22 by AntiCat I never submitted a PR for That sed I rarely have issues when the BLE connection is also open. What might also break the system is creating multiple instances of My RAW data ends up to be:
Except the first 10 bytes (unique device id) this data should be identical on your Puck.JS.Attachments: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-23 by Robin Tue 2019.10.22 Thanks @AnticaT for the verification. For @Tesseract-Developer and myself, what version of Espruino is flashed on your device? As the closing post (then) is over twenty months old, could it be that the device you have is still at an older version? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-23 by AntiCat Software is 2.04, the Hardware im using is a Puck from the Kickstarter campaign so 1.0e. Edit: Could Minify make a difference? It is off on my system. I not at home so I can’t test other options right now. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-25 by Tesseract-Developer I'm not seeing minification having any real effect on my outcome unfortunately. My software is 2.04 and hardware 1.0e as well. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-26 by Robin Sat 2019.10.26 Put another hour into this as I wanted to humor myself with a similar error just trying to load the code. Minification is off. Running on Win10. Code file NFCvCard.js running in local modules folder.
and dump() results
Results (pared) of WebIDE >> Settings >> Console
@Tesseract-Developer would you please post the result of process.env and process.memory() along with dump and pertinent detail from the console output please.
What OS is the WebIDE running on? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-28 by Tesseract-Developer
WebIDE is running on OSX 10.14.6 |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-28 by Robin Mon 2019.10.28 Thank you @Tesseract-Developer for posting. Nothing stands out as an obvious cause and pains me, as I thought I had identified what was going on. To prove this, I attempted to update to 2v04 but that (my flash attempt) didn't go as expected. Now I'm without a BLE device to further assist short term. I can continue to provide some debugging steps as we still need a bit more information. Others may be holding off too, as they also are unable to provide assistance without the info I've previously requested. > fr #15 'Does entering dump(); in the WebIDE Left-Hand console panel, display the same functions as in above file? (e.g. was the file actually fetched and parsed?)' In #15 I inquired about the results Would you also comment on this line from #15 (#10) also:
I am purposely holding off on my testing results until I have that needed detail. Under some conditions, I was able to get near identical error messages, with the results of #21 and me *now* not being able to test with the newly flashed version, leave me with a bit of doubt. Still some debugging steps we should take. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-29 by Tesseract-Developer
I think perhaps you are fixating on that point. As I said in #14, really it comes down to not being able to see or read any of the values that the replication steps listed are supposed to produce. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-30 by Robin Tue 2019.10.29
Yes, exactly @Tesseract-Developer. Several of us have been able to load the modules which do not produce the errors claimed. One setup I tried did produced something similar. From the exhaustive work by @AnticaT furnish a solution which provided instructions, the code source, a sample data dump and a demonstration video to boot. Many of us provide our time freely to assist fledgling end users gratis, thereby boosting the community knowledge base. Building on the success of those that have paved the way will shave off valuable development time for the novice. I asked three times for detail in order to assist, but the response is akin to asking me to solve your Rubik's cube while handcuffed, and without being able to see the cube! May I suggest the several troubleshooting links at: See: Writing an effective forum post I wish you all the success in your endeavour. . . . |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-10-30 by Tesseract-Developer @robin What am I missing here? I have provided what I thought was everything you asked for, as well as steps to reproduce, in the order to reproduce them, as well as the code being used... the results... the lack of ability to read any information in a reader If I’m misreading your response as I’ve somehow offended you - I’ll be the first to apologize! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-11-01 by @gfwilliams I don't have time to look into this properly right now, but as a sanity check does It's just the VCARD code that is the issue? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-11-01 by Tesseract-Developer Hello @gfwilliams, thank you for your response.
That is correct. nfcURL works without issue and can be read with multiple devices. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-11-01 by @gfwilliams Ok, thanks. Does it work on other readers, for example Android? @AnticaT did mention in http://forum.espruino.com/comments/14950929/ that you need to add that extra bit of code for iPhone. Did you give that one a try? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-11-01 by Tesseract-Developer
Yes, the
Yes. But I will be the first to say it's not clear to me what order to perform this. If you combine the code samples, it does not work - but I do not expect it to either. It has to be something so simple that I am missing:
Maybe @AnticaT could post the full code used to get it working so I can copy/paste it on my end and see similar results? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-11-02 by Robin Sat 2019.11.02
I re-read the posts starting with the #8 original inquiry. The requests are there in plain sight. It is quite possible @Tesseract-Developer that I over estimated the troubleshooting skill level using the environment within the WebIDE. Tackling a local module usually isn't a first step introduction. Maybe too much detail was missed going between posts, perhaps? As Gordon pointed out in #26 for the next week next no time is available and for the two weeks following that, will be super busy, so his ability to apply 'nitty-gritty' debugging will be virtually non-existent. While we wait, how well are you able to debug? One course of action could be to cut-n-paste the individual module functions into your own code, and wrap those with try/catch statements or use the WebIDE debugger. The response to test in post #26 further suggests the hunch I had still stands. We still need more information to narrow down where to look. If what I suspect isn't the case, we may be at the step #29 request. If taking a peek reveals what I suspect, then we may need one or more additional steps. In either case, any onlooker will require this detail to avoid back-n-forth requests for the additional detail. I'm prepared to avail myself this weekend to get the basics out of the way. As I pointed out in #22 I'm now at a dis-advantage without a device to test, so I'll be relying on the feedback provided me, and what I discovered last week. I also inquired about:
I was looking for your explanation here. To me it seems the text string are reversed, based on the code snippet provided in #29. Lets start with answering that so we are all on the same page, and we'll just handle one item at a time to eliminate possible confusion along the way. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-11-07 by @gfwilliams I'm not 100% sure, but maybe if you edited the NFCvCard as follows:
but that's a total guess I'm afraid |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-13 by AntiCat
I've implemented a PoC for NFC vCard support.
My implementation consists of two modules. A NFC card emulation
NFCTag.js
and a NDEF vCard wrapperNFCvCard.js
.NFCTag: Features READ and WRITE support.
NFCvCard: Its a pretty crude application example for NFCTag that can be altered to support various MIME-Type based NDEF tag types.
I've tested my vCard example below using https://itunes.apple.com/us/app/nfc-reader-for-iphone/id1249686798?mt=8
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions