Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck in RFST_IDLE state after power on #2

Open
fredldotme opened this issue Sep 28, 2020 · 16 comments
Open

Stuck in RFST_IDLE state after power on #2

fredldotme opened this issue Sep 28, 2020 · 16 comments

Comments

@fredldotme
Copy link

fredldotme commented Sep 28, 2020

When powering on the nfcd adapter based on the pn54x plugin the plugin resets NCI and transitions the NCI state to RFST_IDLE but doesn't enter discovery mode thereafter as opposed to binder-based devices.

Log: https://paste.ubuntu.com/p/r5kxkXt3Ds/

EDIT: I did power on the adapter using: dbus-send --system --dest=org.neard --print-reply /nfc0 org.freedesktop.DBus.Properties.Set string:org.neard.Adapter string:Powered variant:boolean:true

Device: Sony Xperia X
OS: Ubuntu Touch
Kernel: 4.4
Arch: arm64

@monich
Copy link
Collaborator

monich commented Sep 28, 2020

Which version of nfcd are you running?

@fredldotme
Copy link
Author

Version 1.0.41, slightly patched to allow building without libdbusaccess and disabling the dbus_log plugin: https://github.com/ubports/nfcd/commits/xenial_-_android9_-_nfcd

@monich
Copy link
Collaborator

monich commented Sep 28, 2020

Correct me if I'm wrong - you don't have anything like nfcd-mce-plugin installed, and plan to use neard D-Bus interface to switch NFC on, right?

@fredldotme
Copy link
Author

That's the current plan, yes. We don't use mce on UT.

@fredldotme
Copy link
Author

fredldotme commented Sep 28, 2020

What we could do though is integrate it into our repowerd which takes care of screen on/off states, using a UT specific plugin.

@monich
Copy link
Collaborator

monich commented Sep 28, 2020

Try also dbus-send --system --dest=org.neard --print-reply /nfc0 org.neard.Adapter.StartPollLoop string:Initiator in addition to setting the Powered property.

@fredldotme
Copy link
Author

Ok, that transitions it to the discovery state, but no tags are detected, not even those unsupported ones from other bug reports

@monich
Copy link
Collaborator

monich commented Sep 28, 2020

This should make that StartPollLoop thing unnecessary.

@fredldotme
Copy link
Author

fredldotme commented Sep 30, 2020

Works as advertised, will test if NFC tags are actually detected now (probably not) in a few hours. Will report back.

@fredldotme
Copy link
Author

fredldotme commented Sep 30, 2020

Ok, so neither supported tags (Jolla 1 backcover Other Half with empty NDEF entry) nor unsupported ones trigger anything in nfcd.
I guess technically the bug is closed but it still doesn't seem to work properly atm, at least on UT/kernel 4.4.

@monich
Copy link
Collaborator

monich commented Sep 30, 2020

Is it not working because of mer-hybris/libncicore#21 or is it something else?

@fredldotme
Copy link
Author

I doubt it would work without reverting the change but I can try later just to be sure.

@fredldotme
Copy link
Author

Is it possible that on SailfishOS the Android adaptation does load firmware to the device? Could you please verify that via dmesg | grep pn54?

@monich
Copy link
Collaborator

monich commented Oct 18, 2020

This plugin doesn't load any firmware, it just opens the device and talks more or less directly to the NFC chip. I guess firmware loading somehow needs to be done before booting up Sailfish OS (or before starting nfcd).

Binder plugin, on the other hand, may cause the firmware to be loaded to the chip, if it's done by the Android service which the plugin is talking to (and that's very likely to happen if all necessary files are present).

@fredldotme
Copy link
Author

I don't have an Xperia X with SailfishOS ready atm, so I can't test it myself. So does the kernel driver claim firmware to be uploaded by the adaptation?

@monich
Copy link
Collaborator

monich commented Jan 7, 2021

Actually, #3 fixes one of the scenarios when pn54x I/O could get stuck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants