eventually I’d like to do this with an esp32 app and a m5stack RFID2 reader - I can read and write assorted tags just fine, but dont get any reaction with a ruuvi tag either
We read the NFC of tags as a part of our quality control process, but of course anything is possible.
Have you tried to read other NFC devices with the mobile app or reader? Some phones are really picky about NFC antenna positioning, especially when a phone cover is in between the tag and phone. I use personally NFC Tools on Android
what puzzles me is that the older tag (Ruuvi5668) is not NFC-readable, the newer Ruuvi2B44 works fine (see above link for details)
It is possible that the older tag has been physically damaged at some point, if they’re both running same firmware there should not be any software- or hardware based reason why one would not be readable and other not.
The writable record is related to our previous plans to make tags NFC-configurable, however that feature is not on our roadmap at this time. We don’t have any strict guarantee on how to identify NFC device as a RuuviTag, but every RuuviTag produced since 2018 or so has these 4 UTF-8 records:
“id”, “ad” “sw”, “dt”, where the 2-character code is misused country code. “id” has unique ID of RuuviTag, “ad” has MAC address, “sw” has s firmware version and “dt” depends on firmware version.
a bit off-topic, but possibly interesting for others:
I’m integrating the above repo into a flight display application which reports Ruuvis but also other sensors (BLE and non-BLE)
I can add the Ruuvis directly via NFC, but other sensors lack this capability - so I use an NFC key fob or an adhesive tag
I call these “proxy tags” as they stand in for a sensor
I can attach those proxy tags in a convenient location - some sensors are mounted in inaccessible locations
these tags contain short JSON configuration fragments for the application, and a link to the devices’ manufacturer website
I found I get by without any configuration file in the app proper - all I do is scan the Ruuvis and NFC tags
If I accept the tag info, the config information is stored in the flash filesystem and read on startup
that is super quick and way more convenient compared to editing config menues or an on-device website, and useful if you need to reconfigure frequently (which is my situation)
We are currently testing with the M5Dial which should work 1:1 as is has the same RFID chip (WS1850S ) as I used with the external reader
@ Michael_Haberler I successfully use NFC tools by Wakdev with an iPhone Xs Max.
It is very sensitive to orientation and the time the iPhone is in range of the tag (as in swiping the iPhone across the tag)
Sometimes the tag is recognized but the Ruuvi NDEF record are not received.
2.1.1 Global starts with an UPPER-case letter defined by NFC forum
At the present time I cannot locate a list of the NFC forum global definitions other than paying $100!
2.1.2 Local Type start with a lower-case or number.
When there is no need to define its meaning outside of the local context.
MAY be reused by another application in a different context and with different content.
“NFC Forum Local Type SHALL start with a character in the range or as defined in Chapter 3”
The 3.31.1 codes used by Ruuvi tags are (UPPERcase):
“SW” “MAC” “ID”
There is a forth record with bytes not in the ASCII printable text range wHich I suspect vary depending on the firmware version.
For example:
From NFC tools:
Payload: 4 bytes
02 64 61 A3
There is also:
ruuvi.drivers.c/src/nrf5_sfdk_platform/communication/ruuvi_nrf5_sdk15_communion_nfc.c
Which contains ri_nfc_data_set
which includes code which adds records
id, addr, fw and bin
@dgerman yes, the NFC Tools by WAKDEV only recognize the tag’s UUID and type - they cannot decode Type 4 tags like the Ruuvi, only MIFARE and similar Type 2 tags
It is hard to get NFC specs - the field is marred with NDA’s and proprietary documents
I used some of the public drafts put up for ballot which are usually online, assuming the final standard is by and large the same
after an extensive Google safari and spending too much time on this repo, I think it is pretty much the only code for embedded controllers which can decode Type4 tags
In any case, As we agree, Ruuvi tag 3.31.1 INCORRECTLY uses uppercase global codes and the 4th record is poorly defined.
I will look into this more tomorrow. g’night.