Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.
This repository was archived by the owner on May 24, 2023. It is now read-only.

Error: TypeError: must be str, not bytes #4

@twinwood

Description

@twinwood

I am using Python 3.6, when I trying to run the code, error below appear, please help. TQ

Traceback (most recent call last):

File "", line 1, in
runfile('E:/PN532-HSU-master/readmifare.py', wdir='E:/PN532-HSU-master')

File "C:\Users\Lam\Anaconda3\envs\tfgpu36v2\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 668, in runfile
execfile(filename, namespace)

File "C:\Users\Lam\Anaconda3\envs\tfgpu36v2\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "E:/PN532-HSU-master/readmifare.py", line 41, in
pn532.SAM_configuration()

File "E:\PN532-HSU-master\PN532.py", line 333, in SAM_configuration
self.call_function(PN532_COMMAND_SAMCONFIGURATION, params=[0x01, 0x14, 0x01])

File "E:\PN532-HSU-master\PN532.py", line 297, in call_function
if not self._write_frame(data):

File "E:\PN532-HSU-master\PN532.py", line 204, in _write_frame
ack = self._ack_wait(1000)

File "E:\PN532-HSU-master\PN532.py", line 216, in _ack_wait
rx_info += self.ser.read(self.ser.inWaiting())

TypeError: must be str, not bytes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions