GithubHelp home page GithubHelp logo

jcrona / gr-nfc Goto Github PK

View Code? Open in Web Editor NEW
36.0 36.0 15.0 211 KB

GNURadio blocks allowing decode NFC transactions

License: GNU General Public License v3.0

CMake 72.63% C 0.88% C++ 18.25% Python 8.25%

gr-nfc's People

Contributors

jcrona avatar laykel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gr-nfc's Issues

AttributeError: module 'nfc' has no attribute 'modified_miller_decoder'

Generating: '/home/rlab-dell-2/Documents/GNU radio/top_block.py'

Executing: /usr/bin/python3 -u /home/rlab-dell-2/Documents/GNU radio/top_block.py

Warning: failed to XInitThreads()
gr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.8.1.0
built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp
Using device #0 Realtek RTL2838UHIDIR SN: 00000001
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Enabled direct sampling mode, input 2
Exact sample rate is: 2000000.052982 Hz
Traceback (most recent call last):
File "/home/rlab-dell-2/Documents/GNU radio/top_block.py", line 172, in
main()
File "/home/rlab-dell-2/Documents/GNU radio/top_block.py", line 150, in main
tb = top_block_cls()
File "/home/rlab-dell-2/Documents/GNU radio/top_block.py", line 93, in init
self.nfc_modified_miller_decoder_0 = nfc.modified_miller_decoder(samp_rate)
AttributeError: module 'nfc' has no attribute 'modified_miller_decoder'

Done (return code 1)

image

Have any ever encounter this error : module 'nfc' has no attribute 'modified_miller_decoder'.
it is from the auto generate gnu-radio python(graph flow) nmae top_block.py

AttributeError: 'module' object has no attribute 'modified_miller_decoder'

OS: Arch Linux

$ uname -a
Linux mbae-3 4.15.4-1-ARCH #1 SMP PREEMPT Sat Feb 17 16:01:38 UTC 2018 x86_64 GNU/Linux

My installation commands:

$ sudo pacman -S swig
$ git clone [email protected]:jcrona/gr-nfc.git
$ mkdir gr-nfc/build
$ cd gr-nfc/build
$ cmake ../
$ make
$ sudo make install
$ sudo ldconfig

Error message when running gnuradio rebuild from picture in blog post

Generating: '/home/marble/temp/top_block.py'

Generating: '/home/marble/temp/top_block.py'

Executing: /usr/bin/python2 -u /home/marble/temp/top_block.py

linux; GNU C++ version 7.2.1 20171224; Boost_106600; UHD_003.010.002.000-0-unknown

gr-osmosdr 0.1.4 (0.1.4) gnuradio 3.7.11
built-in source types: file fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy 
Using rad1o with firmware git-24e7908 
Traceback (most recent call last):
  File "/home/marble/temp/top_block.py", line 255, in <module>
    main()
  File "/home/marble/temp/top_block.py", line 243, in main
    tb = top_block_cls()
  File "/home/marble/temp/top_block.py", line 176, in __init__
    self.nfc_modified_miller_decoder_0 = nfc.modified_miller_decoder(samp_rate)
AttributeError: 'module' object has no attribute 'modified_miller_decoder'

Typo in `modified_miller_decoder_impl.cc`: comma operator in define

Lines 28 through 31 currently state:

#define MILLER_PULSE_DURATION	2,5 // us
#define MILLER_PULSE_WIDTH	((d_sample_rate/1000000) * MILLER_PULSE_DURATION)
#define MILLER_PULSE_WIDTH_MIN	(MILLER_PULSE_WIDTH - MILLER_PULSE_WIDTH/2)
#define MILLER_PULSE_WIDTH_MAX	(MILLER_PULSE_WIDTH + MILLER_PULSE_WIDTH/2)

I suspect the first of those lines contains a typo. That is, 2,5 should rather say 2.5. This is a small error that doesn't impact the program very much (fixing it on my side didn't change the output), but it's still quite wrong in the way it functions.

Indeed, the comma operator in C/C++ is quite sneaky sometimes and in this scenario we end up with the following expansion: MILLER_PULSE_WIDTH = ((d_sample_rate/1000000) * 2, 5), which is strictly equivalent to: MILLER_PULSE_WIDTH = 5.

This is because the comma operator evaluates the left operand and then doesn't return it. This has the potential to cause big problems but here, luckily, it doesn't. The only effect (as seen by defining DEBUG in the code and looking at the output) is to set the constants as such:

MILLER_PULSE_WIDTH_MIN = 3
MILLER_PULSE_WIDTH_MAX = 7

instead of as such (which is probably what was intended by the author):

MILLER_PULSE_WIDTH_MIN = 2.5
MILLER_PULSE_WIDTH_MAX = 7.5

As stated, this is probably inconsequential for most usages, but I would still gladly propose a fix in a soon to arrive Pull Request.

Frame format NFC- and tag to machine decoding

Hi Sir,

Trust you are doing great.

I found your blog really insightful for a research I am currently working on.

I had a problem understanding the portion that describes how you modified the block to match the frame format.

Would be glad to get further explanation on that portion.

Also, I noticed some python files on your GitHub page concerning decoding the tag response to the machine using

Manchester coding. Is there a step by step documentation for that.

Thank you.

No version for GNU Radio 3.8

The module doesn't currently support GR 3.8.

If I find the time, I might try to propose a port with the help of this guide, but if someone more experienced or with more time wants to do it, please go ahead.

I will keep you posted on whether I get the time.

Best regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.