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
YoHa - A practical hand tracking engine.

YoHa - A practical hand tracking engine.

2k Jan 06, 2023
A PyTorch implementation for Unsupervised Domain Adaptation by Backpropagation(DANN), support Office-31 and Office-Home dataset

DANN A PyTorch implementation for Unsupervised Domain Adaptation by Backpropagation Prerequisites Linux or OSX NVIDIA GPU + CUDA (may CuDNN) and corre

8 Apr 16, 2022
PFENet: Prior Guided Feature Enrichment Network for Few-shot Segmentation (TPAMI).

PFENet This is the implementation of our paper PFENet: Prior Guided Feature Enrichment Network for Few-shot Segmentation that has been accepted to IEE

DV Lab 230 Dec 31, 2022
Deep Ensemble Learning with Jet-Like architecture

Ransomware analysis using DEL with jet-like architecture comprising two CNN wings, a sparse AE tail, a non-linear PCA to produce a diverse feature space, and an MLP nose

Ahsen Nazir 2 Feb 06, 2022
UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation

UnivNet UnivNet: A Neural Vocoder with Multi-Resolution Spectrogram Discriminators for High-Fidelity Waveform Generation. Training python train.py --c

Rishikesh (ऋषिकेश) 55 Dec 26, 2022
Implementation / replication of DALL-E, OpenAI's Text to Image Transformer, in Pytorch

DALL-E in Pytorch Implementation / replication of DALL-E, OpenAI's Text to Image Transformer, in Pytorch. It will also contain CLIP for ranking the ge

Phil Wang 5k Jan 04, 2023
PaRT: Parallel Learning for Robust and Transparent AI

PaRT: Parallel Learning for Robust and Transparent AI This repository contains the code for PaRT, an algorithm for training a base network on multiple

Mahsa 0 May 02, 2022
Generative Adversarial Text to Image Synthesis

Text To Image Synthesis This is a tensorflow implementation of synthesizing images. The images are synthesized using the GAN-CLS Algorithm from the pa

Hao 575 Jan 08, 2023
Code for CVPR 2021 oral paper "Exploring Data-Efficient 3D Scene Understanding with Contrastive Scene Contexts"

Exploring Data-Efficient 3D Scene Understanding with Contrastive Scene Contexts The rapid progress in 3D scene understanding has come with growing dem

Facebook Research 182 Dec 30, 2022
FNet Implementation with TensorFlow & PyTorch

FNet Implementation with TensorFlow & PyTorch. TensorFlow & PyTorch implementation of the paper "FNet: Mixing Tokens with Fourier Transforms". Overvie

Abdelghani Belgaid 1 Feb 12, 2022
The King is Naked: on the Notion of Robustness for Natural Language Processing

the-king-is-naked: on the notion of robustness for natural language processing AAAI2022 DISCLAIMER:This repo will be updated soon with instructions on

Iperboreo_ 1 Nov 24, 2022
DeFMO: Deblurring and Shape Recovery of Fast Moving Objects (CVPR 2021)

Evaluation, Training, Demo, and Inference of DeFMO DeFMO: Deblurring and Shape Recovery of Fast Moving Objects (CVPR 2021) Denys Rozumnyi, Martin R. O

Denys Rozumnyi 139 Dec 26, 2022
Official implementation of AAAI-21 paper "Label Confusion Learning to Enhance Text Classification Models"

Description: This is the official implementation of our AAAI-21 accepted paper Label Confusion Learning to Enhance Text Classification Models. The str

101 Nov 25, 2022
Creating multimodal multitask models

Fusion Brain Challenge The English version of the document can be found here. Обновления 01.11 Мы выкладываем пример данных, аналогичных private test

Sber AI 43 Nov 28, 2022
Code for Phase diagram of Stochastic Gradient Descent in high-dimensional two-layer neural networks

Phase diagram of Stochastic Gradient Descent in high-dimensional two-layer neural networks Under construction. Description Code for Phase diagram of S

Rodrigo Veiga 3 Nov 24, 2022
Numenta Platform for Intelligent Computing is an implementation of Hierarchical Temporal Memory (HTM), a theory of intelligence based strictly on the neuroscience of the neocortex.

NuPIC Numenta Platform for Intelligent Computing The Numenta Platform for Intelligent Computing (NuPIC) is a machine intelligence platform that implem

Numenta 6.3k Dec 30, 2022
Replication package for the manuscript "Using Personality Detection Tools for Software Engineering Research: How Far Can We Go?" submitted to TOSEM

tosem2021-personality-rep-package Replication package for the manuscript "Using Personality Detection Tools for Software Engineering Research: How Far

Collaborative Development Group 1 Dec 13, 2021
Code for "NeuralRecon: Real-Time Coherent 3D Reconstruction from Monocular Video", CVPR 2021 oral

NeuralRecon: Real-Time Coherent 3D Reconstruction from Monocular Video Project Page | Paper NeuralRecon: Real-Time Coherent 3D Reconstruction from Mon

ZJU3DV 1.4k Dec 30, 2022
My 1st place solution at Kaggle Hotel-ID 2021

1st place solution at Kaggle Hotel-ID My 1st place solution at Kaggle Hotel-ID to Combat Human Trafficking 2021. https://www.kaggle.com/c/hotel-id-202

Kohei Ozaki 18 Aug 19, 2022
This is the code for CVPR 2021 oral paper: Jigsaw Clustering for Unsupervised Visual Representation Learning

JigsawClustering Jigsaw Clustering for Unsupervised Visual Representation Learning Pengguang Chen, Shu Liu, Jiaya Jia Introduction This project provid

DV Lab 73 Sep 18, 2022