What's new

winteriscoming

Champion
Joined
Feb 16, 2016
Messages
1,409
Reaction score
1,109
Location
Indiana, US
I wonder if it would have the same effect on a non-erasable thermal print. I suppose it might have to do with how dirty the print head is. But, given that it's done after a long period of time (i.e. over an hour and likely spanning between multiple play sessions if card were ejected in between), I wonder if it produces a noticeable difference. Say it had printed once and I ejected my card and see it has a star. Am I going to notice if I insert it to play at a later point and it prints over top of that star at some point before I eject and look at it again? Even if it made it darker, I'm probably not going to know unless I get another star next to it that's lighter. If that was the intention, I would think a better method would have been to print a star outline and then fill it in on a later print to indicate progress. Hard to say what the intention was.

I've got a physical reader, but am not able to run any tests for this any time soon.
 

stj

Grand Master
Joined
May 4, 2017
Messages
1,170
Reaction score
453
Location
England
the 2 screwdriver ajusted resistors near the heatsink
 

chunksin

Professional
Joined
Jan 21, 2017
Messages
126
Reaction score
285
Location
Birmingham, UK
I'm just not good enough to generate two stars at the same time! Will keep practising but for now I can add the stars from the print packets together and generate them on the card via an integer easily enough.

While the card reader emulator scripts work really well and the result of I don't know how may hours of work (massive thanks to all involved!), one thing that's bugged me is that you always have to start the script with either a saved card file or a new blank one. I've been thinking how I could modify the scripts for a scenario where someone for example has an ID cab and is auto netbooting the game for convenience, they will need to have prechosen their card as the game needs the script running when it boots. Better to let the game boot into attract mode normally and act as if it has no card inserted and allow the player to decide which card to use when they start playing.

So the idea I've got is to run it more like an original cab and allow a card file to be virtually inserted and accepted by the reader at the insert card screen, this way you could use several methods to trigger a card insertion, you could choose via the netbooter web interface in real time that copies a file into a drop folder for processing or maybe using an NFC card to either hold the card save data (although write back might be a challenge, rest it on top of the reader/writer until after the save process is complete?) or simply be linked via it's UID to a card save file on the netbooter so a tap of the card would load the respective save file. If the insert card timer runs down, default to the option to purchase a card and create an auto generated file to save to.

I've managed to get the code working using a polling queue and a drop folder, working out the correct statuses to assign for the card added on the fly was tricky but it seems to be quite happy. Next challenge is to hook up an NFC reader and see if I can trigger a card insertion using that, I have zero experience with the technology so it will be a nice challenge!

Attached is a work in progress, needs a bit more work on file handling to make sure files are where they should be at the right times but I can start this with no filename specified, then at the insert card screen drop a valid save file into the activecard folder during the 10 second countdown and the emulator script picks it up, loads it in and saves it at the end of play.

Edit: I really should have read the previous posts here, I only skimmed looking for technical nuggets of info - looks like this discussion happened about 4 years ago! LLCP and Web NFC look promising
 

Attachments

  • id2cardemutest.txt
    39.6 KB · Views: 6
Last edited:

winteriscoming

Champion
Joined
Feb 16, 2016
Messages
1,409
Reaction score
1,109
Location
Indiana, US
allow a card file to be virtually inserted
This is how I'm doing it in the frontend I put together. I have implemented user profiles and individual card files per profile, so you load up your profile and select your card that will be virtually inserted when the game asks for it. Though I've only got that working for wmmt 1-3dx+ at this point. I also manage card expirations and renewals.
 

chunksin

Professional
Joined
Jan 21, 2017
Messages
126
Reaction score
285
Location
Birmingham, UK
Should really move away from reply attacks like these scripts use.
I agree but I'm afraid my programming skills are not up to that!

I've updated the ID script to handle the classic start up mode and the on demand drop folder method when a filename is not provided, the id_card_data scripts referred to are generating my php card data based on the game type. I should be able to condense it down to a single script for the emulator and one for processing the print data. I've tested it pretty extensively with ID, ID2 and ID3 and I think I've covered most scenarios, once a card is saved and ejected, the data is cleared so it's ready to accept another card. Card names are generated automatically in a very simple format at the moment, I'll add a card management function into the web front end for backup and deletions.
 

Attachments

  • idcardemu.txt
    41.8 KB · Views: 6
Last edited:

chunksin

Professional
Joined
Jan 21, 2017
Messages
126
Reaction score
285
Location
Birmingham, UK
I picked up a cheap NFC card reader/writer last week along with some NTAG215 cards for testing integration with the card emulator, I was hoping to use nfcpy/pynfc but I found out afterwards that the reader I bought was specifically listed as not recommended! It's an ACR122U which is probably the cheapest USB reader you can buy and is fully supported on raspbian buster. I've managed to get the card data written to the card and read back in the correct formats, I'm using a python library called pyscard which has lots of functionality but is pretty low level and really only handles the communications side, I had to dig into the card reader manual for the commands and build them on the fly. It certainly looks like it's going to work and write backs are handled with no problem, you can rest the card on the reader during play and my script makes the light flash red and beep three times when the card is being written to and the script will also wait for the card to be present if it's been removed before saving. Screenshot below shows the binary card data and a sample php file I generated for the card printing. I'll add a check card function in the web frontend so you can scan a card and it will show a printed version in the browser, the card data can either be saved on the card only or to both the Pi and the card.

The end game with be if you have an ID/ID2/ID3 cab you can power on the cab, auto netboot the game, the card emulator script will start up and you can swipe your NFC card with your save data on without having to interact with the Pi at all :D I picked up a Triforce last week so will start working on F-Zero AX card printing once the ID scripts are all complete and tested.

1632214422802.png
 
Last edited:

djsheep

Multi Boyz Overlord
Immortal
Multi Boyz
Joined
May 20, 2016
Messages
5,690
Reaction score
8,086
Location
Brisbane, Australia
Dunno if it helps, but I can use my iPhone to write Amiibo cards which are also NTAG215.
 

chunksin

Professional
Joined
Jan 21, 2017
Messages
126
Reaction score
285
Location
Birmingham, UK
Web NFC via Chrome looks like it might work, it supports writing and reading NFC via NDEF, the only caveat being you need to be using SSL to drive it from the netbooter web frontend. That would be super slick though, only issue is certificate issuing and updates from a trusted public CA.
 

LayeredRx

New User
Joined
Sep 20, 2021
Messages
1
Reaction score
1
Location
USA
I picked up a cheap NFC card reader/writer last week along with some NTAG215 cards for testing integration with the card emulator, I was hoping to use nfcpy/pynfc but I found out afterwards that the reader I bought was specifically listed as not recommended! It's an ACR122U which is probably the cheapest USB reader you can buy and is fully supported on raspbian buster. I've managed to get the card data written to the card and read back in the correct formats, I'm using a python library called pyscard which has lots of functionality but is pretty low level and really only handles the communications side, I had to dig into the card reader manual for the commands and build them on the fly. It certainly looks like it's going to work and write backs are handled with no problem, you can rest the card on the reader during play and my script makes the light flash red and beep three times when the card is being written to and the script will also wait for the card to be present if it's been removed before saving. Screenshot below shows the binary card data and a sample php file I generated for the card printing. I'll add a check card function in the web frontend so you can scan a card and it will show a printed version in the browser, the card data can either be saved on the card only or to both the Pi and the card.

The end game with be if you have an ID/ID2/ID3 cab you can power on the cab, auto netboot the game, the card emulator script will start up and you can swipe your NFC card with your save data on without having to interact with the Pi at all :D I picked up a Triforce last week so will start working on F-Zero AX card printing once the ID scripts are all complete and tested.
This is actually my goal down the road also. except I wanted to look into a basic android app for the cards so you could switch between them on you phone, and hopefully leverage the printing to show the image of the card too.

On that note I have been very slowly working through the script to make more of a state based emulator to try to better simulate the card reader. I don't actually own a cabinet but have a friend who has one without a card reader. hopefully Ill get it closer to a usable state and maybe one of you will be able to work with me to test it out.
 

chunksin

Professional
Joined
Jan 21, 2017
Messages
126
Reaction score
285
Location
Birmingham, UK
I have fzero cards if you needs scans of them. They might be potato quality though.
Thanks very much, I may take you up on that, have some feelers out already
This is actually my goal down the road also. except I wanted to look into a basic android app for the cards so you could switch between them on you phone, and hopefully leverage the printing to show the image of the card too.

On that note I have been very slowly working through the script to make more of a state based emulator to try to better simulate the card reader. I don't actually own a cabinet but have a friend who has one without a card reader. hopefully Ill get it closer to a usable state and maybe one of you will be able to work with me to test it out.
I'd be happy to help with any testing you need doing, drop me a PM when you're ready

Quick update on NFC progress, my card write code worked fine but I had to rewrite the card reading process from scratch as I'd approached it all wrong, it worked for a single good read but if a partial read happened due to the card being removed too early the script would stall. All working well now, just need to finish the writeback workflow:

View: https://youtu.be/gZXR5f0oqEM
 
Top