Skip to content

Commit 6e4ae49

Browse files
authored
Merge pull request #2 from MintyTrebor/main
ZapEsp32 Rebuild - Full Pull from main MintyTrebor Repo
2 parents f835ab4 + 565aff3 commit 6e4ae49

File tree

79 files changed

+10746
-310
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+10746
-310
lines changed

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
ZaparooEsp32/ZaparooEsp32.hpp
3+
/svelte-esp32/node_modules
4+
/svelte-esp32/dist
5+
/websrc/*.gz
6+
/websrc/*.csv
7+
/websrc/*.json
8+
/websrc/index.html
9+
/ZaparooEsp32/ZaparooEsp32.hpp
10+
/svelte-esp32/.vscode
11+
svelte-esp32/package-lock.json
12+
/web/.vscode
13+
svelte-esp32/.env
14+
ZaparooEsp32/build/esp32.esp32.esp32/ZaparooEsp32.ino.bin
15+
ZaparooEsp32/build/esp32.esp32.esp32/ZaparooEsp32.ino.bootloader.bin
16+
ZaparooEsp32/build/esp32.esp32.esp32/ZaparooEsp32.ino.elf
17+
ZaparooEsp32/build/esp32.esp32.esp32/ZaparooEsp32.ino.map
18+
ZaparooEsp32/build/esp32.esp32.esp32/ZaparooEsp32.ino.merged.bin
19+
ZaparooEsp32/build/esp32.esp32.esp32/ZaparooEsp32.ino.partitions.bin

README.md

Lines changed: 21 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,21 @@
1-
# Zaparoo ESP32
2-
3-
The goal of this project is to launch games via the [Zaparoo Service](https://wiki.zaparoo.org/Main_Page) on the a Mister over Wifi. It also supports launching games via [Simple Serial](https://wiki.zaparoo.org/Reader_Drivers#Simple_Serial).
4-
5-
The project is now supporting the initial release of the v2 api (which uses websockets). Further updates are required once the security layer is implemented in the api.
6-
7-
## Hardware
8-
* An Esp32
9-
* A MFRC522
10-
* (Optional) A MAX98357a board and speaker
11-
* (Optional) PWM Rumble motor. You can use a preconstructed board or build your own using a transistor and motor.
12-
13-
## Required Libaries (Which may have their own dependencies)
14-
* MFRC55
15-
* ESP8266Audio
16-
* [NDEF-MFRC522](https://github.com/aroller/NDEF-MFRC522)
17-
* [Zaparoo Esp32 Launch Api](https://github.com/ZaparooProject/zaparoo-esp32-launch-api)
18-
19-
## Setup
20-
1. If you haven't already, downalod and install Arduino Studio.
21-
2. Install the above Libaries.
22-
3. Clone/Download the repository and open ZaparooEsp32.ino in Arunido Studio.
23-
4. Select your board and port, located in the Tools menu. If you do not have options for an Esp32, follow these [instrustions](https://docs.sunfounder.com/projects/umsk/en/latest/03_esp32/esp32_start/03_install_esp32.html) for installing the board configurations.
24-
5. Edit the ZaparooEsp32.hpp file to define your pins for the MFRC522, the Mister url (using the Remote port until TapTo 2.0, default 8182), and your Wifi credentials.
25-
6. (Optional) If you are planning to use a battery to power the Esp32, it might help to extend battery life by decreasing the CPU frequency under tools. If using the audio configuration, you need a min cpu of 160mhz.
26-
7. (Optional) Enable any of the settings in the optional section of the config by uncommenting the line and setting the correct value for your setup. See "Optional Setup" for more info.
27-
8. (Optional) If using audio options, make sure your "Partion Scheme" under tools is set to "Default xMB with spiffs". xMB will vary based on your board, but 4MB is common. After you upload the project, follow the instructons [here](https://randomnerdtutorials.com/arduino-ide-2-install-esp32-littlefs/) to upload a mp3 (test with [this gb sound effect](https://tuna.voicemod.net/sound/e4674ff7-386c-4932-9faf-e50c82d45099)).
28-
9. Compile and upload the project your esp32.
29-
30-
## Optional Setup
31-
These descriptions are for the optional config options found in the ZaparooEsp32.hpp file. Uncommment and edit the lines in the config if you want to enable them.
32-
1. SERIAL_ONLY: Uncommenting this setting will disable wifi. Only Simple Serial will be supported in this mode.
33-
2. MOTOR_PIN: Sends a pulse to this pin when WiFi is connected, a game is launched, or some error has occurred (see Error Feedback). It is intended for a small vibration motor to provide haptic feedback.
34-
3. WIFI_LED_PIN: This pin will enter a high state once a WiFi connection has been established.
35-
4. LAUNCH_LED_PIN: This pin mimics the behaviors the MOTOR_PIN, with a slightly different pulse behavior more suitable for an LED.
36-
5. EXTERNAL_POWER_LED: This pin will enter a High state as soon as the unit boots. This feature is useful if your enclousre blocks any built in LEDs.
37-
6. I2S_*: These pins are for a I2S module (such as a max98357a) to produce a launch sound. The audio file must be a mp3 file uploaded via LittleFs as described above.
38-
7. launchAudio: The name of the mp3 file that plays when a tag is launched.
39-
8. AUDIO_GAIN: How loud the speaker should be.
40-
41-
## Error Feedback
42-
If you choose to enable the Motor or Launch pins in the config file, you can get additional feedback when scanning a card:
43-
* 2 Pulses: Could not connect to Zaparoo
44-
* 3 Pulses: Zaparoo could not read the text, check your tag
45-
* 4 Pulses: Zaparoo sent a payload that could not be parsed to JSON.
46-
47-
## Portable Options
48-
It is possible to incorporate a battery to make a wireless NFC adapter. There are a two options to consider.
49-
1. An Adadfruit Feather Esp32: it has all the required hardware to run off a lipo battery. The downside is that even with a power switch to ground the enable pin, you can still get battery drain. If you add a swich on the battery, you can only charge when its powered on. It's also possible adding a motor and audio will be too much for the regulator to handle.
50-
2. Combine a lipo charging board, 5v buck converter, and a switch to power the board. This option require more assembly and reasearch but avoids the downsides of option one.
1+
# ZapEsp32
2+
3+
The goal of this project is to launch games via the [Zaparoo Service](https://wiki.zaparoo.org/Main_Page) on Mister/Steam over Wifi, with additional audio & rumble features. It also supports launching games via [Simple Serial](https://wiki.zaparoo.org/Reader_Drivers#Simple_Serial).
4+
5+
## Features:
6+
- Supports Universal launching for both MiSTer and Steam
7+
- Play Audio files for Card Detected, Game Launched, and Card Removed events.
8+
- Play game specific Audio Files for Game Launch and Card Removed events
9+
- SD Card Module support (Only Supported with PN532 Module installed).
10+
- A Web UI to
11+
- configure the ESP32's LED's, Rumble Motor, & Audio Module's GPIO pins (if installed),
12+
- change Zaparoo MiSTer and Steam connection settings.
13+
- upload audio files to SD Card (if enabled), or ESP32 SPIFFS partition.
14+
- Search for games & write NFC tag/Cards with extended information.
15+
- Set default detect, launch, error, and remove events audio files
16+
- Configure unique launch audio and card removal audio sounds per game/card.
17+
- Create Zaparoo Mapping DB entries to launch games from read-only NFC Tags/Amiibo's.
18+
- Set launch & remove event audio clip files for readonly RFID/NFC tags (eg amiibo)
19+
20+
21+
Please refer to the [wiki](https://github.com/MintyTrebor/zaparoo-esp32/wiki) for full info and build details

ZaparooEsp32.hpp

Lines changed: 115 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,115 @@
1-
#ifndef ZAPAROO_ESP32_H
2-
#define ZAPAROO_ESP32_H
3-
4-
//Reguired Configuration-------------------------------------------------
5-
6-
//The SS/SDA and Reset pins of the MFRC522
7-
#define SS_PIN 5
8-
#define RST_PIN 26
9-
10-
//Wifi and zaparoo information
11-
const char* ssid = "NetworkName";
12-
const char* password = "Password";
13-
const String zaparooUrl = "ws://mister.local:7497";
14-
15-
//Uncomment if serial only, wifi credentials will not be used
16-
//#define SERIAL_ONLY
17-
18-
//-----------------------------------------------------------------------
19-
20-
//Optional Configurations------------------------------------------------
21-
22-
//Uncomment if using a vibration motor for haptic feedback
23-
//#define MOTOR_PIN 25
24-
25-
//Uncomment if using a led to display wifi status
26-
//#define WIFI_LED_PIN 4
27-
28-
//Uncomment if using a led to display launch status
29-
//#define LAUNCH_LED_PIN 33
30-
31-
//Uncomment if using a led to display power indicator
32-
//#define EXTERNAL_POWER_LED 22
33-
34-
//Uncomment if using a I2S module to produce audio
35-
//#define I2S_DOUT 26
36-
//#define I2S_BCLK 17
37-
//#define I2S_LRC 21
38-
//#define AUDIO_GAIN 1 //Value 0.1 - 4
39-
//const char* launchAudio = "/gbc-startup.mp3";
40-
41-
//-----------------------------------------------------------------------
42-
#endif
1+
#ifndef ZAPAROO_ESP32_H
2+
#define ZAPAROO_ESP32_H
3+
4+
//*********************Reguired Configuration******************************
5+
6+
//uncomment for RC522----------------------------------------------------
7+
//#define RC522
8+
//-----------------------------------------------------------------------
9+
10+
11+
//uncomment for PN532----------------------------------------------------
12+
#define PN532
13+
//The GPIO pin the PN532 RSTPDN Pin is connected to ((***NOT THE PN532 RSTO PIN***)).
14+
//This is essential for stability and recovery after an esp32 soft reset.
15+
#define PN532_RST_PIN 13
16+
//------------------------------------------------------------------------
17+
18+
//Common Config----------------------------------------------------------
19+
//The SS/SDA and Reset pins of the RC522 or SD Card using the default SPI GPIO pins of your ESP32
20+
#define SS_PIN 5
21+
#define RST_PIN 4
22+
//------------------------------------------------------------------------
23+
24+
#endif
25+
26+
27+
//INFO ------------------------------------------------------------------------
28+
//DEFAULT ESP32S3 GPIO PIN ASSIGNMENTS
29+
// PN532 Module
30+
// (Check your ESP32's default I2C pins as the code uses them by default)
31+
// SDA 8
32+
// SCL 9
33+
// RSTPDN 36 (Can be reassigned above with PN532_RST_PIN)
34+
35+
// SDCARD or RC522 Module
36+
// (Check your ESP32's default vspi pins as the code uses them by default)
37+
// SDA 10 (Can be reassigned above with SS_PIN)
38+
// SCK 12
39+
// MOSI 11
40+
// MISO 13
41+
// RST 4 (Can be reassigned above with RST_PIN)
42+
43+
// LED's !!Configurable in Web UI!!
44+
// WIFI 2 (This is normally replicates the cards wifi led, but it may be a different gpio on your esp32)
45+
// PWR 37
46+
// Launch 39
47+
48+
// Rumble Motor !!Configurable in Web UI!!
49+
// Motor 35
50+
51+
// Audio MAX98357 Module !!Configurable in Web UI!!
52+
// DOUT 17
53+
// BCLK 16
54+
// LRC 15
55+
// GAIN GND
56+
57+
//INFO ------------------------------------------------------------------------
58+
//DEFAULT ESP32S2 Mini GPIO PIN ASSIGNMENTS
59+
// PN532 Module
60+
// (Check your ESP32's default I2C pins as the code uses them by default)
61+
// SDA 8
62+
// SCL 9
63+
// RSTPDN 12 (Can be reassigned above with PN532_RST_PIN)
64+
65+
// SDCARD or RC522 Module
66+
// (Check your ESP32's default vspi pins as the code uses them by default)
67+
// SDA 34 (Can be reassigned above with SS_PIN)
68+
// SCK 36
69+
// MOSI 35
70+
// MISO 34
71+
// RST 4 (Can be reassigned above with RST_PIN)
72+
73+
// LED's !!Configurable in Web UI!!
74+
// WIFI 11 (This is normally replicates the cards wifi led, but it may be a different gpio on your esp32)
75+
// PWR 6
76+
// Launch 4
77+
78+
// Rumble Motor !!Configurable in Web UI!!
79+
// Motor 11
80+
81+
// Audio MAX98357 Module !!Configurable in Web UI!!
82+
// DOUT 17
83+
// BCLK 16
84+
// LRC 15
85+
// GAIN GND
86+
87+
//INFO ------------------------------------------------------------------------
88+
//DEFAULT ESP32 GPIO PIN ASSIGNMENTS
89+
// PN532 Module
90+
// (Check your ESP32's default I2C pins as the code uses them by default)
91+
// SDA 21
92+
// SCL 22
93+
// RSTPDN 13 (Can be reassigned above with PN532_RST_PIN)
94+
95+
// SDCARD or RC522 Module
96+
// (Check your ESP32's default vspi pins as the code uses them by default)
97+
// SDA 5 (Can be reassigned above with SS_PIN)
98+
// SCK 18
99+
// MOSI 23
100+
// MISO 19
101+
// RST 4 (Can be reassigned above with RST_PIN)
102+
103+
// LED's !!Configurable in Web UI!!
104+
// WIFI 2 (This is normally replicates the cards wifi led, but it may be a different gpio on your esp32)
105+
// PWR 15
106+
// Launch 33
107+
108+
// Rumble Motor !!Configurable in Web UI!!
109+
// Motor 32
110+
111+
// Audio MAX98357 Module !!Configurable in Web UI!!
112+
// DOUT 25
113+
// BCLK 27
114+
// LRC 26
115+
// GAIN GND

0 commit comments

Comments
 (0)