How to start interacting with the ACR122U-A9 NFC reader? - nfc

I'm a junior PHP/JavaScript/HTML developer, recently hired by a company that makes photobooths. I had never worked in a Ubuntu system before this. This I find relevant because I think that for this reason I might be skipping an obvious step or something like that.
One of the projects I have to work on is adding a NFC device on the photobooths, so the user can just tap the area with their phone and get the pictures they just took. Sounds easy.
A previous employee bought an ACR122U-A9 device, that connects via USB, but they weren't able to make it work. I took the device and followed every single tutorial I have find out and I had no luck either.
What I have achieved after installing a great deal of things and blindly following tutorials is just this:
If I open a terminal, and type "pcsc_scan" it detects the device and it kind of "works", reading the cards if I tap them. I get some hexadecimal codes and some blue text that doesn't say anything to me. And while I do this I can't even type in the terminal so I cannot do anything at all to it.
What I actually want is to know how to make the computer speak to the NFC device, not listen to it. Well, I guess it has to listen to know when to send info.
I think that I'm missing something very obvious, because every tutorial I find just explains what kind of code you need to write to do X thing or how to make the device emulate a card or things like that... But I think I need something WAY more basic:
How do I even start to work and interacting with it?
Info that might be relevant:
I didn't specify how I got to the point that writing "pcsc_scan" makes something because A) I've done so many tutorials and different things that I don't remember what part of what I did accomplished this and B) I'd like to start from scratch in order to understand what am I doing.
I'm working on a Ubuntu 17.10 machine, but the final product will be working under Windows (different versions of it depending on the Photobooth)
Our photobooths work with a web-api in localhost. Everything is either PHP, JavaScript, CSS, or HTML. In the end I will need a way for the device to get the info it needs from one of these languages (if possible)
I'm still struggling with Ubuntu. Everything you try to install or interact with in this OS is done via commands that I don't completely understand and I repeat from random internet tutorials or forums like a parrot. Fixing this is not part of the question, I'll eventually learn this, but I think it might be useful to know that I might not even know some things that should be obvious or basic about it.

Related

More accurate identification of running applications on Mac OS

By using runningApplications of NSWorkspace, it is possible to get a list of running apps on Mac OS as NSRunningApplication objects, and from this get additional information like what application is in the foreground.
It is possible to identify the running application using their name (localizedName), but I'm sure that can be spoofed by rogue applications. Other things like bundleIdentifier seem better, but I believe that too could be spoofed.
I would imagine that pretty much all of the metadata could be spoofed for applications outside of the public app store, but for any apps gotten from the app store things like bundleIdentifier should be safe ways to identify an app, right?
If we include arbitrary apps that someone downloads from the Internet, is there any better way to identify an app as to filter out rogue apps? I realize that there may be no solution that has no drawbacks, but looking for a best-effort attempt.
As you mention, all of these things can be pretty easily spoofed. Having written a product that does exactly what you're describing professionally, the solution is relatively straightforward: fingerprint every version of every popular app into a massive database, and then fingerprint each app you discover on the machine and look them up in your database. When you discover an app you've never seen before, flag it for adding to your database.
Maintaining that database is very large and ongoing endeavor. That's where most of the value of the product is. The agent code is not that complicated. The up-to-date database is what customers pay for. It's a pretty hard space to get into.
You're correct that you can verify signatures to make sure that things downloaded from MAS or part of the OS are what they claim to be. This will get you started, but isn't nearly enough; there's just so much that doesn't come from MAS.
The other headache is that you can see what "apps" are currently running in NSWorkspace, but it's pretty messy what it means. A lot of things that you don't think of as "apps" show up in runningApplications, like MobileDeviceUpdater and nbagent. On the other hand, things like mysqld aren't. Fingerprinting from runningApplications can miss things that aren't in that list, or malicious apps could lie about their bundle path to make themselves look legitimate. You can use tools like lsof to see what files a process really has open, but it gets more and more complicated.
Best of luck; it's a deep rabbit hole with dozens of corner cases, and very little documentation.

Interfacing PS2 keyboard

I recently received from a friend a cash register keyboard, however, it was just that, no drivers, no documentation, nothing, I've never did anything like this, so any directions would be really appreciated, the circuit is fairly simple
I tried reading the inscriptions on the controller, but, it is a little unreadable, all that I could make out of it was "__BC2489_-2_", I can also read "1213", "05 CHI" and "___615626", I assume the first one to be the model, however, I can't seem to find anything with just this partial reading.
Contacting the manufacturer I was able to get the hex codes sent by the keyboard, which can be found here.
Connecting it makes no device-connected sound as Windows usually does, does this means something may be wrong with it, or Windows just doesn't recognize it as there are no drivers? To be fair, I don't even remember if it makes any noise at all for PS/2 devices. So, how should I proceed now? Is there a way to simply read from the PS/2 port or anything similar?
If you want to use a PS 2 Keyboard you have to plug it in before booting the OS. It’s not Plug and Play able. (It won’t make a special sound)

I want to make an arcade stick USB driver for OS X

I have an arcade stick for my PS3 that I used for fighting games. I rarely play them anymore so I figured I'd plug the stick into my Mac and see if I could get some arcade gaming going on my computer. I have tried this on Windows too and it seems like there are no drivers for either OS.
Now, I'm not one to be disappointed and just give up like that. I thought that this would be the perfect opportunity to attempt to write a driver. How hard can it be? All I need is a plan.
The Plan
I want a driver that supports every function of the arcade stick. This includes:
Eight face buttons
Analog stick
Lock/direction switches (the latter is three steps and the former is two steps)
Home/Turbo buttons
Two side buttons
I was searching around for stuff that could help me accomplish this but I don't really know where to start. I want a tool that can scan a USB port for signals coming from a connected device and from those signals decipher what input it corresponds to. I then want to map that input programmatically to an OS X API for game controllers, put it all in a package and voilá: driver!
Maybe this only works in my head. For starters I can't find this magic USB tool that I'm looking for. I tried USB Prober and it detects my arcade stick but I can't get any log entries when I press buttons on the stick. (Yes, I installed the log kext)
Most of the search results were regarding scanning USB network interfaces. I don't think it's what I'm after.
I also got this idea that maybe USB devices behave like old school Unix devices and I'd be able to do something like cat /dev/usb/port3 and get some good data but I have not found anything like that.
I just don't know where to start. I found some Apple documentation on USB devices but I don't even know if the stick is HID compliant.
Right now I'm mostly looking at libusb and skimming through documentation.
I haven't really dealt with this kind of project before so any ideas and tips are welcome.
Thanks!
Most PS3 controllers are just HID devices, so you should be able to work from that direction.
A much simpler route, and less personally satisfying I suppose, would be to just grab one of the USB->Mac game controller applications and run with that.
I've used USB Overdrive for years and it always seems to work well.

Protecting Ruby Code

I'm developing a commercial project on an ARM based embedded board with a custom Linux kernel on it, using Ruby. Target workspace of the project and the device is a closed-environment, no ethernet, inernet, I/O devices etc... I want to protect my code/program so that; it'll only work on the specific machines I let (so; people cant just copy and paste my code/program on to their embedded boards and run it w/o permission). This can probably done with the machine's MAC address tho; I don't have any experience on the subject. I guess, just a simple if(device.MACAddr == "XX:XX....XX") wouldn't be depandable (not to mention people can just easily delete the check from my code). I can't use some ruby obfuscators, which I found thru google, beacuse; the device doesnt run ruby-external-C-libraries or such stuff, only pure ruby code.
So; what are your suggestions, what type of approach should I take?
you can't really protect it, its hard enough protecting native code! and even then that basically fails if someone really wants to copy the software.
basically do very little if anything to secure it, its mostly wasted time and effort
This is isomorphic to the problem of DRM. You're giving a person both a lock and the key to that lock, and trying to stop that person from using the key in a way you don't like.
Therefore, I suggest using the same methods that other DRM users do: put your terms in the license, and sue them if they violate it. You need to use the law to enforce the other terms of the license, anyway.

Tracking Useful Information

What do the clever programmers here do to keep track of handy programming tricks and useful information they pick up over their many years of experience? Things like useful compiler arguments, IDE short-cuts, clever code snippets, etc.
I sometimes find myself frustrated when looking up something that I used to know a year or two ago. My IE favorites probably represent a good chunk of the Internet in the late 1990s, so clearly that isn't effective (at least for me). Or am I just getting old?
So.. what do you do?
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
Two Things I do:
I blog about it - this allows me to go back and search my own blog.
We use the code snippet feature in Visual Studio.
Cheers.
I use:
Google Notebook - I take notes for projects, books I'm reading, etc
Delicious + Firefox plug in - Every time I see a good page I mark it.
Windows Journal (in tablet pc) - When I need to draw something and then copy/cut/paste it. I have more distractions here, the web is always very close :)
Small Moleskine paper notebook - Its always with me.
Big paper notebook - When I need more space to write and less distractions.
Obviously these are for all useful information, not just for snippets or tips and tricks.
Why not set up a Wiki?
If you are on windows, i know that ScrewTurn wiki is pretty simple to deploy on a desktop/laptop. No database to fuss around with.
Blog about it.
One of the nice side-effects of blogging is that if you use a sensible categorization or tagging system, it's quite easy to search for stuff within your blog. The fact that you wrote about it also makes it easier to remember problems you have encountered before ("hey, I blogged about that!").
That's a great benefit aside from, of course, being able to share this information publicly so that others might be able to find your solution to a particular problem using Google.
A number of people I know swear by Google Notebook
I send them to my gmail account, that way I have them where ever I go, and they can be put into appropriate folders for later.
I second the blog about it technique...even Jeff said that's a major reason he blogs.
Also, regarding the wiki idea, if you set one up at work, be sure to encourage your coworkers to do the same. When someone finds something of interest they can just write a little "article" explaining what it is and how to do it... that way, not only are your own things easily available and quickly searchable, but you'll often find out things you never knew from other people in your group. That way it benefits everyone not just you.
I agree with emailing, the wiki and the blog. Emailing is the most useful. If you can't use GMail and you're on windows, install a desktop search utility (Windows search, Google Desktop, Copernic, etc)
I also like to jot it into a textfile and save it in my documents folder. Whatever desktop search utility you use will be able to find it easily. e.g.
//print spool stop.notes.txt
If the printer spooler stops, start it again by
- Services > Provision Networks > Restart Service
tags: printer provision no printer spooler cannot print remote desktop
Subscribe in Google Reader and then search later.
At my last place of work they wouldn't let me set up a wiki or anything - so I just made various word documents full of tips and instructions and gave that to my successor when I left.
Now though I'd use a private wiki, or maybe a blog.
For many years I've kept a Word doc named Knowledgebase.doc that contains all my notes with a decent table of contents. I like to keep everything in one searchable doc.
I use a sync tool to make sure the file is copied to all the machines I want it on.
I use TiddlyWiki stored in my DropBox account. Although, recently, Evernote is getting my atention; it has a really useful feature: you send a twitter direct message to evernote user (myen) and it adds a note with your message (a really quick way to add notes or URL's for post-processing). Imagine, you can use a command-line twitter client to create notes! (or any twitter client). I really like this feature.

Resources