Skip to main content
Visitor II
December 13, 2023
Solved

Get sensor Reading via RF on STEVAL-SMARTAG1

  • December 13, 2023
  • 1 reply
  • 1268 views

I've got a STEVAL-SMARTAG1, and i need to build a React Native App that reads the sensor reading stored in the memory via RF.
To do so i'm using "react-native-nfc-manager" library to use the NFC sensor on the phone to read TagData but that doesn't contain any data from the sensor, (it contains only the serial number of the chip).
Then i found out that i could access the memory using a method of the library called "transceive" that send a command to the chip and receive a buffer response. I actually using 2 commands:

  • Read Multiple Blocks ( NfcManager.transceive([0x02,0x23,{first_block},{number_of_blocks}]) )
  • Extended Read Single Block ( NfcManager.transceive([0x02,0x30, {block_number(LSB+MSB)}]) )

they both work to receive back a buffer which consist of an array of uint8 that i think is the memory value of that block.

Now i need to know how to interpret that memory value so i can read the sensor readings that are stored in memory.

Is this the correct way of doing so?or there is any other way to get the sensors readings stored in the smartag memory?

 

    This topic has been closed for replies.
    Best answer by Luca Pezzoni

    Ciao,

    we don't use react on our applications

    but we write on SmarTag1 NFC a standard NDEF record
    So you must understand like first thing how to read a NDEF record from NFC using react

     

    if you download the FP-SNS-SMARTAG1 package from st.com:

    https://www.st.com/en/embedded-software/fp-sns-smartag1.html#get-software

    and open the file:
    Projects/STM32L031K6-SmarTag1/Examples/SmarTag1/Src/TagType5.c

    on NfcType5_NDEFInitHeader function you could see that we use one "NDEF External record" for saving in its payload the Log configuration, the max/min measured during the Log, and the samples in a circular buffer

     

    Attached there is one .xlsx file that explain (a little) the organization of the binary payload that we use inside the NDEF External Record

    so, after having read the standard NDEF with your react application, you must take it's binary payload and decode it...

    on main.c file there are all the functions (written in C) for saving the Log data in this binary payload 

    on our github :

    https://github.com/STMicroelectronics/STAssetTracking_Android

    there is the code for reading the Tag (Version V1 that we use for SmarTag1)
    SmartTagAndroid/SmarTagLibrary/src/main/java/com/st/smartaglibrary/v1

     

    Ciao
    Luca

    1 reply

    ST Employee
    December 19, 2023

    Ciao,

    we don't use react on our applications

    but we write on SmarTag1 NFC a standard NDEF record
    So you must understand like first thing how to read a NDEF record from NFC using react

     

    if you download the FP-SNS-SMARTAG1 package from st.com:

    https://www.st.com/en/embedded-software/fp-sns-smartag1.html#get-software

    and open the file:
    Projects/STM32L031K6-SmarTag1/Examples/SmarTag1/Src/TagType5.c

    on NfcType5_NDEFInitHeader function you could see that we use one "NDEF External record" for saving in its payload the Log configuration, the max/min measured during the Log, and the samples in a circular buffer

     

    Attached there is one .xlsx file that explain (a little) the organization of the binary payload that we use inside the NDEF External Record

    so, after having read the standard NDEF with your react application, you must take it's binary payload and decode it...

    on main.c file there are all the functions (written in C) for saving the Log data in this binary payload 

    on our github :

    https://github.com/STMicroelectronics/STAssetTracking_Android

    there is the code for reading the Tag (Version V1 that we use for SmarTag1)
    SmartTagAndroid/SmarTagLibrary/src/main/java/com/st/smartaglibrary/v1

     

    Ciao
    Luca