Code Monkey home page Code Monkey logo

rfidler's Introduction

RFIDler

Firmware

The 'firmware' directory contains code for the dev platform(s). Currently that is Pic32, but we will add a new section if and when required.

Hardware

A fully built RFIDler board can be purchased here: http://rfidiot.org/#Hardware

Pic32

The main microcontroller is a Microchip PIC32MX795F512L

Software Build environment

The project was developed in Mplab-X IDE V3.20 under Linux, but can also be built under Windows & Mac:

The compiler used was the free version of Microchip's XC32 V1.40:

USB stack and peripheral support is provided by [Microchip Application Library v2013-06-15] (http://www.microchip.com/pagehandler/en-us/devtools/mla/archives.html):

  • Linux
    • Install to /opt/microchip/microchip_solutions_v2013-06-15/
    • Note: if the installer fails to start, try adding the run-time option '--mode text'
  • Windows
    • Install to installer default location
  • Mac
    • Install to installer default location

and [PIC32 Peripheral Library] (http://www.microchip.com/SWLibraryWeb/product.aspx?product=PIC32%20Peripheral%20Library):

  • Linux
    • Install to /opt/microchip/xc32/v1.40
  • Windows
    • Install to installer default location
  • Mac
    • Install to installer default location

Bootloader

When the Bootloader is running the RFIDler appears on the USB as a HID, and waits for new RFIDler firmware to install in Flash memory. There are several ways of entering the Bootloader, see "Loading new Firmware" section below.

USB HID Bootloader is provided by the UBW32 project

For convenience, a copy of the bootloader hex and an MPLAB hex load project is provided in firmware/Pic32/HIDBoot_MX795_Hex_Load.X

The Bootloader client, mphidflash, runs on Linux/Mac/Windows and transmits & verifies the new firmware.

https://github.com/AdamLaurie/mphidflash

Notes

mphidflash v1.3 has some known bugs where for some ROM binaries programming fails and a verification error is reported.

If you hit this problem check for a newer release of mphidflash. Pre-compiled executables for all platforms are available here

Software Build

Install packages as above.

Clone this repo to your local hard disk.

  1. Start MPLAB X IDE
  2. Choose File/Open Project/
  3. Browse to RFIDler.X and click 'Open Project'

Windows

If you are running Windows, you will need to change the default Linux library to the local Windows version:

UPDATE NEEDED TO THIS SECTION!

(There are bugs in MPLAB X and GNU make such that paths to libraries containing spaces are not always processed correctly, and the default install path on Windows contains spaces so making the copy is the simplest solution.)

Mac OS X

If you are running Mac OS X, you will need to change the default Linux library to the local Mac version:

UPDATE NEEDED TO THIS SECTION!

Connections

The device can be powered via the USB port, and, if connected to a PC, will provide a management CLI/API via USB-Serial CDC at 115200 baud (8 bit, No Parity, 1 Stop Bit, No Handshaking/Flow Control).

The CLI/API is also accessible via 3.3v or 5v UART on pins RG7 (UART3 RX) and RG8 (UART3 TX), also at 115200 baud.

When you connect with USB for the first time, you may need to perform some configuration steps:

Linux

Create a rule file for UDEV to allow non-root access to the file, and also disable modem manager access. An appropriate file can be found in the MPLAB project under the "Linux Support" tab. Copy this file to /etc/udev/rules.d and run sudo udevadm control --reload-rules

This file can also be found in this repo at: linux-support/71-rfidler-lf-cdc-blacklist.rules

Windows

Windows drivers can be found in the 'Windows Driver' tab of the MPLAB project

To connect, any serial terminal emulator should work, but we recommend:

  • Linux: minicom (sudo apt-get install minicom)
  • Windows: PuTTY
  • Mac OS X: SerialTools (free from the App Store)

Example linux connection:

minicom -D /dev/ttyACM1 -b 115200 

Once connected, hit <ENTER> to see the HELP screen and switch to CLI mode, or send commands to remain in API mode.

In API mode, all commands are as per CLI mode, and will be ACK'd by a single '.' or NACK'd by '!' if command fails or '?' if it is not recognised. Other output is command dependant.

Loading new Firmware

Enter bootloader mode

  • either from the menu (BL)
  • or by holding down button BOOTLOADER while simultaneously
    • plugging in the USB cable
    • or pressing the 'RESET' button.

LED6 and LED5 will show stable orange light to confirm bootloader mode has been entered.

#~/tools/mphidflash-1.6/binaries/mphidflash-1.6-linux-64 -r -w firmware/Pic32/RFIDler.X/dist/debug/production/RFIDler.X.production.hex 
USB HID device found: 503808 bytes free
Device family: PIC32

Erasing...
Writing hex file 'RFIDler.X.production.hex':......[...removed for brevity...]
Verifying:.... [...removed for brevity...]
Resetting device...

You can verify the flashing via version

*RFIDler> version
0071-beta

Linux:

dmesg should show the following:

generic-usb 0003:04D8:003C.0003: hiddev0,hidraw1: USB HID v1.11 Device [Microchip Technology Inc. USB HID Bootloader] on usb-0000:00:1d.0-1.1.2.1/input0

To flash the code, cd to the top of the repo and run:

	mphidflash -r -w firmware/Pic32/RFIDler.X/dist/default/production/RFIDler.X.production.hex

The device will be programmed and will then reboot. dmesg should show:

usb 2-1.1.2.1: USB disconnect, device number 19
usb 2-1.1.2.1: new full speed USB device number 20 using ehci_hcd
cdc_acm 2-1.1.2.1:1.0: This device cannot do calls on its own. It is not a modem.
cdc_acm 2-1.1.2.1:1.0: ttyACM3: USB ACM device

Windows

???

Mac OS X

Install mphidflash from source

Option 1, v1.6:

curl https://github.com/AdamLaurie/mphidflash/blob/master/dist/mphidflash-1.6-src.tar.gz > mphidflash1-6.tar.gz
mkdir mphidflash1-6
tar -zxvf mphidflash1-6.tar.gz -C mphidflash1-6
cd mphidflash1-6
mkdir binaries
sudo make install64

Option 2, latest:

git clone https://github.com/AdamLaurie/mphidflash.git
cd mphidflash
sudo make install64

Flash device

cd #RFIDler repo
mphidflash -r -w firmware/Pic32/RFIDler.X/dist/debug/production/RFIDler.X.production.hex

rfidler's People

Contributors

adamlaurie avatar aketzu avatar antrorsum avatar bryant1410 avatar coolacid avatar evilpete avatar georgemarshall avatar holiman avatar jmaxxz avatar rtfcode avatar tonynaggs avatar zacfranken 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  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  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  avatar

Watchers

 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rfidler's Issues

Consider dropping the Non-Commercial clause in the license?

Would you consider dropping the Non-Commercial clause for the hardware portion of this project?

It looks like the Kickstarter wrapped up in 2015 which, as of this writing, is now over 4 years ago. I don't see much activity on the forums and, as far as I can tell, a pre-built boards are only available if people contact Aperture Labs directly.

Allowing for commercial use would free others to use, create and update the hardware design files without needing to contact you explicitly. Open source hardware projects could also use your hardware design files without having to re-invent them were you to drop the Non-Commercial clause.

Hitag2 Emulation

Hi,
There was talk at some point on the forum about implementing Hitag2 Emulation, is there any progress on this, or any way I can get involved with its implementation?

Thanks,
Dan

Binary download of latest firmware

Would be nice, so more casual users don't need to set up a whole build environment.

Apologies if this already exists and I just haven't found it?

Hitag2 SNIFF-PWM list stored

Hi,
I have problem with SNIFF-PWM list stored option, becouse when I do procedure on my RFIDler:
SET TAG HITAG2
SNIFF-PWM C
AUTORUN SNIFF-PWM S
SAVE
• Power RFIDler from USB battery
• RFIDler antenna on RWD, present tag (n times)
and comands "SNIFF-PWM L" return:
"No HiTag2 PWM stored"
where is the problem?

"unsigned" driver (Windows 7 AMD64)

win7 64bit complains about unsigned driver, even though catalog file is present.

Maybe the INF was edited after signing the CAT ?
Edit: just recognized, its the mchpcdc.cat and customized mchpcdc.inf from the MLA, actually not a really signed driver package. Maybe the CAT should simply be removed.

Unitialized variables bugs

Unitialized variables bugs up to commit 426dfcd

  • firmware\Pic32\RFIDler.X\src\indala.c => indala64_get_uid => Uninitialized variable: bits
    • Code extract:
    //Parity check, count bits
    int bits;
    int i, n;
    for (i=0; i<16; i++)
    {
        if (response[i] >= 'a' && response[i] <= 'f')
            n = response[i] - ('a' - 10);
        else if (response[i] >= '0' && response[i] <= '9')
            n = response[i] - '0';
        else if (response[i] >= 'A' && response[i] <= 'F')
            n = response[i] - ('A' - 10);
        else
            return FALSE;
        bits += __builtin_popcount(n);
    }
  • firmware\Pic32\RFIDler.X\src\sniff.c => do_sniff_pwm => Uninitialized variable: count
    This bug is critical as it can lead to very long loop depending on count value which is uninitialized
    • Code extract:
void do_sniff_pwm(unsigned int mingap, unsigned minpulse, unsigned int mesg_gap, BOOL nfcmode)
{
    BOOL            toggle;
    BOOL            abort= FALSE;
    unsigned long   count, pulsecount= 0L;
    unsigned int    len, gaps[DETECT_BUFFER_SIZE], pulses[DETECT_BUFFER_SIZE];

    // make sure local clock isn't running & switch to input
    stop_HW_clock();

    COIL_MODE_READER();
    READER_CLOCK_ENABLE_OFF(LOW);

    toggle= SNIFFER_COIL;

    // reader/tag mode - wait for 100 ticks to make sure we're settled
    if (!nfcmode)
    {
        toggle= SNIFFER_COIL;
        while(count < 100L)
        {
            while(SNIFFER_COIL == toggle)
                // check for user abort
                if(get_user_abort())
                    return;
            ++count;
            toggle= !toggle;
        }
    }
...

Win7 - installing python, gives error "missing parentheses in call to"

C:\Projects\RFIDler\python>setup.py install
running install
running build
running build_py
creating build
creating build\lib
creating build\lib\RFIDler
copying RFIDler__init__.py -> build\lib\RFIDler
running build_scripts
creating build\scripts-3.4
copying rfidler.py -> build\scripts-3.4
running install_lib
creating C:\Python34\Lib\site-packages\RFIDler
copying build\lib\RFIDler__init__.py -> C:\Python34\Lib\site-packages\RFIDler
byte-compiling C:\Python34\Lib\site-packages\RFIDler__init__.py to init.cpython-34.pyc
File "C:\Python34\Lib\site-packages\RFIDler__init__.py", line 159
print '\r\n>>>', tosend,
^
SyntaxError: Missing parentheses in call to 'print'

running install_scripts
copying build\scripts-3.4\rfidler.py -> C:\Python34\Scripts
running install_egg_info
Writing C:\Python34\Lib\site-packages\RFIDler-1.0-py3.4.egg-info

C:\Projects\RFIDler\python>setup.py install

'rfidler.py frequency' never returns

$ rfidler.py /dev/ttyACM0 frequency
sending 'FREQUENCY'

This command never returns from rfidler.py. I see the results in minicom, but it breaks rfidler.command() somewhere.

linux udev symlink not working [Dave Sexton]

A permanent 'user-friendly' device name is created for RFIDler in the /etc/udev/rules.d/71-rfidler-lf-cdc-blacklist.rules file. However, it ends up pointing to the raw usb device, not the CDC interface:

$ ls -l /dev/ttyACM3
crw-rw-rw- 1 root dialout 166, 3 Jun 13 14:24 /dev/ttyACM3
$ ls -l /dev/RFIDler
lrwxrwxrwx 1 root root 15 Jun 13 14:24 /dev/RFIDler -> bus/usb/002/056

and opening this device in a serial terminal doesn't work.

Include link to udev in README.md

Hello,
This may be a fairly simple issue, but after twenty minutes of searching and a lot of different leads, I'm unable to locate the simplest thing: the udev rules described in the readme for Linux users.

You should link to the official udev rules and/or just include it in the repo.

Thanks.

Ubuntu 14.04 Software Build Fails

I have already copied the correct file to /etc/udev/rules.d and reloaded the rules. When I attempt to build the file in MPLABX my build fails with the following error. Using a clean install.

make[2]: *** No rule to make target '/opt/microchip/xc32/v1.33/pic32mx/lib/libmchp_peripheral_32MX795F512L.a', needed by 'dist/debug/production/RFIDler.X.production.hex'. Stop.

Remarks/Improvement about PCB routing and components for future revision

I have just checked quickly the board (with Eagle) and following stuff could be improved for final version (about USB remarks 1/2/3 even if only USB 2.0FS is used and those rules are required for USB 2.0HS it is good to apply them) :

  1. For USB: Route the differential pairs together.
  2. For USB: USB signal shall be not under Crystal and to shall be as far as possible from quartz(X1).
  3. For USB: Route the differential pairs (D+/D-) over unbroken ground planes or floods and with same size if possible.
  4. Add a ferrite bead on USB VBUS (especially for analog part to avoid parastic problems) like Murata BLM21PG221SN1D FERRITE CHIP 220 OHM 2000MA 0805.
  5. Add ESD protection on USB D+/D- (something like NXP PRTR5V0U2X DIODE ESD PROTECTION SOT143B)
  6. Some PIC VDD pins have no decoupling capacitor (at least 100nF).
  7. Decoupling capacitor(10nF) on VBUS/Power part C25,C28,C27,C26 are too far from the VDD pin (they shall be as close as possible).
  8. VBUS (5V) signal have some wire less than 8mil could be problematic for voltage drop (R=710mOhm) and with an Imax of 0.64A and a total len of about 286mm (computed with Eagle6 length-freq-ri.ulp).
  9. 3V3 signal have some wire less than 8mil could be problematic for voltage drop (R=1257mOhm) and with an Imax of 0.64A and a total len of about 506mm (computed with Eagle6 length-freq-ri.ulp).
  10. 3V3 power from C18 to R23 could be simplified to avoid parallel 3V3 wire.
  11. Components placement could be optimized to avoid all those vias and maybe a switch to 4 layers will be a must for noise immunity (especially for analog part) for a simplified routing and smaller board.
  12. You should apply some standard Eagle DRU rules for cheap PCB on the board like http://www.seeedstudio.com/document/rar/SeeedStudio_2layer_DRU_no_angle_20140221.rar or ftp://imall.iteadstudio.com/PCBs/ITEADstudio_DRC.zip as there is lot of clearance problems.

Scotty, I need power!

I just received my Beta RFIDler in the post; while it looks all nice and green, there are no chips on the board and no place to provide power (well, I suppose I could hook up my car battery and try to jump start it.)

Hopefully the circuitry will not be arriving in a 2nd box, as my soldering skills might not be up to snuff. While you did say beta....

(Oh, it'd be awesome to have an addr to send things to, or a place for feedback; if this is the right place that's fine, but even a mention of that in the FAQ would rock.)

image

new crack2,3,4 usage

hi
at first I apologize for my bad english
Special thanks to Mr AdamLaurie for his great RFIDlr device
after weeks finally I could compile mcu and windows projects,but there is no usage of hitag2crack folder and its cracks source file!!
although Author(Kevin Sheldrakein) describes how to use these cracks by RFIDlr device in README file
is any one there who try that cracks ?
best regards

autotag stalls at HDX

It just stalls and never finishes

Current version: 0187-beta

RFIDler> version
0187-beta
RFIDler> autotag
  ASKRAW: 9<removed data>
  FSK1RAW: 
  FSK2RAW: 
  PSK1RAW: 
  PSK2RAW: 
  PSK3RAW: 
  HITAG1: 
  HITAG2: 
  EM4X02: 
  Q5: 
  HID26: 
  INDALA64: 
  INDALA224: 
  UNIQUE: 
  FDXB: 
  T55X7: 
  AWID26: 
  EM4X05: 
  TAMAGOTCHI: 
  HDX: 

flashing firmware on windows

The "Windows" section in README.MD for flashing a new firmware version still only consists of "???".
The "Windows" and "MacOS" section of the "firmware" wiki page on Github are empty.

There is some information in the forum at
http://rfidler.org/index.php?p=/discussion/11/firmware-update-on-windows-using-hidbootloader-from-microchip-library-for-applications
but it does not tell where to get HIDBootloader.exe

There does not seem to be named releases on Github and no obvious version.h or similar file to look up what a current version number should look like.
So I have no idea if "0114-beta" the board tells me is terribly outdated or current and
no way of updating the firmware to the latest file from firmware/Pic32/RFIDler.X/dist/debug/production/RFIDler.X.production.hex

Complete No0B Here! How do I get this stuff working!?!

I am at a complete loss as to how I am supposed to get my RFIDler working. Is there a way to just download a program that has all I need to get it working? The instructions in the read me are confusing and beyond my expertise. I need a guide for beginners!

Error Using Plotter Tutorial: "Failed: No clock running!"

I think a step is missing from the plotter wiki tutorial:

$ rfidler.py /dev/ttyACM0 'set tag askraw' 'potset h 255' PLOT 500
sending 'SET TAG ASKRAW'
sending 'POTSET H 255'
Failed: No clock running!
$ rfidler.py /dev/ttyACM0 'VERSION'
sending 'VERSION'
0003-alpha

This is for a Beta tester unit -- are we supposed to update the firmware on the RFIDler, or is the firmware that shipped sufficient?

Thanks,

-Josh

XC32 v1.32 flashing verify failure

Building with XC32 v1.32 completes OK, but flashing causes a verify failure. I've corrected all the issues I can see in procdefs.ld and also ensured we are linking against the v1.32 peripheral library, but to no avail...

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.