A GameBoy printer emulator which provides the received data over a WiFi connection
This code has been created for a "LOLIN(WEMOS) D1 R2 & mini" ESP8266 based board
A detailed beginners guide can be found here
If you are proficient in soldering, there is now a PCB/Shield to hold the ESP and the optional display
The required (recommended) gameboy printer web interface can be found on github as well
Before compiling the project you need to create a config.h
inside the project folder
(config.h.sample.txt
should be used as a reference)
For uploading the Filesystem the LittleFS tool you require the Arduino IDE Plugin is required. Follow the installation instructions here
If you run the default setup (similar to the WiFi-Printer) that file can be left empty
If your (hardware-)setup is different you can adjust the parameters there
The code is designed to check pin D0
for high to boot in printer mode
Through this it is possible to use the +5v provided by the GameBoy to switch the mode
The default will alternate the bootmode automatically between printer and server on each boot, so you can use the reset-button to switch modes
If you have the possibility to sense the 5V signal, from the GameBoy, you can uncomment #define SENSE_BOOT_MODE
in your config.h
If the device is not configured the default settings (AP only) will be used
If not present the ESP will set up an accesspoint with ssid/password gameboyprinter
It will output it's IP adress over the serial monitor and on an optionally connected display
(usually the device should be accessible via http://192.168.4.1
)
It will also be discoverable via Bonjour/mDNS via http://gameboyprinter.local
Wifi setup can be done via a file conf.json
in the /data/
folder
The basic format are as follows:
{
"mdns": "gameboyprinter",
"ap": {
"ssid":"gameboyprinter",
"psk":"gameboyprinter"
},
"networks": [
{
"ssid":"Your SSID",
"psk":"Your wifi password"
}
]
}
All config options are optional
Change the name by which the printer will be accessible via Bonjour/mDNS
AccessPoint config
Enter ssid/psk to open an accesspoint different to the default one.
Array of objects with keys ssid/psk
The first reachable network in that list will be used to conect to
⚠ Do not use more than 10 elements. Otherwise you might see an "Out of Memory" error in the serial monitor
The following will describe the "raw" interface for updating ther configuration. You will only need this if you decide not to use the existing web-interface
calls to /wificonfig/get
delivers the actual config (passwords are omitted)
calls to /wificonfig/set
will update the sent properties
make sure to send the data as a JSON string in the POST-Body
- Networks are based on the
ssid
-property - Existing networks do not have to be sent if they should remain unchanged.
- If the update for a network contains
"delete": true
, the networek will be deleted - If the update for a network contains a
psk
it will be updated otherwise left untouched
- You can run
update_w.ps1
(windows-powershell) orupdate_w.sh
(bash) to download the latest release of the gb-printer-web and automatically unzip it to the correct folder - After doing so upload the content of that folder to the ESP via the arduino-esp8266fs-plugin in the Arduino IDE.
Gameboy Original/Color Link Cable Pinout
__________
| 6 4 2 |
\_5__3__1_/ (at cable)
| Link Cable | ESP8266 |
|------------|---------|
| Pin 1 | D8 |
| Pin 2 | D7 |
| Pin 3 | D6 |
| Pin 5 | D5 |
| Pin 6 | G |
Additionally an OLED Display can be added via D1 -> Display SCL / D2 -> Display SDA
Enhance performance while saving (maybe by constantly writing all data to a single file instead of buffering and flushing it)
- Original GPB-Emulator by mofosyne: Arduino Gameboy Printer Emulator
- Tutorial on how to work with an ESP8266 by ttapa: ESP8266 Beginner's Guide
- Potentially faster library for data transfer applefreak/esp8266-gameboy-printer
- ESP8266 D1 Mini Pinout
- SPIFFS/LittleFS Filesystem Docs
- Link cable breakout board
You can add a tiny oled display like this or (probably) this
To use it, you need to uncomment #define USE_OLED
and the following lines
The display will show the current wifi-config while in server mode, as well as the number of printed images when in printer mode
Please note the image count in printer mode only regularly updates while idle, and not while printing a batch of images
An earlier version of this code did stream the received image-data to a browser via websockets. This is shown in this older video.
You should not power the ESP from the GameBoy, as this might damage the GameBoy itself. What you see in the video was meant as a proof of concept which is basically not implemented anymore