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

spi.transfert type error #23

Open
hawaii-do opened this issue Feb 21, 2019 · 12 comments
Open

spi.transfert type error #23

hawaii-do opened this issue Feb 21, 2019 · 12 comments

Comments

@hawaii-do
Copy link

the command spi.transfer((2,15)) return the error
TypeError: function takes exactly 2 arguments (1 given)

This command used to work before recent commit.

@Highlife93
Copy link

same problem here. No working with MFRC522 because only one argument is given.

@lthiery
Copy link
Owner

lthiery commented Feb 21, 2019 via email

@saphirblanc
Copy link

@lthiery hi! since the latest commits, the library https://github.com/mxgxw/MFRC522-python is not working anymore as the tag is not even detected :/ (tried with multiple raspberry pi 3, multiple cables, RFID readers...)

@steaward
Copy link

@saphirblanc that repo is no longer being maintained. It's best to use pi-rc522

@gasseritsolutions
Copy link

Same problem:
TypeError: function takes exactly 2 arguments (1 given)

How can I get the previous version it worked perfect with this one?

@lthiery
Copy link
Owner

lthiery commented Mar 11, 2019

Hi all,
I merged in a PR that @naleefer made, since at inspection, it looks like some great work.

I didn't notice the API change, but I'd guess that removing one set of parenthesis might resolve it? That seems like a general style improvement to me if that's the case.

I apologize for not having more time to maintain this project; I'm trying to add collaborators as they bring in PRs. As such, I've invited @naleefer as a collaborator so hopefully that improves support from this project.

All the best,
Louis

@naleefer
Copy link
Collaborator

Hi all,

To follow up on this, there has been an API change, but it is rather minor. Previously the module maintained the spi device properties behind the scenes in global variables, which prevented the module from using both chip select pins in the same process. On top of this, there were some memory handling issues that prevented repeatedly using the spi.openSPI(...) and spi.closeSPI() to get around this.

The changes are documented in the updated README.md, along with examples of the new usage. spi.openSPI(...) returns a handle that should be preserved for later calls to spi.transfer(..) and spi.closeSPI().

For the MFRC522 case, I also forked that repository and made an update to reflect the new API for this library: MFRC522.

Best,
N

@jeffersonkr
Copy link

if you guys dont wanna redo all work with your code just rollback to this commit, 8cce26b

@simonneutert
Copy link

@saphirblanc you. saved. my. day. ❤️

@chibunna
Copy link

@saphirblanc you. saved. my. day. ❤️

Have you been able to resolve this issue? and if so could you kindly explain how you did it? I'm still struggling with getting the RFID to read/write the tags

@captainreed
Copy link

This problem has been solved on this fork of the repo: https://github.com/mxgxw/MFRC522-python

@nbx3
Copy link

nbx3 commented Nov 28, 2020

This problem has been solved on this fork of the repo: https://github.com/mxgxw/MFRC522-python

Either you linked to the wrong repo or the fix has been rolled back because i still get this error

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