Store Wi-Fi credentials in PN7160

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Store Wi-Fi credentials in PN7160

Jump to solution
2,471 Views
kowalski_analysis
Contributor II

I'm working with the PN7160, my setup is as follows:

  • Karo QS93 SoM, running Embedded Linux.
  • PN7160 NFC controller.

They are connected over I2C.

I have the 'basic' setup working. I'm using the libnfc-nci library, with the nfcDemoApp. I can successfully poll and detect an NFC tag and also I can put it into share mode, so that I can share for example a weblink, so that when I put my phone to the controller, I get a popup to go to that link.

There is one thing I can't get to work, which is storing Wi-Fi credentials into the NFC controller. I tried:

./nfcDemoApp share --type=mime -m "application/vnd.wfa.wsc" -d "<wsc_payload>"

 This seems to - kind of - work. When I run this command on the Karo QS93 and tap my phone to the NFC controller with the NXP TagInfo application open, I see that it correctly received my WiFi SSID and Password.

Something else I tried:

./nfcDemoApp share --type=URI -u "wifi:<SSID>?T=WPA2&P=<password>"

This also gives me results in the NXP TagInfo application.

However, what I am trying to achieve, is that when I tap my phone to the NFC controller, I get a prompt on my phone asking if I want to connect to that Wi-Fi network. Is this possible with the PN7160, and if yes am I missing some configuration? Or am I just doing it wrong now?

Any help is appreciated!

0 Kudos
Reply
1 Solution
2,287 Views
kowalski_analysis
Contributor II
I found out why it doesn't work. Apple just can not scan Wi-Fi credentials stored on an NFC tag. A NFC tag with weblink for example does work, just Wi-Fi it doesn't work for Apple.

View solution in original post

9 Replies
2,437 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi   kowalski:

 

Do you use Android phone or Apple phone?

 

Regards

Daniel

0 Kudos
Reply
2,432 Views
kowalski_analysis
Contributor II

Hi,

I got it working now, by using the ndef_emulation_example from the libnfc-nci_examples GitHub and modifying that to store Wi-Fi credentials.

But now that you mention this Android/Apple thing: I noticed that it seems that only Android phones are capable of scanning the PN7160 acting as a tag, and they get the prompt to connect to the network. One person with an Apple has tried it, and it didn't work for him.

What did work for the Apple person, was when we programmed Wi-Fi credentials into the NFC Sample Card (NTAG) that was provided with the PN7160 devkit. In that case, both Android and Apple could scan the card.

Do you have any explanation for this? Can the PN7160 even work with Apple?

0 Kudos
Reply
2,380 Views
danielchen
NXP TechSupport
NXP TechSupport

could you please be more detail about the test with Apple phone?  no prompt confirmation or not work at all?  the ios version, or some logs?

0 Kudos
Reply
2,355 Views
kowalski_analysis
Contributor II

I'm sorry for the confusion, but I am actually using the PN7161, not the PN7160 as I said before.

0 Kudos
Reply
2,357 Views
kowalski_analysis
Contributor II

Hi Daniel,

The Apple Phone has IOS 17.4.1. It doesn't get the prompt to connect to Wi-Fi at all. Also when using the app NXP TagInfo, nothing is received in there.

We didn't try it yet with just storing plain text in the NFC controller (acting as tag), and trying to read that with the Apple Phone (in order to check: is the issue the phone itself, or the type of data stored in the tag).

In the attachment, there are the configuration files libnfc-nci.conf & libnfc-nxp.conf with the settings we use right now.

I have two questions:

1. Is it possible that some wrong settings in these configuration files, result in Apple Phone not working with NFC controller?

2. Will the PN7160 even work with Apple at all? I read something about PN7161 having ECP (Enhanced Contactless Polling), which PN7160 does not have. Is that needed to be able to work with Apple Phone?

I look forward to your answers!

0 Kudos
Reply
2,301 Views
danielchen
NXP TechSupport
NXP TechSupport

 

The PN7161 supports all features of PN7160 plus "Enhanced Contactless Polling.  For the card emulation demo, they behave the same.    I guess it is  compatibility issue for IOS.  this demo is only a reference code, customer can modify it according to their needs.   I created an internal ticket for this.  but I can not get an exact time for it.  

0 Kudos
Reply
2,288 Views
kowalski_analysis
Contributor II
I found out why it doesn't work. Apple just can not scan Wi-Fi credentials stored on an NFC tag. A NFC tag with weblink for example does work, just Wi-Fi it doesn't work for Apple.
2,429 Views
danielchen
NXP TechSupport
NXP TechSupport

You are right.  This is a known issue as far as I know,  I have already reported it to our software team. But I can not guarantee the time. 

 

Regards

Daniel

0 Kudos
Reply
2,411 Views
kowalski_analysis
Contributor II
Alright! Can you please let me know when the software team has an answer?
0 Kudos
Reply