zoukankan      html  css  js  c++  java
  • libnfc安装在ubuntu

    1,preinstall
    $ sudo apt-get install libusb-dev libpcsclite-dev
    $ sudo apt-get install libusb-0.1-4 libpcsclite1 libccid pcscd libftdi1

    https://libnfc.googlecode.com/files/libnfc-1.7.0.tar.bz2
    bunzip2 libnfc-1.7.0.tar.bz2
    tar -xvf libnfc-1.7.0.tar
    cd libnfc-1.7.0
    ./configure --with-drivers=all
    make clean all
    make
    sudo make install

    sudo cp /usr/local/lib/libnfc.so.5 /usr/lib/libnfc.so.5

    sudo mkdir /usr/local/etc/nfc
    sudo cp libnfc.conf.sample /usr/local/etc/nfc/libnfc.conf
    sudo sed -i 's/#device.name = "microBuilder.eu"/device.name = "imon.bamboo"/' /usr/local/etc/nfc/libnfc.conf
    sudo sed -i 's/#device.connstring = "pn532_uart:/dev/ttyUSB0"/device.connstring = "pn532_uart:/dev/ttyUSB1"/' /usr/local/etc/nfc/libnfc.conf


    #install MPSSE libraries for NFC and ADXL
    sudo apt-get install libftdi-dev
    sudo wget http://$SERVER/linux/libmpsse-1.3.tar.gz
    sudo tar -xvzf libmpsse-1.3.tar.gz
    cd libmpsse-1.3/src
    ./configure --disable-python && make && sudo make install #install without python

    参考解压各种文件命令:


    unzip -d acr122u ACR122U_driver_Lnx_Mac10.5_10.6_1.02_P.zip
    tar -jxvf acsccid-1.0.2.tar.bz2
    tar xfvz libnfc-1.4.2.tar.gz

    查看usb连接:

    root@user-virtual-machine:~# dmesg | grep tty
    [ 0.000000] console [tty0] enabled
    [ 2.747496] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
    [ 2.846135] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
    [ 3.180059] 00:0a: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
    [ 3.203997] 00:0b: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
    [393056.899004] usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0
    [393056.901434] usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB1

    配置libnfc:

    /usr/local/etc/nfc/libnfc.conf

    libnfc-1.7.0-rc7/libnfc/drivers/pn532_uart.c

    :const uint8_t pn532_wakeup_preamble[] = { 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };


    /lib/udev/rules.d/69-libmtp.rules

    ATTR{idVendor}=="046d", GOTO="libmtp_rules_end" 添加这一行



    sudo nfc-poll

     nfc-list

  • 相关阅读:
    17. Letter Combinations of a Phone Number
    16. 3Sum Closest
    15. 3Sum
    14. Longest Common Prefix
    13. Roman to Integer
    12. Integer to Roman
    11. Container With Most Water
    10. Regular Expression Matching
    9. Palindrome Number
    8. String to Integer (atoi)
  • 原文地址:https://www.cnblogs.com/bigben0123/p/3101142.html
Copyright © 2011-2022 走看看