Protect Tag
Hello! I followed your steps to put a password on my NTAG213, but it returns this error and I blocked my NTAG213.7
/usr/bin/python2.7 /home/rafael/
Traceback (most recent call last):
File "/home/
clf.
File "/home/
result = self._rdwr_
File "/home/
if options[
File "/home/
clean = tag.protect(
File "/home/
return super(NTAG21x, self).protect(
File "/home/
password, read_protect, protect_from)
File "/home/
status = self._protect(
File "/home/
return self._protect_
File "/home/
self.target = self.clf.
AttributeError: can't set attribute
This is my program:
import nfc
def connected(tag):
clean = tag.protect(
if clean:
print ("Clean correct")
else:
print ("clean incorrect")
clf = nfc.Contactless
clf.connect(
clf.close()
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- nfcpy Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Stephen Tiedemann
- Solved:
- 2016-09-23
- Last query:
- 2016-09-23
- Last reply:
- 2016-09-23
Rafael (hibara94) said : | #1 |
And wing when you delete the password gives me this error:
/usr/bin/python2.7 /home/rafael/
Traceback (most recent call last):
File "/home/
clf.
File "/home/
result = self._rdwr_
File "/home/
if options[
File "/home/
tag.
File "/home/
return super(NTAG21x, self).authentic
File "/home/
self.
File "/home/
rsp = self.transceive
TypeError: transceive() got an unexpected keyword argument 'rlen'
This is my other program:
import nfc
def connected(tag):
tag.
tag.protect("")
clf = nfc.Contactless
clf.connect(
clf.close()
This looks like a bug that was fixed with release 0.11.1 (https:/
Rafael (hibara94) said : | #3 |
OK thank you very much. But once you assign a password to my NTAG213, it is read-only, as it could do to write or format your content??
thanks !!
Rafael (hibara94) said : | #4 |
And I can remove the password so you can be writeable. Thanks
I hope you remember the password you've used as it has been correctly set and the failure was only afterwards. You should be able to use that password to authenticate and then change to whatever else.
Rafael (hibara94) said : | #6 |
Yes, but my question is how to remove the password, because if I set tag.protect ( "") establishes me as an empty string password, but not me delete the password. How could it be?
Thanks.
Sorry, my fault. Protect with an empty string sets the default password (which is b"\xFF\
tag.protect("", protect_from=255)
Rafael (hibara94) said : | #8 |
Ok, but still does not completely remove the password, I show my program:
import nfc
import nfc.ndef
def connected(tag):
correct = tag.authenticat
if correct:
print "correct"
correct2 = tag.protect("", protect_from=255)
if correct2:
print "correct 2"
else:
print "incorrect 2"
else:
print "incorrect"
clf = nfc.Contactless
clf.connect(
clf.close()
The results:
correct
correct 2
Process finished with exit code 0
Until here all right, but is this happening now:
My program:
import nfc
import nfc.ndef
def connected(tag):
print(" readable = %s" % ("no", "yes")[
print(" writeable = %s" % ("no", "yes")[
print(" capacity = %d byte" % tag.ndef.capacity)
print(" message = %d byte" % tag.ndef.length)
print tag.ndef.
clf = nfc.Contactless
clf.connect(
clf.close()
The results:
readable = yes
writeable = no
capacity = 142 byte
message = 13 byte
record 1
type = 'urn:nfc:wkt:U'
name = ''
data = '\x00probando'
We can see that is still ¡¡¡writable = no!!! As I can do to make it writable?
Thanks
This should do the trick:
tag.authenticat
tag.format()
Rafael (hibara94) said : | #10 |
No, if I format TAG, I delete the content, but writeable = no. I want to be writeable = yes
readable = yes
writeable = no
capacity = 142 byte
message = 0 byte
record 1
type = ''
name = ''
data = ''
Uups, I forgot that Type 3 Tags store the write protection flags in one-time-
Rafael (hibara94) said : | #12 |
Thanks Stephen Tiedemann, that solved my question.