biologist79 / espuino Goto Github PK
View Code? Open in Web Editor NEWRFID-controlled musicplayer powered by ESP32
Home Page: https://forum.espuino.de
License: GNU General Public License v3.0
RFID-controlled musicplayer powered by ESP32
Home Page: https://forum.espuino.de
License: GNU General Public License v3.0
I tried to order your PCBs form jlcpcb as you suggested but after review they sent me an email:
Audit Failed
Failure Reason:
1.Hi Sir/ Madam, there is no board outline in your file, please kindly check it!
Can your recheck the board?
Thank you very much for this great project!
The days I came up with another idea, what I would like to implement with the box:
To help our daughter learn colors, I painted her RFDI cards with colors (red, green, blue, etc.).
When she puts the card on, a track is played to her that explains what the color is called.
Now I have the idea that I could link the whole thing via MQTT with the light chain on the Christmas tree.
Speak:
I put on a card, get the ID via MQTT, which I use in HomeAssistant or NodeRed to change the color of the lights on the Christmas tree.
Yesterday I noticed a little something:
According to the documentation on the home page "topicTrackState" should send the following: "Sends number of last RFID-tag applied".
That would be great and would work perfectly, since the ID is always unique for each card.
Instead, however, the current track is published via MQTT, which is not always unique due to random modes, etc.
Would it be possible to publish two different topics for the title and the rfid tag?
Hi,
if rotary is disabled, there is no chance to use button_3 aka ROTARYENCODER_BUTTON.
I suggest, to exclude ROTARYENCODER_BUTTON from the USEROTARY_ENABLE section and change the other code parts allowing ROTARYENCODER_BUTTON to be used as a normal button without having a rotary.
// Rotary encoder
#ifdef USEROTARY_ENABLE
#define ROTARYENCODER_CLK 34 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware)
#define ROTARYENCODER_DT 39 // 39 = 'VN'; rotary's encoder
#endif
// Amp enable (optional)
#define GPIO_PA_EN 108 // To enable/disable amp for loudspeaker; connected to port-expander
// Control-buttons
#define NEXT_BUTTON 102 // Next-Button: connected to port-expander
#define PREVIOUS_BUTTON 100 // Prev-Button: connected to port-expander
#define PAUSEPLAY_BUTTON 101 // Pplay-Button: connected to port-expander
----------new---------
#define ROTARYENCODER_BUTTON 103 // Set to 99 to disable the button; connected to port-expander
-------------------------
#define BUTTON_4 104 // Button 4: connected to port-expander
#define BUTTON_5 105 // Button 5: connected to port-expander
Thanks for consideration.
Best regrads,
GL
IDs btw managment GUI and handler do not match for dimming the LEDs (112 vs 120):
management.html
<option value="112">Dimme LEDs (Nachtmodus)</option>
main.cpp
// RFID-modifcation-types
...
#define DIMM_LEDS_NIGHTMODE 120 // Changes LED-brightness
Are there any recommendations for stereo DACs? I need to drive two of these: https://www.ebay.de/itm/150510938590
Currently I'am experimenting with this DAC on my own breakout board: TI TLV320DAC3101. But I'am struggling heavily with all the BCLK/MCLK stuff. Do I need a dedicated Bit clock for this DAC or is it generated from the MCLK? I'am really confused :D
Just a minor doc request (because it took me a while to figure out why my MQTT connection was not working any more): It might be worth to mention that the MQTT topic also changed to "ESPuino" and that the settings on the MQTT clients have to be updated.
Hi,
Use case:
Hey!
I want to thank you for the great project so far.
I have the ESP32-A1S Audio-Development-Kit here and i want to ask if its not possible to define a second I2C instance to use for the RC522. Personally i dont want to use the neopixel and rotary encoder. There would be enough GPIO for this and some keys to connect (ex: pause/play, next, stop)
Via this I2C there would also be an optional display possible.
This would be a good solution for everyone not willing to solder.
Hallo,
es gelingt mir nicht, mehrere Files oder ganze Verzeichnisse per ftp zu übertragen. Einzelne Files nacheinander klappt.
Ich nutze FileZilla auf Ubuntu, nur damit ist es mir gelungen überhaupt eine ftp-Verbindung vernünftig aufzubauen, da man TLS gezielt ausschalten/verhindern muss.
LG Reinhard
Since the repo was moved, it might be a good idea to give a hint how to change the URL (using git remote set-url; see https://docs.github.com/en/github/using-git/changing-a-remotes-url)
% git remote -v
origin https://github.com/biologist79/Tonuino-ESP32-I2S.git (fetch)
origin https://github.com/biologist79/Tonuino-ESP32-I2S.git (push)
% git remote set-url origin https://github.com/biologist79/ESPuino.git
% git remote -v
origin https://github.com/biologist79/ESPuino.git (fetch)
origin https://github.com/biologist79/ESPuino.git (push)
Just want to let you know that i am working on a File Browser for making RFID-assignments more convenient.
There will be a json file on the SD-Card which contains the current file tree of the SD-Card. The file is created by a function in the backend code. This function can be called by a websocket request.The request can be sent by clicking the link below the file Browser box.
The file is loaded by an ajax call. I am using jsTree for creating the dom.
I made it this way, because i wanted to prevent long blocking times for example in the setup() routine. The refresh link can be called after new files were copied to the SD-Card.
I will do a pull request when it's done. I am still struggling with the json formating.
Hallo,
es gelingt mir nicht, mehrere Files oder ganze Verzeichnisse per ftp zu übertragen. Einzelne Files nacheinander klappt.
Ich nutze FileZilla auf Ubuntu, nur damit ist es mir gelungen überhaupt eine ftp-Verbindung vernünftig aufzubauen, da man TLS gezielt ausschalten/verhindern muss.
LG Reinhard
... because there is an extra parenthesis:
line 459:
current version:
loggerNl(serialDebug,((char *) FPSTR(unableToRestoreLastRfidFromNVS), LOGLEVEL_INFO);
fix:
loggerNl(serialDebug,(char *) FPSTR(unableToRestoreLastRfidFromNVS), LOGLEVEL_INFO);
Instead of using the Headphone Jack, the ESP32 could also stream the sound to Bluetooth headphones. Unfortunately according to this ticket, it's not integrated into the ESP32 Arduino library but maybe someone has an idea. If I find the time, maybe I will work on it myself.
Feedback welcome!
Hi again.
I am currently trying to implement audio feedback. So e.g. when the box starts, next track etc. there is also a voice output.
Currently I see two options:
I like option 2, I tried option 1 and it breaks the playlist, when being used within a queue being played. For option 1 I am currently missing more information on how the MAX device and the I2S protocol is designed. Can we have a parallel connection ? Or how can we enable sound output while keeping te queue structure in place?
Any ideas welcome.
Thanks a lot.
Hey,
MQTT-Nachricht empfangen: [Topic: Cmnd/ESPuino/SleepTimer] [Command: EOT]
Sleep-Timer: Nach dem Ende des laufenden Tracks.
MQTT-Nachricht empfangen: [Topic: Cmnd/ESPuino/SleepTimer] [Command: 0]
Sleep-Timer ist bereits deaktiviert.
After EOP, EOT, and EO5T is set, it cannot be deactivated by mqtt command. The device device goes to deep sleep mode although the log says the timer is deactivated.
Thanks and best regards
GL
Hi,
ich nutze ein M5 Core (Geniales Teil!).
Meinst du es ist möglich, den Code darauf laufen zu lassen, und den internen Speakter + SDCard Slot + Display anzusteuern ? Quasi -> All in one Lösung ?!
Viele Grüße...
Hallo,
es wäre super wenn du bei MQTT noch den Port in der WebGui anpassbar machen könntest.
Hello,
do you have a Partlist for the Headphone PCB?
Thanks.
Hi,
scenario:
Behavior:
Desired behaviour:
Logs:
RFID-Karte empfangen: 000023146130
[E][vfs_api.cpp:64] open(): /sdcard/musicfox_its_not_easy.mp3 does not exist
Datei oder Verzeichnis existiert nicht
Fehler aufgetreten!
Kontroll-Kommando empfangen via Queue: 1
Playmode kann nicht verändert werden, wenn keine Playlist aktiv ist.
ws[/ws][1] connect
Version:
ESP-IDF-version (major): 3
ESP-IDF-version (minor): 3
Software-revision: 20211222-1
Thanks for reply.
Regards,
GL
Edit:
I think I need to understand: lockControls
better.
I have hooked up an LED ring and it mostly works, i.e.
But I can't get the rainbow hue working whilst playing a single MP3 file.
When playing a single file the LEDs turn off.
When playing a webstream I get 2 opposite red LEDs (not animated)
My question is:
Is this intended behaviour? (to safe battery)
If I were to implement it, do I need to create another LED state like ledStatusOk
, ledStatusError
?
Hi,
having only three modules activated:
Issues:
Deactivating HEADPHONE_ADJUST_ENABLE --> RFID is working + no strange log console
Thanks and best regards,
GL
Hi,
just saw that there is a strange interference between the Rotary Encoder and the RC522. When I do a short press on the Rotary Encoder Button (for voltage measurements) and put then a card onto the RFID reader, the application crashes.
The error is LoadProhibited and the EXCVADDR Register is 0. According to the documentation this an indication for dereferencing a Null Pointer.
The Backtrace is as follows:
0x401d76d1: MFRC522::PICC_ReadCardSerial() at E:\workspace\Tonuino-ESP32-I2S/.pio\libdeps\lolin_d32_pro\MFRC522\src/MFRC522.cpp:1928
0x400daf26: rfidScanner(void*) at E:\workspace\Tonuino-ESP32-I2S/src/main.cpp:1797
Is someone else able to reproduce it?
I can have a closer look into it after Christmas.
Cheers
Hi!
Ist geplant ein Board (PCB) für das Projekt zu machen? Ich habe gerade die Bauteile vor mir aber ich bin erst bei der Hälfte und es sieht schon wüst aus.
Ich könnte ein Board entwerfen und es zur Verfügung stellen.
Könntest du dann den Entwurf checken?
hi,
with the Commit cc6df6d
you deleted way to much. Now the gerber zip and kicad project files are not available any more. Please revert this change of at least the kicad files.
WBR Philipp
Is it possible to implement a mode, where I can create an RDID mapping + content on the SD card but reset my local Wifi configuration?
i.e. I want to prepare this Box as a present but I don't know the SSID/PW of the person who gets the present.
Is this maybe already somehow implemented?
How would you suggest to tackle this problem?
I am trying to use the ttgo t8 v1.7 in my project. It has an onboard card reader. Unfortunately I can't get the RFID reader (RC522) to work. I saw that you @biologist79 have played around with different SPI configurations on different boards and was wondering if you have an idea what I do wrong or what I could try to get the RFID reader work. Previous to this project I had no experience with SPI.
Here is my configuration:
//#define SINGLE_SPI_ENABLE // If only one SPI-instance should be used instead of two (not yet working!)
// uSD-card-reader (via SPI)
#define SPISD_CS 13 // <- changed from 15 // GPIO for chip select (SD)
#ifndef SINGLE_SPI_ENABLE
#define SPISD_MOSI 15 // <- changed from 13 // GPIO for master out slave in (SD) => not necessary for single-SPI
#define SPISD_MISO 2 // <- changed from 16 // GPIO for master in slave ou (SD) => not necessary for single-SPI
#define SPISD_SCK 14 // GPIO for clock-signal (SD) => not necessary for single-SPI
#endif
// RFID (via SPI)
#define RST_PIN 99 // Not necessary but has to be set anyway; so let's use a dummy-number
#define RFID_CS 21 // GPIO for chip select (RFID)
#define RFID_MOSI 23 // GPIO for master out slave in (RFID)
#define RFID_MISO 19 // GPIO for master in slave out (RFID)
#define RFID_SCK 18 // GPIO for clock-signal (RFID)
Hi! First of all - great job! I was looking for adding FTP support to the Tonuino project when I found your repo, thanks for the great documentation.
I really like the way of handling audio on the esp rather than using the dfplayer.
When trying out your image, I noticed that the RFID reader is quit slow / doesn't pick up cards as easy as with sample code from the repo.
I changed cables etc, but when I use a basic sketch to try out the chip, it works as supposed.
I had a quick look at your code and couldn't find a delay other than the 300ms in line 1467.
Since I am not too much into the library for the RC522, my fist guess is, that line https://github.com/biologist79/Tonuino-ESP32-I2S/blob/bfb8d81af2914f16de721057272625c5ad056082/src/main.cpp#L1471 will check for a new card. If I hold the same card, it will not trigger. However, if I try three different tags, all not known to the device, it will only pick up 1 of them instantly. Sometimes it helps to hold the card above or underneath the device, however it picks them up rather slow..
I will investigate further, maybe others have the same issue and we can exchange ideas here. Thanks!
I think it would be nice if there is a more elegant way for handling i18n. In my opinion the serial debug (backend) translations are not so important. More important is the user interface stuff. A more elegant way for handling translations would be using a JavaScript i18n Library. I know more JavaScript stuff :) But let the heavy stuff happen in the frontend where the Browser can handle the mighty heavy String handling stuff.
My idea is:
However this will bring the benefit that even people without programming skills can commit something to the project, furthermore there is less static code in header files and only one html file needed to edit.
Needs to be investigated
In settings.h sollten die Dateinamen für die Includedateien so geschrieben sein wie die Dateien heißen, da z.B. Linux hier Fehler meldet.
In settings.h the filenames for the include files should be written as the files are named, because e.g. Linux reports errors here.
After a couple of weeks playing with the device i figured out that files don't play from the beginning. Mostly the file starts a couple of seconds after the regular beginning of the file. Sometimes it seems to start somewhere in the middle of the file. The file is ok so far. When i play it on another device it works. This behaviour does not match all my mp3 files. I tried all of the play (audiobook, single track etc.) modes but it occurs in all play modes.
Anybody who can confirm a similar issue?
I am coming to the conclusion that this might be a mp3 encoding issue, cause it works with some of my older files. I am using the suggested hardware components.
Can some people please share some encoding information about the used mp3 files like sample rate etc. That might help debugging the issue.
Hello there,
some weeks ago, you have provided the new and detailed BOM for the PCB's. Now we have the problem, that in the BOM for the Headphone PCB is a IC1 (ME6211C33m5g) written but we cant find the IC1 in the Schematic / on the ordered PCB. Do you have a solution fot that?
I'm trying to use this SD-Modul but the SD-Card could not be mounted.
[E][sd_diskio.cpp:739] sdcard_mount(): f_mount failed 0x(3)
Do I need to use the SD-MMC Mode?
As ESP I use the ESP32-WROOM-32 from AZ-Delivery
Hi all,
UseCase (SW-Revision: 20211113-2):
Thanks and regards,
GL
Hi,
first of all thank you for the great work you did!
I face a problem, that the Esp32 is rebooting from time to time. I narrowed it down, that it happens when NVS data is written.
The reason is that a core panic'ed:
Titel wurde bei Position 483427 pausiert. Schreibe '#/ManaMana#483427#3#0' in NVS für RFID-Card-ID 164177162177 mit playmode 3 und letzter Track 0 #/ManaMana#483427#3#0 Guru Meditation Error: Core 0 panic'ed (Cache disabled but cached memory region accessed) Core 0 register dump: PC : 0x401826cc PS : 0x00060034 A0 : 0x800813dd A1 : 0x3ffbe180 A2 : 0x00000000 A3 : 0x3ffc1530 A4 : 0xc86f19be A5 : 0x00001004 A6 : 0x3ffc5ad0 A7 : 0xffffeffb A8 : 0x80081332 A9 : 0x3ffbe160 A10 : 0x00000000 A11 : 0x00000000 A12 : 0x0ffd114c A13 : 0x00000000 A14 : 0x000f8023 A15 : 0x00000002 SAR : 0x00000014 EXCCAUSE: 0x00000007 EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000 Core 0 was running in ISR context: EPC1 : 0x4008ad89 EPC2 : 0x00000000 EPC3 : 0x40088e44 EPC4 : 0x401826cc
To reproduce it I use the Audiobook mode and toggle Play/Pause Button as long as the problem occurs.
It seems that I found with the help of google the reason:
https://esp32.com/viewtopic.php?t=7684
However, I'm not able to solve it so far and created therefore this issue.
Is this a known issue?
Hi,
it seems, that the build in sd card reader of the D32 pro is not compatible with PN5180-NFC. Let us see if it is a layer 8 issue... ;)
Unneeded pins are set to 99.
The following scenarios are tested:
(Not tested: MFRC522_SPI activted, PN5180 deactivated, RFID PINS to default --> I do not have a MFRC522)
Definition of OK: web server is accessible and music can be played.
Why NOK: Output is constant:
Maximale Inaktivitätszeit wurde aus NVS geladen: 10
Firmware version=0.0
RFID-Tags koennen jetzt gescannt werden...
[E][sd_diskio.cpp:194] sdCommand(): Card Failed! cmd: 0x37
[E][sd_diskio.cpp:194] sdCommand(): Card Failed! cmd: 0x29
[E][sd_diskio.cpp:775] sdcard_mount(): f_mount failed: (3) The physical drive cannot work
[E][sd_diskio.cpp:194] sdCommand(): Card Failed! cmd: 0x00
SD-Karte konnte nicht gemountet werden.
[E][sd_diskio.cpp:194] sdCommand(): Card Failed! cmd: 0x00
[E][sd_diskio.cpp:775] sdcard_mount(): f_mount failed: (3) The physical drive cannot work
[E][sd_diskio.cpp:194] sdCommand(): Card Failed! cmd: 0x00
SD-Karte konnte nicht gemountet werden.
SW-Version:
ESP-IDF-version (major): 3
ESP-IDF-version (minor): 3
Software-revision: 20211123-1
settings.h:
//########################## MODULES #################################
//#define PORT_EXPANDER_ENABLE // When enabled, buttons can be connected via port-expander PCA9555 (https://forum.espuino.de/t/einsatz-des-port-expanders-pca9555/306)
//#define I2S_COMM_FMT_LSB_ENABLE // Enables FMT instead of MSB for I2S-communication-format. Used e.g. by PT2811. Don't enable for MAX98357a, AC101 or PCM5102A)
#define MDNS_ENABLE // When enabled, you don't have to handle with ESPuino's IP-address. If hostname is set to "ESPuino", you can reach it via ESPuino.local
//#define MQTT_ENABLE // Make sure to configure mqtt-server and (optionally) username+pwd
//#define FTP_ENABLE // Enables FTP-server; DON'T FORGET TO ACTIVATE AFTER BOOT BY PRESSING PAUSE + NEXT-BUTTONS (IN PARALLEL)!
//#define NEOPIXEL_ENABLE // Don't forget configuration of NUM_LEDS if enabled
//#define NEOPIXEL_REVERSE_ROTATION // Some Neopixels are adressed/soldered counter-clockwise. This can be configured here.
#define LANGUAGE DE // DE = deutsch; EN = english
//#define STATIC_IP_ENABLE // Enables static IP-configuration (change static ip-section accordingly)
//#define HEADPHONE_ADJUST_ENABLE // Used to adjust (lower) volume for optional headphone-pcb (refer maxVolumeSpeaker / maxVolumeHeadphone) and to enable stereo (if PLAY_MONO_SPEAKER is set)
//#define PLAY_MONO_SPEAKER // If only one speaker is used enabling mono should make sense. Please note: headphones is always stereo (if HEADPHONE_ADJUST_ENABLE is active)
#define SHUTDOWN_IF_SD_BOOT_FAILS // Will put ESP to deepsleep if boot fails due to SD. Really recommend this if there's in battery-mode no other way to restart ESP! Interval adjustable via deepsleepTimeAfterBootFails.
//#define MEASURE_BATTERY_VOLTAGE // Enables battery-measurement via GPIO (ADC) and voltage-divider
//#define PLAY_LAST_RFID_AFTER_REBOOT // When restarting ESPuino, the last RFID that was active before, is recalled and played
//#define USE_LAST_VOLUME_AFTER_REBOOT // Remembers the volume used at last shutdown after reboot
//#define USEROTARY_ENABLE // If rotary-encoder is used (don't forget to review WAKEUP_BUTTON if you disable this feature!)
//#define BLUETOOTH_ENABLE // If enabled and bluetooth-mode is active, you can stream to your ESPuino via bluetooth (a2dp-sink).
//#define IR_CONTROL_ENABLE // Enables remote control (https://forum.espuino.de/t/neues-feature-fernsteuerung-per-infrarot-fernbedienung/265)
//#define CACHED_PLAYLIST_ENABLE // Enables playlist-caching (infos: https://forum.espuino.de/t/neues-feature-cached-playlist/515)
//#define PAUSE_WHEN_RFID_REMOVED // Playback starts when card is applied and pauses automatically, when card is removed (https://forum.espuino.de/t/neues-feature-pausieren-wenn-rfid-karte-entfernt-wurde/541)
//#define SAVE_PLAYPOS_BEFORE_SHUTDOWN // When playback is active and mode audiobook was selected, last play-position is saved automatically when shutdown is initiated
//#define SAVE_PLAYPOS_WHEN_RFID_CHANGE // When playback is active and mode audiobook was selected, last play-position is saved automatically for old playlist when new RFID-tag is applied
//################## select SD card mode #############################
//#define SD_MMC_1BIT_MODE // run SD card in SD-MMC 1Bit mode (using GPIOs 15 + 14 + 2 is mandatory!)
//#define SINGLE_SPI_ENABLE // If only one SPI-instance should be used instead of two (not yet working!)
//################## select RFID reader ##############################
//#define RFID_READER_TYPE_MFRC522_SPI // use MFRC522 via SPI
//#define RFID_READER_TYPE_MFRC522_I2C // use MFRC522 via I2C
#define RFID_READER_TYPE_PN5180 // use PN5180 via SPI
#ifdef RFID_READER_TYPE_MFRC522_I2C
#define MFRC522_ADDR 0x28 // default I2C-address of MFRC522
#endif
#ifdef RFID_READER_TYPE_PN5180
//#define PN5180_ENABLE_LPCD // Wakes up ESPuino if RFID-tag was applied while deepsleep is active. Only ISO-14443-tags are supported for wakeup!
#endif
settings-lolin_d32_pro.h:
#ifndef __ESPUINO_SETTINGS_LOLIN_D32_PRO_H__
#define __ESPUINO_SETTINGS_LOLIN_D32_PRO_H__
#include "Arduino.h"
//######################### INFOS ####################################
/* This is a develboard-specific config-file for *Wemos Lolin32*. Specific doesn't mean it's only working with this board.
Lolin32 is the predecessor of Lolin D32.
PCB: None so far
Infos: https://www.wemos.cc/en/latest/d32/d32_pro.html
Schematics: https://www.wemos.cc/en/latest/_static/files/sch_d32_pro_v2.0.0.pdf
Caveats: GPIO35 (battery monitoring) + SD can't be changed, it's built in (and because of the SD-pinout used, it is not compatible with MMC-mode)
Status:
tested with 2xSPI: RC522 & SD (by biologist79)
*/
//################## GPIO-configuration ##############################
// Please note: GPIOs 34, 35, 36, 39 are input-only and don't have pullup-resistors.
// So if connecting a button to these, make sure to add a 10k-pullup-resistor for each button.
// Further infos: https://randomnerdtutorials.com/esp32-pinout-reference-gpios/
// GPIOs 16+17 are not available for D32 pro as they're used to internal purposes (PSRAM).
#ifdef SD_MMC_1BIT_MODE
// NOT SUPPORTED BY D32 pro as 15 / 14 / 2 doesn't match D32 pro's SD-pinout
#else
// uSD-card-reader (via SPI) => Cannot be changed, it's built in!
#define SPISD_CS 4 // GPIO for chip select (SD)
#ifndef SINGLE_SPI_ENABLE
#define SPISD_MOSI 23 // GPIO for master out slave in (SD) => not necessary for single-SPI
#define SPISD_MISO 19 // GPIO for master in slave ou (SD) => not necessary for single-SPI
#define SPISD_SCK 18 // GPIO for clock-signal (SD) => not necessary for single-SPI
#endif
#endif
// RFID (via SPI)
#define RST_PIN 99 // Not necessary but has to be set anyway; so let's use a dummy-number
#define RFID_CS 99//21 // GPIO for chip select (RFID)
#define RFID_MOSI 99//13 // GPIO for master out slave in (RFID)
#define RFID_MISO 99//15 // GPIO for master in slave out (RFID)
#define RFID_SCK 99//14 // GPIO for clock-signal (RFID)
#ifdef RFID_READER_TYPE_PN5180
#define RFID_BUSY 99//33 // PN5180 BUSY PIN
#define RFID_RST 99//22 // PN5180 RESET PIN
#define RFID_IRQ 99//39 // PN5180 IRQ PIN (only needed for low power card detection)
#endif
// I2S (DAC)
#define I2S_DOUT 25 // Digital out (I2S)
#define I2S_BCLK 27 // BCLK (I2S)
#define I2S_LRC 26 // LRC (I2S)
// Rotary encoder
#ifdef USEROTARY_ENABLE
#define ROTARYENCODER_CLK 99//34 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware)
#define ROTARYENCODER_DT 99//39 // 39 = 'VN'; Info: Lolin D32 pro is using 35 for battery-voltage-monitoring!
#define ROTARYENCODER_BUTTON 99//32 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander)
#endif
// Amp enable (optional)
//#define GPIO_PA_EN 112 // To enable amp for loudspeaker (GPIO or port-channel)
//#define GPIO_HP_EN 113 // To enable amp for headphones (GPIO or port-channel)
// Control-buttons (set to 99 to DISABLE; 0->39 for GPIO; 100->115 for port-expander)
#define NEXT_BUTTON 99 // Button 0: GPIO to detect next
#define PREVIOUS_BUTTON 99 // Button 1: GPIO to detect previous
#define PAUSEPLAY_BUTTON 99 // Button 2: GPIO to detect pause/play
#define BUTTON_4 99 // Button 4: unnamed optional button
#define BUTTON_5 99 // Button 5: unnamed optional button
// Channels of port-expander can be read cyclic or interrupt-driven. It's strongly recommended to use the interrupt-way!
// Infos: https://forum.espuino.de/t/einsatz-des-port-expanders-pca9555/306
#ifdef PORT_EXPANDER_ENABLE
#define PE_INTERRUPT_PIN 99 // GPIO that is used to receive interrupts from port-expander
#endif
// I2C-configuration (necessary for RC522 [only via i2c - not spi!] or port-expander)
#if defined(RFID_READER_TYPE_MFRC522_I2C) || defined(PORT_EXPANDER_ENABLE)
#define ext_IIC_CLK 99//5 // i2c-SCL (clock)
#define ext_IIC_DATA 99//2 // i2c-SDA (data)
#endif
// Wake-up button => this also is the interrupt-pin if port-expander is enabled!
// Please note: only RTC-GPIOs (0, 4, 12, 13, 14, 15, 25, 26, 27, 32, 33, 34, 35, 36, 39, 99) can be used! Set to 99 to DISABLE.
// Please note #2: this button can be used as interrupt-pin for port-expander. If so, all pins connected to port-expander can wake up ESPuino.
#define WAKEUP_BUTTON PREVIOUS_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep.
// (optional) Power-control
#define POWER 99//5 // GPIO used to drive transistor-circuit, that switches off peripheral devices while ESP32-deepsleep
// (optional) Neopixel
#define LED_PIN 99//12 // GPIO for Neopixel-signaling
// (optinal) Headphone-detection
#ifdef HEADPHONE_ADJUST_ENABLE
//#define DETECT_HP_ON_HIGH // Per default headphones are supposed to be connected if HT_DETECT is LOW. DETECT_HP_ON_HIGH will change this behaviour to HIGH.
#define HP_DETECT 99/22 // GPIO that detects, if there's a plug in the headphone jack or not
#endif
// (optional) Monitoring of battery-voltage via ADC
#ifdef MEASURE_BATTERY_VOLTAGE
#define VOLTAGE_READ_PIN 99//35 // GPIO used to monitor battery-voltage. Cannot be changed, it's built in
constexpr float referenceVoltage = 3.30; // Voltage between 3.3V and GND-pin at the develboard in battery-mode (disconnect USB!)
constexpr float offsetVoltage = 0.1; // If voltage measured by ESP isn't 100% accurate, you can add an correction-value here
#endif
// (optional) For measuring battery-voltage a voltage-divider is already onboard. Connect a LiPo and use it!
#ifdef MEASURE_BATTERY_VOLTAGE
constexpr uint16_t rdiv1 = 100; // Cannot be changed, it's built in
constexpr uint16_t rdiv2 = 100; // Cannot be changed, it's built in
#endif
// (Optional) remote control via infrared
#ifdef IR_CONTROL_ENABLE
#define IRLED_PIN 99//22 // GPIO where IR-receiver is connected (only tested with VS1838B)
#define IR_DEBOUNCE 200 // Interval in ms to wait at least for next signal (not used for actions volume up/down)
// Actions available. Use your own remote control and have a look at the console for "Command=0x??". E.g. "Protocol=NEC Address=0x17F Command=0x68 Repeat gap=39750us"
// Make sure to define a hex-code not more than once as this will lead to a compile-error
// https://forum.espuino.de/t/neues-feature-fernsteuerung-per-infrarot-fernbedienung/265
#define RC_PLAY 0x68 // command for play
#define RC_PAUSE 0x67 // command for pause
#define RC_NEXT 0x6b // command for next track of playlist
#define RC_PREVIOUS 0x6a // command for previous track of playlist
#define RC_FIRST 0x6c // command for first track of playlist
#define RC_LAST 0x6d // command for last track of playlist
#define RC_VOL_UP 0x1a // Command for volume up (one step)
#define RC_VOL_DOWN 0x1b // Command for volume down (one step)
#define RC_MUTE 0x1c // Command to mute ESPuino
#define RC_SHUTDOWN 0x2a // Command for deepsleep
#define RC_BLUETOOTH 0x72 // Command to enable/disable bluetooth
#define RC_FTP 0x65 // Command to enable FTP-server
#endif
#endif
The first sentence in the news section makes no sense:
"As the creator of ESPuino claims it's trademarkt right, my project has been renamed to ESPuino."
Here the global search/replace also changed the name of the original project (TonUINO).
I enabled MQTT with IP, user and password.
On serial I see the correct credentials from NVS.
In the mosquitto log I don't see anything from the client, no connection trials.
Hello,
first I want to thank you for your great work!
Unfortunately I am struggling to get everything to work. So far I only have the sd card module and the rfid reader connected. I had some issues to get the sd card reader to work with my Lolin32 Lite (no 5V pin) but managed to solve the issue by using a external 5V source to power the sd card module. This is not a nice solution but it works for the moment.
After connecting to the access point, changing the wifi settings and restarting the esp is not properly connected to the network. I can see the device in the fritz!box settings but it has no IP assigned. DHCP is aktivated.
The output also looks really weird:
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 2 - STA_START
Hostname aus NVS geladen: jettebox
Firmware Version: 0xEF = (unknown)
RFID-Tags koennen jetzt gescannt werden...
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 7 - STA_GOT_IP
[D][WiFiGeneric.cpp:418] _eventCallback(): STA IP: 255.255.255.255, MASK: 255.255.255.255, GW: 255.255.255.255
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 7 - STA_GOT_IP
[D][WiFiGeneric.cpp:418] _eventCallback(): STA IP: 255.255.255.255, MASK: 255.255.255.255, GW: 255.255.255.255
.Aktuelle IP: 255.255.255.255
SD Card Type: SDHC
Free heap: 153464
Versuche Verbindung zu MQTT-Broker aufzubauen 192.168.2.43
Verbinde zu MQTT-Server mit User und Passwort
Neue Lautstärke empfangen via Queue: 3
Have you experienced similar problems or do you have any idea what might cause the problem?
Um den D32 pro, der häufig 16MB Flash besitzt zu nutzen müsste in die Platformio.ini
board_upload.maximum_size = 16777216
board_upload.flash_size = 16MB
eingesetzt werden.
platformio/platform-espressif32#482 (comment)
Hi,
what license is this code? I would suggest GPL v3 (same as Tonuino project).
Hallo,
Danke erstmal für das tolle Projekt.
Ich habe bereits die vorherige Version mit einer nodemcu am laufen gehabt, und will mir jetzt die neue Version auf Basis des Lolin32 aufbauen. Habe mir hierzu deine PCBs und die anderen Komponenten bestellt. Das einzige das ich nicht habe ist die Batterie, da ich den Tonuino nicht portable benötige.
Allerdings wird hier die SD Karte nicht erkannt und somit startet der Tonuino nicht in den AP mode.
Kann es sein das ich die Batterie benötige auch wenn ich sie nicht brauche?
Die CHG LED des Lolin32 flackert auch immer wie wild.
Und mein neopixel blinkt rot. Was darauf schließt das die SD Karte nicht erkannt wird.
Woran könnte es denn noch liegen?
Hi, I am getting these errors while compiling the code for the AZ Dev Kit v4: It used to work flawlessly before the integration of different boards :/
EDIT: After fiddling around a bit it changed to these error messages:
Processing az-delivery-devkit-v4 (platform: espressif32; board: az-delivery-devkit-v4; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/az-delivery-devkit-v4.html
PLATFORM: Espressif 32 (3.0.0) > AZ-Delivery ESP-32 Dev Kit C V4
HARDWARE: ESP32 240MHz, 520KB RAM, 16MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 0.0.0+sha.7ecbb48
- tool-esptoolpy 1.30000.201119 (3.0.0)
- toolchain-xtensa32 2.50200.80 (5.2.0)
KeyError: 'PIOBUILDFILES':
File "C:\Users\hauki\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 177:
env.SConscript("$BUILD_SCRIPT")
File "C:\Users\hauki\.platformio\packages\tool-scons\scons-local-4.1.0\SCons\Script\SConscript.py", line 591:
return _SConscript(self.fs, *files, **subst_kw)
File "C:\Users\hauki\.platformio\packages\tool-scons\scons-local-4.1.0\SCons\Script\SConscript.py", line 280:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "C:\Users\hauki\.platformio\platforms\espressif32\builder\main.py", line 225:
target_elf = env.BuildProgram()
File "C:\Users\hauki\.platformio\packages\tool-scons\scons-local-4.1.0\SCons\Util.py", line 658:
return self.method(*nargs, **kwargs)
File "C:\Users\hauki\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 77:
os.path.join("$BUILD_DIR", env.subst("$PROGNAME")), env["PIOBUILDFILES"]
File "C:\Users\hauki\.platformio\packages\tool-scons\scons-local-4.1.0\SCons\Environment.py", line 388:
return self._dict[key]
==================================================================================== [FAILED] Took 0.90 seconds ====================================================================================
Environment Status Duration
--------------------- -------- ------------
az-delivery-devkit-v4 FAILED 00:00:00.904
============================================================================== 1 failed, 0 succeeded in 00:00:00.904 ==============================================================================
The terminal process "C:\Users\hauki\.platformio\penv\Scripts\pio.exe 'run', '--environment', 'az-delivery-devkit-v4'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
I already reinstalled everything and downloaded the project again but still the same errors
regards
Ich wollte mich auf dem Weg kurz für die Arbeit bedanken die du hier reingesteckt hast. Ich konnte bisher eine von zwei Tonuinos auf deine ESP32 Lösung problemlos umbauen.
Um den Verkabelungs-Overhead so gering wie möglich zu halten habe ich mir auch ein Board in KiCad entworfen, nichts besonderes es entspricht so ca. dem Board was auch in #4 vorgestellt wurde. Falls interesse besteht kann ich es bei GitHub hochladen.
Hi,
while setting a new value for the loudness is working fine, brightness does not work properly IMHO.
Use Case for loudness:
Use Case for brightness:
Thanks and regards,
GL
I am not sure if this really matters.
The GPIO34 and GPIO35 where the rotary encoder is connected has no sw enable pullup or pulldown.
The used library ESP32Encoder default enables a pulldown on these GPIOs but this is not working.
With the newest version I experienced problems with MP3 files with older MP3 Tags (ID3v2.2). All the songs with old tags did not play, and on the console the following messages appeared multiple times:
...
info : ID3 framesSize=2337
info : ID3 version=2
info : ID3 version must be 3, skip all metadata
info : ID3 framesSize=2337
info : ID3 version=2
info : ID3 version must be 3, skip all metadata
...
After writing the tag info with some MP3 Tag software, it was updated (as a side effect) to version ID3v2.3 and the files played again. Maybe a change in the underlying MP3 lib caused this new behavior. (It was working before with the older version of ESPuino / ESP TonUINO from December 2020.)
I have tries to upload files via the Linux ftp
command or via filezilla with a single connection and passive
disabled.
But the files are just touched
on the SD-card, but no content is written to the file.
Do you have any tips, what I am doing wrong?
Hi,
thanks for your work getting tonuino running on ESP32-Audio-kit. I followed your instructions but it won't work with the ESP32-Audio-Kit.
The strange thing is, if I put all together with a normal ESP32-dev board everything works fine.
The Problem:
If I start the ESP-Audio-kit while everything is connected, the mount of the SD-Card fails and keeps trying in the loop. If I disconnect the SDA Wire from of the MFRC while the moutloop is running the loop is ending with a mounted SD-Card but RFID doesn't work. The interessting thing is that I don't get a message for the missing MFRC on boot.
If I'm booting the esp32-audio-kit with disconnected SDA wire of the MFRC the SD-Card can be monted on the first try and I get the message "WARNING: Communication failure, is the MFRC522 properly connected?".
In both cases RFID won't work.
What have I done:
I copied the whole content of the Folder "Hardware-Plaforms/ESP32-A1S-Audiokit" to the root folder of the Project and replaced all existing files. In the platformio.ini I removed the rfid lib "https://github.com/biologist79/rfid.git" and added "yveaux/AC101@^0.0.1".
All the rest is done like you discribed, I removed all the resistor for the Keys and solderd miso of the MFRC522 to Pin 7 of the SD-Card reader gpio 2.
Jumpers are set to off/on/on/off/on
Have you done anything else ? because its running fine with a normal esp32 dev board. Or maybe my board is broken!?
thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.