phone-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Testing wanted for Linux NFC subsystem
       [not found]   ` <20210512170135.GB222094@animalcreek.com>
@ 2021-05-13 11:49     ` Stephan Gerhold
  2021-05-13 14:48       ` Mark Greer
  0 siblings, 1 reply; 5+ messages in thread
From: Stephan Gerhold @ 2021-05-13 11:49 UTC (permalink / raw)
  To: Mark Greer
  Cc: Frieder Schrempf, Krzysztof Kozlowski, Jakub Kicinski,
	David S. Miller, netdev, linux-kernel, linux-nfc, Alex Blasche,
	phone-devel

Hi!

On Wed, May 12, 2021 at 10:01:35AM -0700, Mark Greer wrote:
> On Wed, May 12, 2021 at 05:32:35PM +0200, Frieder Schrempf wrote:
> > On 12.05.21 16:43, Krzysztof Kozlowski wrote:
> > > The NFC subsystem is orphaned.  I am happy to spend some cycles to
> > > review the patches, send pull requests and in general keep the NFC
> > > subsystem running.
> > 
> > That's great, thanks!
> > 
> > Maybe you also want to have a look at the userspace side and talk to Mark Greer (on cc). He recently said, that he is supposed to be taking over maintenance for the neard daemon (see this thread: [1]) which currently looks like it's close to being dead (no release for several years, etc.).
> > 
> > I don't know much about the NFC stack and if/how people use it, but without reliable and maintained userspace tooling, the whole thing seems of little use in the long run. Qt has already dropped their neard support for Qt 6 [2], which basically means the mainline NFC stack won't be supported anymore in one of the most common application frameworks for IoT/embedded.
> > 
> > [1] https://lists.01.org/hyperkitty/list/linux-nfc@lists.01.org/thread/OHD5IQHYPFUPUFYWDMNSVCBNO24M45VK/
> > [2] https://bugreports.qt.io/browse/QTBUG-81824
> 
> Re: QT - I've already talked to Alex Blasche from QT (CC'd).  With some
> work we can get Linux NFC/neard back into their good graces.  I/we need
> to find time to put in the work, though.
> 
> An example of the issues they have seen is:
> 
> 	https://bugreports.qt.io/browse/QTBUG-43802
> 
> Another issue I have--and I suspect you, Krzysztof, have as well--is
> lack of hardware.  If anyone reading this wants to volunteer to be a
> tester, please speak up.
> 

Glad to see that Linux NFC might be somewhat less dead now :)

I have a couple of "recycled" smartphones running mainline Linux
and some of them do have NFC chips. I have two with NXP PN547
(supported by nxp,nxp-nci-i2c), one with Samsung S3FWRN5
(samsung,s3fwrn5-i2c) and even one with Broadcom BCM2079x I think
(this one does not have a driver for the Linux NFC subsystem sadly).

+Cc phone-devel@vger.kernel.org, in case other people there are
interested in NFC :)

The NXP/Samsung ones seems to work just fine. However, since there are
barely any userspace tools making use of Linux NFC all my testing so far
was limited to polling for devices with "nfctool" and being happy enough
when it realizes that I hold some NFC tag close to the device. :S

I would be happy to do some more testing if someone has something useful
that can be tested. However, I guess ideally we would have someone who
actually uses Linux NFC actively for some real application. :)

The QT integration might be useful for people running postmarketOS [1]
on these smartphones, but so far I haven't really seen any useful NFC
Qt applications either. :/

Thanks!
Stephan

[1]: https://postmarketos.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Testing wanted for Linux NFC subsystem
  2021-05-13 11:49     ` Testing wanted for Linux NFC subsystem Stephan Gerhold
@ 2021-05-13 14:48       ` Mark Greer
  2021-05-13 15:37         ` Stephan Gerhold
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Greer @ 2021-05-13 14:48 UTC (permalink / raw)
  To: Stephan Gerhold
  Cc: Mark Greer, Frieder Schrempf, Krzysztof Kozlowski,
	Jakub Kicinski, David S. Miller, netdev, linux-kernel, linux-nfc,
	Alex Blasche, phone-devel

On Thu, May 13, 2021 at 01:49:53PM +0200, Stephan Gerhold wrote:
> Hi!

Hi Stephan and thanks for stepping up.

> I have a couple of "recycled" smartphones running mainline Linux
> and some of them do have NFC chips. I have two with NXP PN547
> (supported by nxp,nxp-nci-i2c), one with Samsung S3FWRN5
> (samsung,s3fwrn5-i2c) and even one with Broadcom BCM2079x I think
> (this one does not have a driver for the Linux NFC subsystem sadly).
> 
> +Cc phone-devel@vger.kernel.org, in case other people there are
> interested in NFC :)
> 
> The NXP/Samsung ones seems to work just fine. However, since there are
> barely any userspace tools making use of Linux NFC all my testing so far
> was limited to polling for devices with "nfctool" and being happy enough
> when it realizes that I hold some NFC tag close to the device. :S

There is a user-level daemon that is the counterpart for the in-kernel
NFC subsystem.  It is called neard and is available here:

	git://git.kernel.org/pub/scm/network/nfc/neard.git

There are a few test script in it that will let you read and write NFC
tags, and do some other things.  We can add some more tests to that set
as we go.

> I would be happy to do some more testing if someone has something useful
> that can be tested. However, I guess ideally we would have someone who
> actually uses Linux NFC actively for some real application. :)

Ideally, you should have some NFC tags of various types.  Types 2, 3,
4A, 4B, and 5 tags are supported.  Peer-to-peer mode is supported too
so you should be able to transfer data from one of your phones to the
other over NFC (and do a BT hand-over, if you're interested).

Note that the specified range for NFC is only 4 cm and poor antenna
design, etc. means that the actual range is usually much less (e.g.,
they amost have to touch).  Also note that there are timing constraints
so you may need to make the scheduling priority of the interrupt thread
of your NFC driver real-time.

Mark
--

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Testing wanted for Linux NFC subsystem
  2021-05-13 14:48       ` Mark Greer
@ 2021-05-13 15:37         ` Stephan Gerhold
  2021-05-14 15:23           ` Mark Greer
  0 siblings, 1 reply; 5+ messages in thread
From: Stephan Gerhold @ 2021-05-13 15:37 UTC (permalink / raw)
  To: Mark Greer
  Cc: Frieder Schrempf, Krzysztof Kozlowski, Jakub Kicinski,
	David S. Miller, netdev, linux-kernel, linux-nfc, Alex Blasche,
	phone-devel

On Thu, May 13, 2021 at 07:48:55AM -0700, Mark Greer wrote:
> On Thu, May 13, 2021 at 01:49:53PM +0200, Stephan Gerhold wrote:
> > I have a couple of "recycled" smartphones running mainline Linux
> > and some of them do have NFC chips. I have two with NXP PN547
> > (supported by nxp,nxp-nci-i2c), one with Samsung S3FWRN5
> > (samsung,s3fwrn5-i2c) and even one with Broadcom BCM2079x I think
> > (this one does not have a driver for the Linux NFC subsystem sadly).
> > 
> > +Cc phone-devel@vger.kernel.org, in case other people there are
> > interested in NFC :)
> > 
> > The NXP/Samsung ones seems to work just fine. However, since there are
> > barely any userspace tools making use of Linux NFC all my testing so far
> > was limited to polling for devices with "nfctool" and being happy enough
> > when it realizes that I hold some NFC tag close to the device. :S
> 
> There is a user-level daemon that is the counterpart for the in-kernel
> NFC subsystem.  It is called neard and is available here:
> 
> 	git://git.kernel.org/pub/scm/network/nfc/neard.git
> 
> There are a few test script in it that will let you read and write NFC
> tags, and do some other things.  We can add some more tests to that set
> as we go.
> 

Yeah, I packaged that for Alpine Linux / postmarketOS.
"nfctool" also comes from "neard" as far as I can tell :)

I think I also played with the Neard test scripts a bit at some point,
and managed to read some NFC tag thing inside an old Yubikey NEO
that I found, but didn't really know what else to do.

> > I would be happy to do some more testing if someone has something useful
> > that can be tested. However, I guess ideally we would have someone who
> > actually uses Linux NFC actively for some real application. :)
> 
> Ideally, you should have some NFC tags of various types.  Types 2, 3,
> 4A, 4B, and 5 tags are supported.  Peer-to-peer mode is supported too
> so you should be able to transfer data from one of your phones to the
> other over NFC (and do a BT hand-over, if you're interested).
> 

I guess this is where I kind of lack hardware as well at the moment,
I don't have any programmable NFC tags at the moment (although I guess
those should be quite cheap). I might play with the peer-to-peer mode
a bit when I find time.

> Note that the specified range for NFC is only 4 cm and poor antenna
> design, etc. means that the actual range is usually much less (e.g.,
> they amost have to touch).  Also note that there are timing constraints
> so you may need to make the scheduling priority of the interrupt thread
> of your NFC driver real-time.
> 

Yeah I noticed, always need to search for a while to find the right spot
on the phone. :)

Stephan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Testing wanted for Linux NFC subsystem
  2021-05-13 15:37         ` Stephan Gerhold
@ 2021-05-14 15:23           ` Mark Greer
  2021-05-18 19:18             ` Vincent Knecht
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Greer @ 2021-05-14 15:23 UTC (permalink / raw)
  To: Stephan Gerhold
  Cc: Mark Greer, Frieder Schrempf, Krzysztof Kozlowski,
	Jakub Kicinski, David S. Miller, netdev, linux-kernel, linux-nfc,
	Alex Blasche, phone-devel

On Thu, May 13, 2021 at 05:37:19PM +0200, Stephan Gerhold wrote:
> On Thu, May 13, 2021 at 07:48:55AM -0700, Mark Greer wrote:
> > On Thu, May 13, 2021 at 01:49:53PM +0200, Stephan Gerhold wrote:
> > > I have a couple of "recycled" smartphones running mainline Linux
> > > and some of them do have NFC chips. I have two with NXP PN547
> > > (supported by nxp,nxp-nci-i2c), one with Samsung S3FWRN5
> > > (samsung,s3fwrn5-i2c) and even one with Broadcom BCM2079x I think
> > > (this one does not have a driver for the Linux NFC subsystem sadly).
> > > 
> > > +Cc phone-devel@vger.kernel.org, in case other people there are
> > > interested in NFC :)
> > > 
> > > The NXP/Samsung ones seems to work just fine. However, since there are
> > > barely any userspace tools making use of Linux NFC all my testing so far
> > > was limited to polling for devices with "nfctool" and being happy enough
> > > when it realizes that I hold some NFC tag close to the device. :S
> > 
> > There is a user-level daemon that is the counterpart for the in-kernel
> > NFC subsystem.  It is called neard and is available here:
> > 
> > 	git://git.kernel.org/pub/scm/network/nfc/neard.git
> > 
> > There are a few test script in it that will let you read and write NFC
> > tags, and do some other things.  We can add some more tests to that set
> > as we go.
> > 
> 
> Yeah, I packaged that for Alpine Linux / postmarketOS.
> "nfctool" also comes from "neard" as far as I can tell :)
> 
> I think I also played with the Neard test scripts a bit at some point,
> and managed to read some NFC tag thing inside an old Yubikey NEO
> that I found, but didn't really know what else to do.

Yeah, there isn't a whole lot you can do but beyond reading/writing
tags and peer-to-peer, there are things like Bluetooth and Wifi
handover, Android Application Record support, and at least some
support for Secure Engine.

> > > I would be happy to do some more testing if someone has something useful
> > > that can be tested. However, I guess ideally we would have someone who
> > > actually uses Linux NFC actively for some real application. :)
> > 
> > Ideally, you should have some NFC tags of various types.  Types 2, 3,
> > 4A, 4B, and 5 tags are supported.  Peer-to-peer mode is supported too

I should have mentioned type 1 as well but I don't have the hardware
to test it.

> > so you should be able to transfer data from one of your phones to the
> > other over NFC (and do a BT hand-over, if you're interested).
> > 
> 
> I guess this is where I kind of lack hardware as well at the moment,
> I don't have any programmable NFC tags at the moment (although I guess
> those should be quite cheap). I might play with the peer-to-peer mode
> a bit when I find time.

Please let me/us know how it goes.

> > Note that the specified range for NFC is only 4 cm and poor antenna
> > design, etc. means that the actual range is usually much less (e.g.,
> > they amost have to touch).  Also note that there are timing constraints
> > so you may need to make the scheduling priority of the interrupt thread
> > of your NFC driver real-time.
> > 
> 
> Yeah I noticed, always need to search for a while to find the right spot
> on the phone. :)

Yeah, it can be an Easter egg hunt on many phones.  :)

Mark
--

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Testing wanted for Linux NFC subsystem
  2021-05-14 15:23           ` Mark Greer
@ 2021-05-18 19:18             ` Vincent Knecht
  0 siblings, 0 replies; 5+ messages in thread
From: Vincent Knecht @ 2021-05-18 19:18 UTC (permalink / raw)
  To: Mark Greer, Stephan Gerhold
  Cc: Frieder Schrempf, Krzysztof Kozlowski, Jakub Kicinski,
	David S. Miller, netdev, linux-kernel, linux-nfc, Alex Blasche,
	phone-devel

Le vendredi 14 mai 2021 à 08:23 -0700, Mark Greer a écrit :
> On Thu, May 13, 2021 at 05:37:19PM +0200, Stephan Gerhold wrote:
> > On Thu, May 13, 2021 at 07:48:55AM -0700, Mark Greer wrote:
> > > On Thu, May 13, 2021 at 01:49:53PM +0200, Stephan Gerhold wrote:
> > > > I have a couple of "recycled" smartphones running mainline Linux
> > > > and some of them do have NFC chips. I have two with NXP PN547
> > > > (supported by nxp,nxp-nci-i2c), one with Samsung S3FWRN5
> > > > (samsung,s3fwrn5-i2c) and even one with Broadcom BCM2079x I think
> > > > (this one does not have a driver for the Linux NFC subsystem sadly).
> > > > 
> > > > +Cc phone-devel@vger.kernel.org, in case other people there are
> > > > interested in NFC :)
> > > > 
> > > > The NXP/Samsung ones seems to work just fine. However, since there are
> > > > barely any userspace tools making use of Linux NFC all my testing so far
> > > > was limited to polling for devices with "nfctool" and being happy enough
> > > > when it realizes that I hold some NFC tag close to the device. :S
> > > 
> > > There is a user-level daemon that is the counterpart for the in-kernel
> > > NFC subsystem.  It is called neard and is available here:
> > > 
> > >         git://git.kernel.org/pub/scm/network/nfc/neard.git
> > > 
> > > There are a few test script in it that will let you read and write NFC
> > > tags, and do some other things.  We can add some more tests to that set
> > > as we go.
> > > 
> > 
> > Yeah, I packaged that for Alpine Linux / postmarketOS.
> > "nfctool" also comes from "neard" as far as I can tell :)
> > 
> > I think I also played with the Neard test scripts a bit at some point,
> > and managed to read some NFC tag thing inside an old Yubikey NEO
> > that I found, but didn't really know what else to do.
> 
> Yeah, there isn't a whole lot you can do but beyond reading/writing
> tags and peer-to-peer, there are things like Bluetooth and Wifi
> handover, Android Application Record support, and at least some
> support for Secure Engine.

Could sniffing and injection work, like for wifi ?
Guess that depends on specific chip drivers, and libpcap support for sniffing ?

https://wiki.wireshark.org/SampleCaptures#Radio_Frequency_Identification_.28RFID.29.2C_and_Near-Field_Communication_.28NFC.29

https://code.google.com/archive/p/wireshark-nfc/





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-18 19:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210512144319.30852-1-krzysztof.kozlowski@canonical.com>
     [not found] ` <14e78a9a-ed1a-9d7d-b854-db6d811f4622@kontron.de>
     [not found]   ` <20210512170135.GB222094@animalcreek.com>
2021-05-13 11:49     ` Testing wanted for Linux NFC subsystem Stephan Gerhold
2021-05-13 14:48       ` Mark Greer
2021-05-13 15:37         ` Stephan Gerhold
2021-05-14 15:23           ` Mark Greer
2021-05-18 19:18             ` Vincent Knecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).