Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
hardware:nfc [2026/02/05 22:34] – created nadenislamarrehardware:nfc [2026/02/06 12:44] (current) nadenislamarre
Line 1: Line 1:
 +Since batocera 43, you can use a nfc reader and cards to start/stop your games or execute any custom action (like shutting down batocera).
 +
 +{{:hardware:nfc_preview.jpg?800|}}
 +
 ===== Required hardware ===== ===== Required hardware =====
  
 +==== A nfc reader ====
 {{:hardware:nfc_reader.jpg?400|}} {{:hardware:nfc_reader.jpg?400|}}
 +
 +It is recommanded to use a pn532 reader while it is recognized by both software you can use in batocera. It costs about 10€.
 +
 +The integrated batocera nfc service supports only pn532 readers.
 +
 +The Zaparoo nfc service supports more hardware (see https://zaparoo.org/docs/readers/)
 +
 +==== Nfc tags ====
 +Any tag ntag215. Cards or stickers.
 +
 {{:hardware:nfc_tags.jpg?400|}} {{:hardware:nfc_tags.jpg?400|}}
  
-===== Available software ===== +===== Available softwares ===== 
-  - Integrated batocera nfc service+batocera.linux offers 2 software solutions to make a nfc reader to work. 
 + 
 +  - the integrated batocera nfc service
   - Zaparoo nfc service   - Zaparoo nfc service
  
-The itegrated batocera nfc service supports only pn532 readers. +The integrated batocera nfc service and Zaparoo nfc service both offers: 
-THe Zaparoo nfc service supports more hardware (see https://zaparoo.org)+  * write a nfc tag containing the path of a game from the game menu 
 +  * start a game when you connect a game tag to the nfc reader 
 +  * stop a game when you disconnect a game tag from the nfc reader 
 +  * call custom scripts when a tag is connected or disconnected.
  
-===== Installation ===== +The integrated batocera nfc service: 
-==== Plug the nfc reader to batocera ====+  * is already inside batocera.linux. Nothing to install. 
 +  * is available for any batocera supported boards 
 + 
 +The Zaparoo nfc service: 
 +  * is present in the batocera content downloader. 
 +  * should be available for most batocera supported boards (packages are built by the zaparoo team) 
 +  * supports more nfc readers hardware 
 +  * can connect to your phone to read qr code instead of nfc tags 
 +  * allows you to produce scenario and different interactions with other hardware 
 + 
 +===== The integrated nfc service ===== 
 +==== Installation ==== 
 +=== Plug the nfc reader to batocera ===
 {{:hardware:nfc_plug_to_pc.jpg?400|}} {{:hardware:nfc_plug_to_pc.jpg?400|}}
  
-==== Start the nfc service ==== +Plug the nfc reader to batocera.
-{{:hardware:nfc_service.jpg?400|}}+
  
-==== Write the name of a card on a nfc tag ==== +=== Start the nfc service === 
-{{:hardware:nfc_write_menu.jpg?400|}}+{{:hardware:nfc_service.jpg?600|}} 
 + 
 +From emulationstation, go in the system menu, find the services entry, and enable the simple nfc service. 
 + 
 +Note that the nfc reader must be connected to batocera first. 
 +If when starting, the simple nfc service detects no hardware, it stops. 
 + 
 +The simple nfc service is not enabled by default in batocera, cause the hardware used for nfc readers (uart converter) is generic, and cannot be distinguished from some other hardware. 
 + 
 +=== Write the name of a card on a nfc tag === 
 +{{:hardware:nfc_write_menu.jpg?600|}} 
 + 
 +From emulationstation, choose a game, and press a long time on it to display its menu. 
 +Choose "Write an nfc tag for this game"
 + 
 +If the entry is not present, it means that the nfc reader was not detected.
  
 {{:hardware:nfc_card.jpg?400|}} {{:hardware:nfc_card.jpg?400|}}
  
-==== Usage ====+Put the nfc tag on the reader to write it. 
 + 
 +=== Usage === 
 +Default behavior : 
 +  * while navigating in the emulationstation menu, connect a tag to your nfc reader : the game starts 
 +  * while playing a game : disconnect the tag from the nfc reader : the game stops 
 + 
 +=== Customized scripts === 
 +By default, when you connect a tag, the nfc service will execute all the script present in the following system directory : 
 +  * /usr/share/batocera/scripts/on-nfc-connect 
 + 
 +If you create the following directory, the system default scripts will not be executed, instead, the one of the custom directory will be executed. 
 +  * /userdata/system/configs/emulationstation/scripts/on-nfc-connect 
 + 
 +The same behavior occurs for disconnect with the following directories : 
 +  * /usr/share/batocera/scripts/on-nfc-disconnect 
 +  * /userdata/system/configs/emulationstation/scripts/on-nfc-disconnect 
 + 
 +Extra file : 
 +When a nfc service detects a nfc reader and listen to it, it create the following file : 
 +  * /var/run/batocera-nfc.running 
 +When the hardware is removed, this file is removed. 
 +Thanks to this, emulationstation takes the decision to show or not the write entry in the menu. 
 +You could use this file to know whether a nfc reader is listening tags or not.
  
  
 +===== The Zaparoo nfc service =====
 +==== Installation ====
 +Details given in the following video : https://www.youtube.com/watch?v=XpH27Yswe38
  • hardware/nfc.1770330868.txt.gz
  • Last modified: 3 months ago
  • by nadenislamarre