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

rfcat not sending #845

Closed
BlessYou656 opened this issue Mar 5, 2021 · 2 comments · Fixed by #846
Closed

rfcat not sending #845

BlessYou656 opened this issue Mar 5, 2021 · 2 comments · Fixed by #846

Comments

@BlessYou656
Copy link

Hi,i have problem with send data via rfcat.Rfcat now use bytes instead of string to send data..Here is error:

TypeError Traceback (most recent call last)
/usr/local/lib/python3.9/dist-packages/rflib/init.py in
----> 1 d.RFxmit('\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa')

/usr/local/lib/python3.9/dist-packages/rflib/chipcon_nic.py in RFxmit(self, data, repeat, offset)
1125 waitlen += repeat * (len(data) - offset)
1126 wait = USB_TX_WAIT * ((old_div(waitlen, RF_MAX_TX_BLOCK)) + 1)
-> 1127 self.send(APP_NIC, NIC_XMIT, b"%s" % struct.pack("<HHH",len(data),repeat,offset)+data, wait=wait)
1128
1129 def RFxmitLong(self, data, doencoding=True):

TypeError: can't concat str to bytes

sending command shoul be: d.RFxmit(b'\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa')

Thanks for help

@andynoack
Copy link
Collaborator

Please try the rfcat_fix branch. Currently I do not have the rfcat environment configured, so this is just the fix you suggested. Can you confirm?

@BlessYou656
Copy link
Author

Now its working thanks

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

Successfully merging a pull request may close this issue.

2 participants