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
Attack on Confidence Estimation algorithm from the paper "Disrupting Deep Uncertainty Estimation Without Harming Accuracy"

Attack on Confidence Estimation (ACE) This repository is the official implementation of "Disrupting Deep Uncertainty Estimation Without Harming Accura

3 Mar 30, 2022
SegNet model implemented using keras framework

keras-segnet Implementation of SegNet-like architecture using keras. Current version doesn't support index transferring proposed in SegNet article, so

185 Aug 30, 2022
Robust Lane Detection via Expanded Self Attention (WACV 2022)

Robust Lane Detection via Expanded Self Attention (WACV 2022) Minhyeok Lee, Junhyeop Lee, Dogyoon Lee, Woojin Kim, Sangwon Hwang, Sangyoun Lee Overvie

Min Hyeok Lee 18 Nov 12, 2022
The offcial repository for 'CharacterBERT and Self-Teaching for Improving the Robustness of Dense Retrievers on Queries with Typos', SIGIR2022

CharacterBERT-DR The offcial repository for CharacterBERT and Self-Teaching for Improving the Robustness of Dense Retrievers on Queries with Typos, Sh

ielab 11 Nov 15, 2022
3 Apr 20, 2022
A Tensorflow based library for Time Series Modelling with Gaussian Processes

Markovflow Documentation | Tutorials | API reference | Slack What does Markovflow do? Markovflow is a Python library for time-series analysis via prob

Secondmind Labs 24 Dec 12, 2022
Perception-aware multi-sensor fusion for 3D LiDAR semantic segmentation (ICCV 2021)

Perception-Aware Multi-Sensor Fusion for 3D LiDAR Semantic Segmentation (ICCV 2021) [中文|EN] 概述 本工作主要探索一种高效的多传感器(激光雷达和摄像头)融合点云语义分割方法。现有的多传感器融合方法主要将点云投影

ICE 126 Dec 30, 2022
A big endian Gentoo port developed on a Pine64.org RockPro64

Gentoo-aarch64_be A big endian Gentoo port developed on a Pine64.org RockPro64 The endian wars are over... little endian won. As a result, it is incre

Rory Bolt 6 Dec 07, 2022
This is the second place solution for : UmojaHack Africa 2022: African Snake Antivenom Binding Challenge

UmojaHack-Africa-2022-African-Snake-Antivenom-Binding-Challenge This is the second place solution for : UmojaHack Africa 2022: African Snake Antivenom

Mami Mokhtar 10 Dec 03, 2022
This repo contains the implementation of YOLOv2 in Keras with Tensorflow backend.

Easy training on custom dataset. Various backends (MobileNet and SqueezeNet) supported. A YOLO demo to detect raccoon run entirely in brower is accessible at https://git.io/vF7vI (not on Windows).

Huynh Ngoc Anh 1.7k Dec 24, 2022
Fast and robust clustering of point clouds generated with a Velodyne sensor.

Depth Clustering This is a fast and robust algorithm to segment point clouds taken with Velodyne sensor into objects. It works with all available Velo

Photogrammetry & Robotics Bonn 957 Dec 21, 2022
SANet: A Slice-Aware Network for Pulmonary Nodule Detection

SANet: A Slice-Aware Network for Pulmonary Nodule Detection This paper (SANet) has been accepted and early accessed in IEEE TPAMI 2021. This code and

Jie Mei 39 Dec 17, 2022
A Python implementation of active inference for Markov Decision Processes

A Python package for simulating Active Inference agents in Markov Decision Process environments. Please see our companion preprint on arxiv for an ove

235 Dec 21, 2022
a grammar based feedback fuzzer

Nautilus NOTE: THIS IS AN OUTDATE REPOSITORY, THE CURRENT RELEASE IS AVAILABLE HERE. THIS REPO ONLY SERVES AS A REFERENCE FOR THE PAPER Nautilus is a

Chair for Sys­tems Se­cu­ri­ty 158 Dec 28, 2022
Keep CALM and Improve Visual Feature Attribution

Keep CALM and Improve Visual Feature Attribution Jae Myung Kim1*, Junsuk Choe1*, Zeynep Akata2, Seong Joon Oh1† * Equal contribution † Corresponding a

NAVER AI 90 Dec 07, 2022
This repository compare a selfie with images from identity documents and response if the selfie match.

aws-rekognition-facecompare This repository compare a selfie with images from identity documents and response if the selfie match. This code was made

1 Jan 27, 2022
Consensus score for tripadvisor

ContripScore ContripScore is essentially a score that combines an Internet platform rating and a consensus rating from sentiment analysis (For instanc

Pepe 1 Jan 13, 2022
Dynamic Neural Representational Decoders for High-Resolution Semantic Segmentation

Dynamic Neural Representational Decoders for High-Resolution Semantic Segmentation Requirements This repository needs mmsegmentation Training To train

Adelaide Intelligent Machines (AIM) Group 7 Sep 12, 2022
This is a repo of basic Machine Learning!

Basic Machine Learning This repository contains a topic-wise curated list of Machine Learning and Deep Learning tutorials, articles and other resource

Ekram Asif 53 Dec 31, 2022
MPLP: Metapath-Based Label Propagation for Heterogenous Graphs

MPLP: Metapath-Based Label Propagation for Heterogenous Graphs Results on MAG240M Here, we demonstrate the following performance on the MAG240M datase

Qiuying Peng 10 Jun 28, 2022