BarcodeRattler - A Raspberry Pi Powered Barcode Reader to load a game on the Mister FPGA using MBC

Overview

Barcode Rattler

A Raspberry Pi Powered Barcode Reader to load a game on the Mister FPGA using MBC

This is a work in progress and a bit hackery 😅

There are limitations on the MBC side. Some of the computer cores don't work in loading games up. Such as the commodore computers as the cores have changed the menu layout is slightly different.

Currently i have only implemented getting games from out of zip files. You can do direct loading of a rom, just not implemented in my python script to do this.

The CSV file, spaces and other special characters need backslash \ or sometimes double backslash \\ not got around to sorting this out.


Versions

Version Date Description Released
0.2 04/01/2022 Initial commit Yes link
0.2.1 07/01/2022 NFC Support added by Symm No

Raspberry Pi OS

I used the Raspberry Pi OS Lite Release date: October 30th 2021

Installation of files

Files need to be installed in to a folder called /opt/barcoderattler

sudo mkdir /opt/barcoderattler

sudo chown pi /opt/barcoderattler

cd /opt/barcoderattler

You can either get the zip file

wget https://github.com/chris-jh/BarcodeRattler/archive/refs/tags/barcoderattler_v0.2.zip

unzip -j ./barcoderattler_v0.2.zip

or the tar.tgz file

wget https://github.com/chris-jh/BarcodeRattler/archive/refs/tags/barcoderattler_v0.2.tar.gz

tar -zxf ./barcoderattler_v0.2.tar.gz --strip-components=1

or if you have git installed, you can clone the latest

git clone https://github.com/chris-jh/BarcodeRattler.git ./

all the above methods assume you are inside the /opt/barcoderattler folder before running

Installing MBC on Mister

Get the Mister IP Address

Enable SSH on the Mister

Copy the mmsmbc.sh file to Mister in the Fat folder

default password is 1

scp /opt/barcoderattler/mmsmbc.sh [email protected]:/media/fat

ssh into Mister and run the mmsmbc.sh file to install mbc

ssh [email protected]

cd /media/fat

./mmsmbc.sh

Running this file will download the latest release of MBC from https://github.com/pocomane/MiSTer_Batch_Control

It will be installed on your SD Card at /media/fat/Scripts/.barcoderattler

Configuring the PI Camera

Make sure to enable the Camera and SSH on the Pi

You may need to tweak the focus on the Camera, so it can read close up objects, like a barcode.

I had to adjust mine anticlockwise about 1 full turn

Intalling PYTHON LIBS

make sure to

sudo apt-get update

and then run the file barcodesetup.sh (do not sudo, it will ask for password) on the pi, this should install the python libraries that is required

KEYBOARD USB Permissions

A udev rule is required so that the pi user can have access to the USB events for the keyboard

create a file called (you will have to sudo nano)

/etc/udev/rules.d/99-hidraw-permissions.rules

and this should be inside it

KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"

The barcode scanner will need to be in USB Keyboard mode, it also needs to be the first usb keyboard device to be plugged in, or the only usb keyboard device plugged.

The barcode device i bought was this one from amazon.

https://www.amazon.co.uk/gp/product/B00Y83TXOE

NFC Support

NFC Support has been added by Symm.

Devices that are supported can be seen here Supported Devices

Set NFC_ID to the one you have from the list inside the barcoderattler_nfc.py file

There is no service or start file for it yet, but you can modify the startrattler bash script and change to run the barcoderattler_nfc.py

CSV File

The file is made up of the following headers

BARCODE,CORE,ZIP,FILE,TMP

Field Description Example
BARCODE The Barcode 123456789
Core Name of the core to run GENESIS
ZIP Location of the Zip File. Currently this version expects the games to be inside a zip file /media/fat/Games/Genesis/GenesisGames.zip
FILE Location of the game inside the zip file US\Q-Z\Street\ Fighter\ II\ CE.md
TMP A temporary location to unzip the game to /tmp/game.md

any special characters in the file path including spaces needs the backslash
some need double backslash such as the [ ]

To see what the core names are on mbc, you need to ssh into the MisterFGPA and run

/media/fat/Scripts/.barcoderattler/mbc list_core

The core name is the first field

Running

There are two python script files

  1. barcoderattler.py

This one uses the Barcode Hand Scanner, make sure to scan factory reset code in the book and then scan the USB Keyboard.

  1. barcoderattler_camera.py

This is for using the Pi Camera on a Pi 3

In each of the python scripts there is an area at the top to Specify your Mister IP Address and to change the password is different from the default 1. You can also change the location of the CSV file to read and also if you put the mbc in a different directory also.


If you are going to use the Hand Scanner, this needs to be the first keyboard device. Remove any keyboards, and then plug in the barcode hand scanner.

You should do any interaction with the Pi via SSH


To run each version, only one should be run, from the command line type either

  1. /opt/barcoderattler/startrattler

    To start the Barcode Hand Scanner version

  2. /opt/barcoderattler/startrattler_camera

    To start the Barcode scanning via the Pi Camera


If you want to enable the barcode rattler on start up, run either of the following

  1. /opt/barcoderattler/enable_barcode_scanner

    To enable the Barcode Hand Scanner on boot up

  2. /opt/barcoderattler/enable_camera_barcode_scanner

    To enable the Barcode Scanning via the Pi Camer on boot up


To start and stop the service

  1. sudo service start barcoderattler

    To Start the Barcode Hand Scanner

  2. sudo service stop barcoderattler

    To Stop the Barcode Hand Scanner

  3. sudo service start barcoderattler

    To Start the Barcode Camera Scanner

  4. sudo service stop barcoderattler

    To Stop the Barcode Camera Scanner


To Stop the services for starting at boot up

Run

sudo systemctl disable barcoderattler_camera.service

sudo systemctl disable barcoderattler.service

You might also like...
Cl datasets - PyTorch image dataloaders and utility functions to load datasets for supervised continual learning

Continual learning datasets Introduction This repository contains PyTorch image

A Python library that enables ML teams to share, load, and transform data in a collaborative, flexible, and efficient way :chestnut:
A Python library that enables ML teams to share, load, and transform data in a collaborative, flexible, and efficient way :chestnut:

Squirrel Core Share, load, and transform data in a collaborative, flexible, and efficient way What is Squirrel? Squirrel is a Python library that enab

A facial recognition doorbell system using a Raspberry Pi

Facial Recognition Doorbell This project expands on the person-detecting doorbell system to allow it to identify faces, and announce names accordingly

Control-Robot-Arm-using-PS4-Controller - A Robotic Arm based on Raspberry Pi and Arduino that controlled by PS4 Controller

Control-Robot-Arm-using-PS4-Controller You can see all details about this Robot

Game Agent Framework. Helping you create AIs / Bots that learn to play any game you own!
Game Agent Framework. Helping you create AIs / Bots that learn to play any game you own!

Serpent.AI - Game Agent Framework (Python) Update: Revival (May 2020) Development work has resumed on the framework with the aim of bringing it into 2

Gesture-controlled Video Game. Just swing your finger and play the game without touching your PC
Gesture-controlled Video Game. Just swing your finger and play the game without touching your PC

Gesture Controlled Video Game Detailed Blog : https://www.analyticsvidhya.com/blog/2021/06/gesture-controlled-video-game/ Introduction This project is

Hand-distance-measurement-game - Hand Distance Measurement Game
Hand-distance-measurement-game - Hand Distance Measurement Game

Hand Distance Measurement Game This is program is made to calculate the distance

Dcf-game-infrastructure-public - Contains all the components necessary to run a DC finals (attack-defense CTF) game from OOO

dcf-game-infrastructure All the components necessary to run a game of the OOO DC

Torchlight2 lan game server tool - A message forwarding tool for Torchlight 2 lan game

Torchlight 2 Lan Game Server Tool A message forwarding tool for Torchlight 2 lan

Comments
  • Initial script for reading NFC tags

    Initial script for reading NFC tags

    I hacked together support for reading NFC tags 😄

    Set NFC_ID to the one you have from the list of Supported devices and run ./barcoderattler_nfc.py

    I've not created any service startup scripts etc but can add if there is interest

    opened by symm 1
  • Idea: Machine Vision to identify cart based on box art/cartridge label

    Idea: Machine Vision to identify cart based on box art/cartridge label

    Could be a way to take it even further in a future project if you wanted to learn more. You could train the model on the libretro/retroarch cover art images available online. Just a thought.

    opened by birdybro 0
  • Ideas for additional barcode support

    Ideas for additional barcode support

    Hi,

    The zxing barcode scanner on Android can be launched with a custom URL protocol which would allow you to use an Android phone as the scanner: https://stackoverflow.com/questions/13347145/android-barcode-scanner-integration-with-web-page

    Another possibility is to print QR codes with a custom URL that goes to a .local hostname, allowing any phone to talk to a local Pi on the network.

    Both require some network level access, either through Zeroconf .local domains or perhaps via a publicly accessible hostname.

    The .local method would be useful if you have a "public wifi" that people can use, or just setup the Pi as an AP and allow people to connect to it for this purpose. That's probably the most robust solution for passers by. If this is used in-home then the .local solution on your home network is sufficient.

    opened by drwonky 1
  • A simple fix for slow CSV searching

    A simple fix for slow CSV searching

    I noticed in Neil's demo on YT that the time between scanning seemed to be pretty slow and highly variable. After he mentioned the barcodes were being stored in CSV, I rightly assumed that the CSV was being parsed and searched through every time a code is scanned. This is super inefficient, and only provides one small advantage in that simply uploading a new csv will immediately make new titles available to scan.

    This PR switches things around to only load the CSV once when the script loads, and then does a list comprehension on it to build an index by barcode. I haven't tested it (I don't have a barcode scanner), but it should allow for lightning fast lookups. There are only three caveats to this approach:

    1. All of the barcodes and other data in the CSV will be stored in memory. As long as the number of columns in the CSV doesn't get ridiculous, I can't see this being an actual problem on a RPi.

    2. Each row in the CSV will need a unique barcode. Really, this was already the case as the current script will only ever return the data for the first barcode it finds. After this change, if there are duplicates I believe you'd only get the data for the LAST duplicate in the file.

    3. The script will need to be restarted whenever the CSV is updated.

    EDIT: I didn't notice a script had also been added for NFCs. The same change could easily be made to that script as well.

    opened by raelik 4
Releases(barcoderattler_v0.2)
Owner
Chrissy
Chrissy
Code for sound field predictions in domains with impedance boundaries. Used for generating results from the paper

Code for sound field predictions in domains with impedance boundaries. Used for generating results from the paper

DTU Acoustic Technology Group 11 Dec 17, 2022
BEGAN in PyTorch

BEGAN in PyTorch This project is still in progress. If you are looking for the working code, use BEGAN-tensorflow. Requirements Python 2.7 Pillow tqdm

Taehoon Kim 260 Dec 07, 2022
Attention Probe: Vision Transformer Distillation in the Wild

Attention Probe: Vision Transformer Distillation in the Wild Jiahao Wang, Mingdeng Cao, Shuwei Shi, Baoyuan Wu, Yujiu Yang In ICASSP 2022 This code is

Wang jiahao 3 Oct 31, 2022
Implementation of a Transformer that Ponders, using the scheme from the PonderNet paper

Ponder(ing) Transformer Implementation of a Transformer that learns to adapt the number of computational steps it takes depending on the difficulty of

Phil Wang 65 Oct 04, 2022
Differentiable Neural Computers, Sparse Access Memory and Sparse Differentiable Neural Computers, for Pytorch

Differentiable Neural Computers and family, for Pytorch Includes: Differentiable Neural Computers (DNC) Sparse Access Memory (SAM) Sparse Differentiab

ixaxaar 302 Dec 14, 2022
Research shows Google collects 20x more data from Android than Apple collects from iOS. Block this non-consensual telemetry using pihole blocklists.

pihole-antitelemetry Research shows Google collects 20x more data from Android than Apple collects from iOS. Block both using these pihole lists. Proj

Adrian Edwards 290 Jan 09, 2023
TensorFlow implementation for Bayesian Modeling and Uncertainty Quantification for Learning to Optimize: What, Why, and How

Bayesian Modeling and Uncertainty Quantification for Learning to Optimize: What, Why, and How TensorFlow implementation for Bayesian Modeling and Unce

Shen Lab at Texas A&M University 8 Sep 02, 2022
An implementation of IMLE-Net: An Interpretable Multi-level Multi-channel Model for ECG Classification

IMLE-Net: An Interpretable Multi-level Multi-channel Model for ECG Classification The repostiory consists of the code, results and data set links for

12 Dec 26, 2022
Joint Discriminative and Generative Learning for Person Re-identification. CVPR'19 (Oral)

Joint Discriminative and Generative Learning for Person Re-identification [Project] [Paper] [YouTube] [Bilibili] [Poster] [Supp] Joint Discriminative

NVIDIA Research Projects 1.2k Dec 30, 2022
Starter kit for getting started in the Music Demixing Challenge.

Music Demixing Challenge - Starter Kit 👉 Challenge page This repository is the Music Demixing Challenge Submission template and Starter kit! Clone th

AIcrowd 106 Dec 20, 2022
The codes and models in 'Gaze Estimation using Transformer'.

GazeTR We provide the code of GazeTR-Hybrid in "Gaze Estimation using Transformer". We recommend you to use data processing codes provided in GazeHub.

65 Dec 27, 2022
Working demo of the Multi-class and Anomaly classification model using the CLIP feature space

👁️ Hindsight AI: Crime Classification With Clip About For Educational Purposes Only This is a recursive neural net trained to classify specific crime

Miles Tweed 2 Jun 05, 2022
A little software to generate and save Julia or Mandelbrot's Fractals.

Julia-Mandelbrot-s-Fractals A little software to generate and save Julia or Mandelbrot's Fractals. Dependencies : Python 3.7 or more. (Also possible t

Olivier 0 Jul 09, 2022
Summary of related papers on visual attention

This repo is built for paper: Attention Mechanisms in Computer Vision: A Survey paper Vision-Attention-Papers Channel attention Spatial attention Temp

MenghaoGuo 2.1k Dec 30, 2022
Real-Time SLAM for Monocular, Stereo and RGB-D Cameras, with Loop Detection and Relocalization Capabilities

ORB-SLAM2 Authors: Raul Mur-Artal, Juan D. Tardos, J. M. M. Montiel and Dorian Galvez-Lopez (DBoW2) 13 Jan 2017: OpenCV 3 and Eigen 3.3 are now suppor

Raul Mur-Artal 7.8k Dec 30, 2022
Deep learning image registration library for PyTorch

TorchIR: Pytorch Image Registration TorchIR is a image registration library for deep learning image registration (DLIR). I have integrated several ide

Bob de Vos 40 Dec 16, 2022
PyZebrascope - an open-source Python platform for brain-wide neural activity imaging in behaving zebrafish

PyZebrascope - an open-source Python platform for brain-wide neural activity imaging in behaving zebrafish

1 May 31, 2022
This is the repo for our work "Towards Persona-Based Empathetic Conversational Models" (EMNLP 2020)

Towards Persona-Based Empathetic Conversational Models (PEC) This is the repo for our work "Towards Persona-Based Empathetic Conversational Models" (E

Zhong Peixiang 35 Nov 17, 2022
Rendering color and depth images for ShapeNet models.

Color & Depth Renderer for ShapeNet This library includes the tools for rendering multi-view color and depth images of ShapeNet models. Physically bas

Yinyu Nie 41 Dec 19, 2022
Repository for the Bias Benchmark for QA dataset.

BBQ Repository for the Bias Benchmark for QA dataset. Authors: Alicia Parrish, Angelica Chen, Nikita Nangia, Vishakh Padmakumar, Jason Phang, Jana Tho

ML² AT CILVR 18 Nov 18, 2022