PN532 in Emulation mode Authentication failure - mifare

I am trying to configure PN532 in to Mifare emulation mode. I am using "ACR122U" reader for Mifare Emulation and "OMNIKEY CardMan 5x21-CL" as reader. I configured ACR122 as Mifare successfully. I got ATR and UID which i have set through program. But while i am trying to load key to the reader, exception has occured. In ACR122U, there is no SAM module inside. Anyone can help me about whether it is possible to configure and emulate PN532 (NFC Chip inside ACR122U) as complete MIFARE 1K without SAM.
Please help...

Configuring the PN532 to emulate a MIFARE Classic card is nearly impossible I'm sorry to say. I have been trying it the last couple weeks and had no luck. The Datasheet clearly states that it can do this but it is not clear exactly how. I do know however that a SAM is not required for MIFARE 1K emulation.
Not sure why you mentioned ATR as that is a ISO 14443-4 command, and MIFARE Classic supports only up to 14443-3 (i.e it is not a Transport Protocol Enabled tag). You may have meant to say SENS_RES and SEL_RES?
Using the PN532 command TgInitAsTarget you can emulate a Mifare Classic card by specifying the SENS_RES and SEL_RES and UID, and that always works if all you want to do is emulate a UID, however emulating a MIFARE 1K that can actually respond to MIFARE authentication an read commands is another story. Basically, when a PN532 is emulating a MIFARE 1K and receives the MIFARE authentication command (0x60 0xXX, where XX=block number) the response that you should send as an emulated card is a 4 byte random number which the initiator should then encrypt using the key provided and the internal PN532 CRYPTO1 cipher. The problem is that the initiator never responds to that random number challenge and the emulation always fails there.
I am doing this with just a PN532 so I can command the PN532 directly, I'm not sure what API is provided with the ACR122U can do but if you can's access the actual PN532 commands then that will make your life even more difficult potentially.
CHeck out my post on libnfc.org for additional details of what I've tried:
http://www.libnfc.org/community/topic/277/nfcemulatetag/
If you managed to get it to work, I would love to hear more about what you did.
BEST OF LUCK!

Related

Documentation for FTDI low level commands for Synchronous FIFO

I am wishing to use the Sync FIFO interface of a FT232H on a custom board from python on a RaspberryPi. I would use PyFTDI, but PyFTDI doesn't implement the Sync FIFO interface mode. The constant for the Sync FIFO mode is defined in PyFTDI but never used. I plan on accessing Sync FIFO by using PyUSB directly with PyFTDI as a reference. However as PyFTDI doesn't ever use the Sync FIFO mode, I don't know what FTDI commands are used for the mode on the USB endpoints. The documentation I have been able to find from FTDI tell how to use the proprietary library as opposed to the low level command structure actually sent to the chip. I have done a bit of searching, but FTDI provides many documents and it is a bit of information overload.
Does anyone know where the documentation is which covers the low level command codes and arguments which are sent to the FTDI USB end points? I am assuming the authors of PyFTDI were referencing something besides wire sniffing.
According to their knowledge base FTDI provides an API document under an NDA for some circumstances.
In some circumstances, it may be desirable to develop a custom driver for an exotic operating system or an embedded system. In these circumstances, an API document may be obtained from FTDI under NDA to allow driver development for FTDI devices. To request a copy of the API document, please contact FTDI Support support1#ftdichip.com.

How to connect SSD1309 OLED with STM32 via i2c

I have a 1.5 OLED SSD1309 display with ZIF connector. Based on a interfacing scheme from the seller I made a scheme that should connect this display with STM32 based MCU via i2c. Interfacing scheme is based on AT MCU, so I wonder can this apply to any type of MCU?
Here is the link I used as a reference: https://www.buydisplay.com/download/interfacing/ER-OLED015-2_Interfacing.pdf (I also don't understand this VCC +12.5V, do I have to make add 3V to 12.5V regulator based circuit as well?)
I also found this: https://github.com/afiskon/stm32-ssd1306
It says that this library is working with SSD1309 as well, so I would use it for this if all this above make sense and can work.
Does someone have experience with this type of connecting OLED displays with MCU, because almost all I could find are already soldered boards with display on it.

open wifi Captive portal w/only local net (no internet/wan)?

I am trying to set up a wireless 'test' box to use on a private club (11,000 acres). The initial tests won't need anything fancy, it will just be checking the visibility of a hotspot from a high-point in the middle of the property. But if it proves to have good visibility, later tests will be (hopefully) promoted by the club and made aware to members. I would like to set up a captive portal to redirect them to a comments page where they can post a quick message if they were able to connect and hopefully say what they think about the idea.
This is going to be going on a raspberry pi running debian wheezy. So the less overhead the better.
Most of the examples I see online of captive portal are based on having an internet connection and/or a NAT scheme set up. I just need a hotspot and a single web-page for these promotional tests. If possible, I would like to trigger any devices capable to suggest or otherwise open a browser to go to the promotional landing page. It would also be nice if some kind of dns masquerading or other mechanism was in place to redirect all browser traffic in the event their device doesn't support a pop-up.
Any help is appreciated.
EDIT 2022/06/05: With further testing and packet sniffing, it turned out that the android versions in question hard code the ip of the google server used for the 'online check' (8.8.8.8). When on an arbitrary IP, it's not looking for requests to 8.8.8.8 and thus it doesn't grab the online-check and won't redirect. If you set the AP to use this address (when not internet connected), the pop-up will usually trigger.
However, this solution is not ideal. Hacking the IP stack to specifically grab that request to 8.8.8.8 is outside my wheelhouse of knowledge. If anyone knows how to do this or has another potential solution, I would be interested in hearing it.

CANopen profile for multiple interfaces card

I want to build a microcontroller-based CAN node card that has interfaces like UART, SPI and I²C, to which connect different peripherals and interfaces, like say a EIA-485 counter or a SPI digital I/O expander. I'd like to define a profile for the card that's flexible enough to adapt to any possible configuration and include any device that can be connected to such node card. Since CANopen profiles seem to be pretty rigid, I researched CANopen virtual devices but that seems not the answer either.
Is there a standard for such functionality or I'm sailing unknown waters?
You are sailing unknown waters unless you consider a CANopen bootloader a possible solution. There is no existing device profile that fits your criteria. CANopen is remarkably flexible but arbitrary extensibility is beyond it.
You could export the registers of your microcontroller 1:1 through the object dictionary and issue interrupts through PDOs. It would certainly be a fun exercise if just a bit impractical.
From the CAN in Automation website:
CANopen generic I/O modules are standardized in the CiA 401 device
profile specification. The profile supports a granularity of 1-, 8-,
16-, and 32-bit for digital I/Os and a resolution of 1-, 2-, and
4-byte for analog I/Os.
However, it may be easier to implement a custom device, based on the general CiA 301 CANopen application layer and communication profile standard. You could implement a set of general purpose IOCTL functions using Manucturer objects (2000h to 5FFFh) and possibly use SDO Block Transfer to 'stream' data to specific OD objects representing connected device end points.
You will need to consider that, even with a bitrate of 1 Mbps at the physical layer, the CANopen protocol is never going to be able to keep up with a USB2 HS device when it comes to streaming data! Also bear in mind that if you use PDOs for 'real-time' exchange of OD values there will be a significant lag and that the time quantum for PDO exchange is in the order of 25 ms or greater.
The final consideration is what CANopen master are you going to use? If the product is to be commercially available then you will need to specify and document your EDS very carefully (maybe even providing an OPC or similar API).

Receive BLE beacon with Raspberry Pi

I am looking for a tutorial on how to receive an iBeacon signal with a Raspberry PI.
What I am trying to do is monitor a zone of our warehouse. Once a beacon that advertises specific information enters that zone the rasperry Pi should send a REST request to a webservice.
I've found this: Can RaspberryPi with BLE Dongle detect iBeacons? but it does not quite answer my question. Does anyone know of a good tutorial how to implement something like the above?
(the easier the better, I am not exactly a programming whiz ... :-) )
Cheers,
Vitus
My company is working on tools to make doing this easier, but we do not have a tutorial available yet. We are the ones who posted the information you referenced: Can RaspberryPi with BLE Dongle detect iBeacons?
If you want to call a ReST service when an iBeacon is detected, you can use it with the detection script we provided. As the detection script runs, it writes out the identifiers of any iBeacons it sees. What you would need to do is write a separate program that reads in the output of this script, looks for identifiers that it cares about, then calls the ReST service when it sees them.
Connecting two programs by taking the standard output of one and reading it with another is a very common programming technique on Linux. You would run our program with ibeacon_scan -b and it would output the information below:
2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6 1 6 -59
E2C56DB5-DFFB-48D2-B060-D0F5A71096E0 6 9 -55
74278BDA-B644-4520-8F0C-720EAF059935 0 73 -50
You would then read this information in with your second program line by line, parsing out the three part identifier from each line. And then call your ReST Service if the identifiers match the iBeacon you are looking for.
The specifics of how you do this depend on what programming language you want to use. You could do it in C, Ruby, Perl, Java or any other language supported by the Raspberry Pi. If you have a client library for your ReST service, you probably want to build this program in whatever language that client library uses.
Full disclosure: I am Chief Engineer for Radius Networks.