This is a node.js command line interface designed to be used with the Arduino Gameboy Printer Emulator project.
It allows printouts from the emulator to immediately be sent to a bluetooth device such as an Android phone, alongside saving the printouts locally.
Run the following commands in a folder of your choice.
sudo apt install obexftp bluetoothctl build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
git clone https://github.com/KiwifruitDev/gameboy-printer-emulator-server.git
cd gameboy-printer-emulator-server
npm install
You must configure the server before it can be used.
Run the following command to start the server.
node .
The server may be stopped by pressing Ctrl+C
.
The server can be configured by editing the config.json
file.
An example configuration file is provided in config-example.json
or below.
{
"serialPort": "/dev/ttyUSB0",
"baudRate": 115200,
"defaultPalette": "grayscale",
"palettes": [
"grayscale",
"dmg",
"gameboypocket",
"gameboycoloreuus",
"gameboycolorjp",
"bgb",
"grafixkidgray",
"grafixkidgreen",
"blackzero"
],
"saveLocally": true,
"bluetoothEnabled": true,
"bluetoothAddress": "74:74:46:D2:32:57",
"bluetoothPaired": false,
"obexPushChannel": 7,
"silent": true
}
The serial port that the Arduino is connected to.
The baud rate of the serial connection.
The default palette to use as the header file and for bluetooth file transfers.
The palettes to be saved. The default palette must be included in this list.
Whether or not to save the printouts locally.
Whether or not to enable bluetooth.
The bluetooth address of the device to send the printouts to.
Whether or not the device is already paired with the computer.
If this is set to false
, the server will attempt to pair with the device using bluetoothctl
.
The channel to use for the bluetooth connection.
To check which obex PUSH channel is available, run the following command.
bluetoothctl
# This will open the bluetoothctl console
scan on
# Wait for the device to appear
scan off
pair <MAC address>
trust <MAC address>
quit
# Back to the command line
touch test.txt
obexftp --nopath --noconn --uuid none --bluetooth <MAC address> --channel <channel> --put test.txt
rm test.txt
Replace <MAC address>
with the bluetooth address of the device and <channel>
with the channel to test.
You may guess by counting the channel up until you recieve a bluetooth file transfer on your device.
Whether or not to log to the console.
This project is licensed under the GPL v3.0 License, see the LICENSE file for details.
- Arduino Gameboy Printer Emulator (for the Arduino code)
- RetroSpy Technologies (for providing prebuilt Arduino emulators)