Git Product home page Git Product logo

libmsr's People

Stargazers

 avatar  avatar

Watchers

 avatar

libmsr's Issues

Spiting out FFFFFF

I am trying to read a bart ticket and it spits out only FFFFFFFFFFFFFF in RAW 
mode. Other programs spit out some sensible data. However, not complete data.

Original issue reported on code.google.com by [email protected] on 4 Sep 2010 at 6:17

Support MSR605

I've just bought a MSR605 and hoped libmsr would work "out of the box" since 
the claim is: "Etekcity® MSR605, compatible with MSR206 completely."
See 
http://www.rakuten.com/prod/etekcity-usb-msr605-msr206-magnetic-stripe-card-read
er-writer-encoder/247985207.html

Some stuff seems to work (despite error messages):

$ ./msr-quick-raw-dumper
no device specified, defaulting to /dev/ttyUSB0
Communications test passed.
Device Model: MSR-206-3
Putting the writer to Lo-Co mode...
It appears that the reader did not switch to Lo-Co mode.Running ram test...
It appears that the RAM test failed
Communications test passed.
Ready to do a raw read. Please slide a card.
track0: a2 8e [...]
track1: d5 73 [...]
track2: 
Ready to do a raw read. Please slide a card.

Some stuff doesn't work:


$ ./msr /dev/ttyUSB0
Communications test passed.
Device Model: MSR-206-3
Putting the writer to Lo-Co mode...
It appears that the reader did not switch to Lo-Co mode.Attempting sensor test 
-- please slide a card...
It appears that the sensor did not sense a magnetic card.
Running ram test...
It appears that the RAM test failed
Preparing reader for reading...
Ready to read an ISO formatted card. Please slide a card.
msr: get start delimiter failed: Resource temporarily unavailable

$ ./makstripe-quick-clone
no device specified, defaulting to /dev/ttyUSB0
Ready to populate MAKStripe buffer...
Sending reset command: ?
We expect: MSUSB CI.270209
[just hangs]

I've attached the manual. There's also a SDK (code in C for Windows).

What can I do to help getting this model fully supported? Thanks!

Original issue reported on code.google.com by [email protected] on 16 Jan 2015 at 10:45

Attachments:

MSR206 raw write


I have a problem writing raw data to my cards. I get wring data on the card. 
The written data it's not random, it's deterministic, so I thought about an 
encoding error or so.

I used a Windows program which came with the writer which allowed me to write 
the card successfully. So the problem had to be with the library. I sniffed the 
communications using wireshark-usb and I saw that the write command triggered 
by the Windows software was sending different data but in the end, after a 
write, I could read my data perfectly.

So the conclusion is: in order to write the cards correctly I have to send the 
data reversing the bits in each byte. I don't know if that's a problem, an 
issue or a feature, but the fact it's that libmsr won't write my cards.

I've patched it so the write operation takes care to reverse the bitorder.

Is anyone interested in my patch? I can upload it if you want.

Thank you for the source BTW!

Original issue reported on code.google.com by [email protected] on 15 Feb 2012 at 10:29

msr_fwrev() fails to reasd response

The return value test of msr_cmd (fd, MSR_CMD_FWREV) in msr_fwrev is incorrect. 
The function aborts on a on a non-zero return (error value should be -1) and 
does not read the firmware revision response. Subsequent commands will read 
data from this response first, making them unable to read their own responses. 
This seems to have been introduced in r52.

Original issue reported on code.google.com by [email protected] on 25 Feb 2012 at 2:19

Output in binary

I have put together the code (below) to get the card data in raw binary form, 
but i get incorrect results by referencing to a known Start Sentinel.
Changing the bits per character gives me different results.
Any idea whats wrong?

#include <sys/types.h>

#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <strings.h>
#include <termios.h>
#include <err.h>
#include <string.h>

#include "libmsr.h"
#include "serialio.h"
#include "msr206.h"

int
dumpbits (uint8_t * buf, int len)
{
    int     bytes, i;
    for (bytes = 0; bytes < len; bytes++) {
        /* for (i = 0; i < 8; i++) { */
        for (i = 7; i > -1; i--) {
            if (buf[bytes] & (1 << i))
                printf("1");
            else
                printf("0");
        }
    }
    printf ("\n");
    return (0);
}

int main(int argc, char * argv[])
{
    int fd = -1;
    int serial;
    msr_tracks_t tracks;
    int i;

    /* Default device selection per platform */
#ifdef __linux__ 
    char *device = "/dev/ttyUSB0";
#else
    char *device = "/dev/cuaU0";
#endif

    if (argv[1] != NULL)
        device = argv[1];
    else
        printf ("no device specified, defaulting to %s\n", device);

    serial = serial_open (device, &fd, MSR_BLOCKING, MSR_BAUD);

    if (serial == -1) {
        err(1, "Serial open of %s failed", device);
        exit(1);
    }

    /* Prepare the reader with a reset */
    msr_init (fd);

    /* Get the device model */
    msr_model (fd);
    /* Get the firmware version information */
    msr_fwrev (fd);

    /* Set the reader into Lo-Co mode */
    msr_set_lo_co (fd);

    /* Prepare the reader with a reset */
    msr_init (fd);

    msr_set_bpi(fd, 210);
    msr_init (fd);
    msr_set_bpc(fd, 6, 6, 6);
    msr_zeros (fd);

do {
    bzero ((char *)&tracks, sizeof(tracks));

    for (i = 0; i < MSR_MAX_TRACKS; i++)
        tracks.msr_tracks[i].msr_tk_len = MSR_MAX_TRACK_LEN;

    printf("Ready to do a raw read. Please slide a card.\n");
    msr_raw_read (fd, &tracks);

        /* If we didn't get any data, don't do this next part */
    for (i = 0; i < MSR_MAX_TRACKS; i++) {
        printf("track%d [%d]: ", i, tracks.msr_tracks[i].msr_tk_len);
        dumpbits (tracks.msr_tracks[i].msr_tk_data,
            tracks.msr_tracks[i].msr_tk_len);
    }

} while (1);

    /* We're finished */
    serial_close (fd);
    exit(0);
}


Original issue reported on code.google.com by [email protected] on 27 Jun 2010 at 2:07

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.