cancel
Showing results for 
Search instead for 
Did you mean: 

arduino: read NDEF Wi-Fi connection

RMako.2
Associate II

Hi

I am trying to create an application using arduino which will read 4 NDEF text messages where will be stored data needed to establish Wi-Fi connection (host, ssid, password, token).

I did try to run example from stduion ST25 library and thats work fine but only for URL NDEF.

Do you have any working example to show how to read (not need to write) 4 different text NDEF and use those data as I described above?

I would be very gratefull for any help.

thank you!

13 REPLIES 13
RMako.2
Associate II

Hi

What I am trying to do is just to read from ST25DV04K Nucleo board 3 NDEF message - WiFi, URI and TXT, using ST library for arduino.

I am using code from your previous post.

All is ok if NDEF message are short, but if I will try to read longer message I have a trouble with decode.

MCU is STM32L4, I2C communication, what you can see bove is just printf to Termite console

To modify NDEF message I am using ST android application ST25 from google store

0693W00000NqU3BQAV.jpg

Rene Lenerve
ST Employee

Hi @Community member​,

Ok, the error is due to a buffer too small in the code.

In the libNDEF, there is a define that set the buffer size of text record in the file lib_NDEF_Text.h.

This size is set to :

#define NDEF_TEXT_MAX_LENGTH 40

So, it allows text record of 40 bytes max. If you need to work with bigger Text record, you can increase this value to your needs.

Hope this can help you.

Kind Regards.

RMako.2
Associate II

hello

Unfortunately doesn't help.

I tried to play with NDEF_TEXT_MAX_LENGTH for text, URI_Message for URI, NetworkSSID, NetworkKey for WiFi, NDEF_RECORD_MAX_SIZE sizes

I cannot read more than 42 charakters, if any of messages is longer it is finish by error.

0693W00000NqfpzQAB.png0693W00000Nqfq4QAB.png

Rene Lenerve
ST Employee

Hi @Community member​,

If by updating this value, this allow you to obtain only 2 bytes more, it means for me that you have not enough memory available in your system. You can have some information with the compiler to know more about memory space used by your code.

Another thing to check, that could result in a limitation of bytes to read, is if your i2c read function is limited by a timeout. A read of 42 bytes can spent around 1ms for a speed set to 400kbit/s on I2C.

Hope this can help you.

Kind Regards.