Lolin D32 pro mit PN5180 findet SD-Karte nicht

Hi,

ich bin Daniel und komme aus Aachen. Ich habe vor einigen Jahren eine Tonuino Box für meinen Sohn (inzwischen 4 Jahre alt) gebaut. Die würde ich nun gerne „upgraden“. Habe mich daher sehr gefreut, als ich vor einigen Tagen dieses Projekt im Instructables Newsletter gefunden habe.

Ich versuche nun seit einigen Tagen ein Lolin D32 pro mit einem PN5180 RFID Reader zum laufen zu bekommen.

Aber die Probleme fangen schon recht früh an:
Ich habe nur das nackte D32 pro „angeschlossen“ mit gesteckter SD Karte.

  • Ein SD Test Skript aus der Arduino App kann erfolgreich auf die Karte schreiben und davon lesen
  • wenn ich espuino mit RC522-SPI kompiliere kann ich im Webinterface die SD-karte durchsuchen
  • wenn ich espuino mit PN5180-SPI kompiliere findet er die SD Karte nicht…

[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.

Angeschlossen ist außer dem nackten D32 pro und der SD-Karte wie gesagt erstmal nix… auch nicht der PN5180.

Hier meine Settings.h (sollte weitesgehend Standard sein…):

#ifndef __ESPUINO_SETTINGS_H__
#define __ESPUINO_SETTINGS_H__
    #include "Arduino.h"
    #include "values.h"

    //######################### INFOS ####################################
    // This is the general configfile for ESPuino-configuration.

    //################## HARDWARE-PLATFORM ###############################
    /* Make sure to also edit the configfile, that is specific for your platform.
    If in doubts (your develboard is not listed) use HAL 1
    1: Wemos Lolin32                        => settings-lolin32.h
    2: ESP32-A1S Audiokit                   => settings-espa1s.h
    3: Wemos Lolin D32                      => settings-lolin_D32.h
    4: Wemos Lolin D32 pro                  => settings-lolin_D32_pro.h
    5: Lilygo T8 (V1.7)                     => settings-ttgo_t8.h
    6: ESPuino complete                     => settings-complete.h
    7: Lolin D32 pro SDMMC Port-Expander    => settings-lolin_d32_pro_sdmmc_pe.h
    8: AZDelivery ESP32 NodeMCU             => settings-azdelivery_sdmmc.h
    99: custom                              => settings-custom.h
    more to come...
    */
    #ifndef HAL             // Will be set by platformio.ini. If using Arduini-IDE you have to set HAL according your needs!
        #define HAL 4       // HAL 1 = LoLin32, 2 = ESP32-A1S-AudioKit, 3 = Lolin D32, 4 = Lolin D32 pro; ... 99 = custom
    #endif


    //########################## 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

    #if defined(RFID_READER_TYPE_MFRC522_I2C) || defined(RFID_READER_TYPE_MFRC522_SPI)
        constexpr uint8_t rfidGain = 0x07 << 4;      // Sensitivity of RC522. For possible values see reference: https://forum.espuino.de/uploads/default/original/1X/9de5f8d35cbc123c1378cad1beceb3f51035cec0.png
    #endif


    //############# Port-expander-configuration ######################
    #ifdef PORT_EXPANDER_ENABLE
        constexpr uint8_t expanderI2cAddress = 0x20;  // I2C-address of PCA9555 (0x20 is true if PCA's pins A0+A1+A2 are pulled to GND)
    #endif

    //################## BUTTON-Layout ##################################
    /* German documentation: https://forum.espuino.de/t/das-dynamische-button-layout/224
    Please note the following numbers as you need to know them in order to define actions for buttons.
    Even if you don't use all of them, their numbers won't change
        0: NEXT_BUTTON
        1: PREVIOUS_BUTTON
        2: PAUSEPLAY_BUTTON
        3: ROTARYENCODER_BUTTON
        4: BUTTON_4
        5: BUTTON_5

    Don't forget to enable/configure those buttons you want to use in your develboard-specific config (e.g. settings-custom.h)

    Single-buttons [can be long or short] (examples):
        BUTTON_0_SHORT => Button 0 (NEXT_BUTTON) pressed shortly
        BUTTON_3_SHORT => Button 3 (ROTARYENCODER_BUTTON) pressed shortly
        BUTTON_4_LONG => Button 4 (BUTTON_4) pressed long

    Multi-buttons [short only] (examples):
        BUTTON_MULTI_01 => Buttons 0+1 (NEXT_BUTTON + PREVIOUS_BUTTON) pressed in parallel
        BUTTON_MULTI_12 => Buttons 1+2 (PREV_BUTTON + PAUSEPLAY_BUTTON) pressed in parallel

    Actions:
        To all of those buttons, an action can be assigned freely.
        Please have a look at values.h to look up actions available (>=100 can be used)
        If you don't want to assign an action or you don't use a given button: CMD_NOTHING has to be set
    */
    // *****BUTTON*****        *****ACTION*****
    #define BUTTON_0_SHORT    CMD_NEXTTRACK
    #define BUTTON_1_SHORT    CMD_PREVTRACK
    #define BUTTON_2_SHORT    CMD_PLAYPAUSE
    #define BUTTON_3_SHORT    CMD_MEASUREBATTERY
    #define BUTTON_4_SHORT    CMD_SEEK_BACKWARDS
    #define BUTTON_5_SHORT    CMD_SEEK_FORWARDS

    #define BUTTON_0_LONG     CMD_LASTTRACK
    #define BUTTON_1_LONG     CMD_FIRSTTRACK
    #define BUTTON_2_LONG     CMD_PLAYPAUSE
    #define BUTTON_3_LONG     CMD_SLEEPMODE
    #define BUTTON_4_LONG     CMD_NOTHING
    #define BUTTON_5_LONG     CMD_NOTHING

    #define BUTTON_MULTI_01   CMD_TOGGLE_WIFI_STATUS
    #define BUTTON_MULTI_02   CMD_ENABLE_FTP_SERVER
    #define BUTTON_MULTI_03   CMD_NOTHING
    #define BUTTON_MULTI_04   CMD_NOTHING
    #define BUTTON_MULTI_05   CMD_NOTHING
    #define BUTTON_MULTI_12   CMD_TELL_IP_ADDRESS
    #define BUTTON_MULTI_13   CMD_NOTHING
    #define BUTTON_MULTI_14   CMD_NOTHING
    #define BUTTON_MULTI_15   CMD_NOTHING
    #define BUTTON_MULTI_23   CMD_NOTHING
    #define BUTTON_MULTI_24   CMD_NOTHING
    #define BUTTON_MULTI_25   CMD_NOTHING
    #define BUTTON_MULTI_34   CMD_NOTHING
    #define BUTTON_MULTI_35   CMD_NOTHING
    #define BUTTON_MULTI_45   CMD_NOTHING

    //#################### Various settings ##############################

    // Serial-logging-configuration
    #define SERIAL_LOGLEVEL LOGLEVEL_DEBUG              // Current loglevel for serial console

    // Static ip-configuration
    #ifdef STATIC_IP_ENABLE
        #define LOCAL_IP   192,168,2,100                // ESPuino's IP
        #define GATEWAY_IP 192,168,2,1                  // IP of the gateway/router
        #define SUBNET_IP  255,255,255,0                // Netmask of your network (/24 => 255.255.255.0)
        #define DNS_IP     192,168,2,1                  // DNS-server of your network; in private networks it's usually the gatewy's IP
    #endif

    // Buttons (better leave unchanged if in doubts :-))
    constexpr uint8_t buttonDebounceInterval = 50;                // Interval in ms to software-debounce buttons
    constexpr uint16_t intervalToLongPress = 700;                 // Interval in ms to distinguish between short and long press of previous/next-button

    // RFID-RC522
    #define RFID_SCAN_INTERVAL 100                      // Interval-time in ms (how often is RFID read?)

    // Automatic restart
    #ifdef SHUTDOWN_IF_SD_BOOT_FAILS
        constexpr uint32_t deepsleepTimeAfterBootFails = 20;      // Automatic restart takes place if boot was not successful after this period (in seconds)
    #endif

    // FTP
    // Nothing to be configured here...
    // Default user/password is esp32/esp32 but can be changed via webgui

    // ESPuino will create a WiFi if joing existing WiFi was not possible. Name can be configured here.
    constexpr const char accessPointNetworkSSID[] PROGMEM = "ESPuino";     // Access-point's SSID
    constexpr const char nameBluetoothDevice[] PROGMEM = "ESPuino";        // Name of your ESPuino as Bluetooth-device

    // Where to store the backup-file for NVS-records
    constexpr const char backupFile[] PROGMEM = "/backup.txt"; // File is written every time a (new) RFID-assignment via GUI is done
    constexpr const char playlistCacheFile[] PROGMEM = "playlistcache.csv"; // Filename that is used for caching playlists

    //#################### Settings for optional Modules##############################
    // (optinal) Neopixel
    #ifdef NEOPIXEL_ENABLE
        #define NUM_LEDS                    12          // number of LEDs
        #define CHIPSET                     WS2812B     // type of Neopixel
        #define COLOR_ORDER                 GRB
    #endif

    // (optional) Default-voltages for battery-monitoring via Neopixel
    constexpr float s_warningLowVoltage = 3.4;                      // If battery-voltage is >= this value, a cyclic warning will be indicated by Neopixel (can be changed via GUI!)
    constexpr uint8_t s_voltageCheckInterval = 10;                  // How of battery-voltage is measured (in minutes) (can be changed via GUI!)
    constexpr float s_voltageIndicatorLow = 3.0;                    // Lower range for Neopixel-voltage-indication (0 leds) (can be changed via GUI!)
    constexpr float s_voltageIndicatorHigh = 4.2;                   // Upper range for Neopixel-voltage-indication (all leds) (can be changed via GUI!)

    // (optinal) Headphone-detection (leave unchanged if in doubts...)
    #ifdef HEADPHONE_ADJUST_ENABLE
        constexpr uint16_t headphoneLastDetectionDebounce = 1000; // Debounce-interval in ms when plugging in headphone
    #endif

    // Seekmode-configuration
    constexpr uint8_t jumpOffset = 30;                            // Offset in seconds to jump for commands CMD_SEEK_FORWARDS / CMD_SEEK_BACKWARDS

    // (optional) Topics for MQTT
    #ifdef MQTT_ENABLE
        constexpr uint16_t mqttRetryInterval = 60;                // Try to reconnect to MQTT-server every (n) seconds if connection is broken
        constexpr uint8_t mqttMaxRetriesPerInterval = 1;          // Number of retries per time-interval (mqttRetryInterval). mqttRetryInterval 60 / mqttMaxRetriesPerInterval 1 => once every 60s
        #define DEVICE_HOSTNAME "ESP32-ESPuino"         // Name that is used for MQTT
        constexpr const char topicSleepCmnd[] PROGMEM = "Cmnd/ESPuino/Sleep";
        constexpr const char topicSleepState[] PROGMEM = "State/ESPuino/Sleep";
        constexpr const char topicRfidCmnd[] PROGMEM = "Cmnd/ESPuino/Rfid";
        constexpr const char topicRfidState[] PROGMEM = "State/ESPuino/Rfid";
        constexpr const char topicTrackState[] PROGMEM = "State/ESPuino/Track";
        constexpr const char topicTrackControlCmnd[] PROGMEM = "Cmnd/ESPuino/TrackControl";
        constexpr const char topicLoudnessCmnd[] PROGMEM = "Cmnd/ESPuino/Loudness";
        constexpr const char topicLoudnessState[] PROGMEM = "State/ESPuino/Loudness";
        constexpr const char topicSleepTimerCmnd[] PROGMEM = "Cmnd/ESPuino/SleepTimer";
        constexpr const char topicSleepTimerState[] PROGMEM = "State/ESPuino/SleepTimer";
        constexpr const char topicState[] PROGMEM = "State/ESPuino/State";
        constexpr const char topicCurrentIPv4IP[] PROGMEM = "State/ESPuino/IPv4";
        constexpr const char topicLockControlsCmnd[] PROGMEM ="Cmnd/ESPuino/LockControls";
        constexpr const char topicLockControlsState[] PROGMEM ="State/ESPuino/LockControls";
        constexpr const char topicPlaymodeState[] PROGMEM = "State/ESPuino/Playmode";
        constexpr const char topicRepeatModeCmnd[] PROGMEM = "Cmnd/ESPuino/RepeatMode";
        constexpr const char topicRepeatModeState[] PROGMEM = "State/ESPuino/RepeatMode";
        constexpr const char topicLedBrightnessCmnd[] PROGMEM = "Cmnd/ESPuino/LedBrightness";
        constexpr const char topicLedBrightnessState[] PROGMEM = "State/ESPuino/LedBrightness";
        constexpr const char topicWiFiRssiState[] PROGMEM = "State/ESPuino/WifiRssi";
        #ifdef MEASURE_BATTERY_VOLTAGE
            constexpr const char topicBatteryVoltage[] PROGMEM = "State/ESPuino/Voltage";
        #endif
    #endif

    // !!! MAKE SURE TO EDIT PLATFORM SPECIFIC settings-****.h !!!
    #if (HAL == 1)
        #include "settings-lolin32.h"                       // Contains all user-relevant settings for Wemos Lolin32
    #elif (HAL == 2)
        #include "settings-espa1s.h"                        // Contains all user-relevant settings for ESP32-A1S Audiokit
    #elif (HAL == 3)
        #include "settings-lolin_d32.h"                     // Contains all user-relevant settings for Wemos Lolin D32
    #elif (HAL == 4)
        #include "settings-lolin_d32_pro.h"                 // Contains all user-relevant settings for Wemos Lolin D32 pro
    #elif (HAL == 5)
        #include "settings-ttgo_t8.h"                       // Contains all user-relevant settings for Lilygo TTGO T8 1.7
    #elif (HAL == 6)
        #include "settings-complete.h"                      // Contains all user-relevant settings for ESPuino complete
    #elif (HAL == 7)
        #include "settings-lolin_d32_pro_sdmmc_pe.h"        // Pre-configured settings for ESPuino Lolin D32 pro with SDMMC + port-expander (https://forum.espuino.de/t/lolin-d32-pro-mit-sd-mmc-pn5180-max-fuenf-buttons-und-port-expander-smd/638)
    #elif (HAL == 8)
        #include "settings-azdelivery_sdmmc.h"              // Pre-configured settings for AZ Delivery ESP32 NodeMCU / Devkit C (https://forum.espuino.de/t/az-delivery-esp32-nodemcu-devkit-c-mit-sd-mmc-und-pn5180-als-rfid-leser/634)
    #elif (HAL == 99)
        #include "settings-custom.h"                        // Contains all user-relevant settings custom-board
    #endif

    //#define ENABLE_ESPUINO_DEBUG                            // Needs modification of platformio.ini (https://forum.espuino.de/t/rfid-mit-oder-ohne-task/353/21); better don't enable unless you know what you're doing :-)

#endif

Hoffe man bekommt das mit dem PN5180 doch noch zum laufen, da ich mit dem RC522 in der Tonuino Box eher schlechte Erfahrungen gemacht habe.

Gruß
Daniel

Hallo Daniel,

erstmal herzlich willkommen hier.
Ich muss zugeben, dass ich diese Kombination noch nie getestet habe. Ich würde sie dir aber auch nicht so wirklich empfehlen. Und zwar aus folgenden Gründen:

a) Ein D32 pro ist ein ESP32-WROVER und dieser besitzt aufgrund seines internen PSRAM zwei GPIOs weniger. Was jetzt erstmal kein Problem ist, aber…
b) ein PN5180 (gute Wahl übrigens) braucht relativ viele Pins. Insgesamt gehen einem am Ende dann schnell die GPIOs aus.
c) SD via SPI ist erheblich langsamer als SD_MMC und braucht dabei einen GPIO mehr. Ich weiß allerdings auch, dass der D32 pro intern leider nur die SPI-Variante kann.
d) Es hat sich gezeigt, dass es in der SD-Variante via SPI leider einen Bug gibt. Dieser führt dazu, dass Uploads zwischendrin gerne mal abbrechen. Mitkriegen tust du davon leider erstmal nix, aber der ESP32 hört irgendwann auf zu schreiben und am Ende wunderst du dich, dass die Datei unvollständig ist auf der SD. (Planst du keine Files per WLAN auf die SD-Karte zu schieben, dann ist dieser Punkt hinfällig. Es ist auch mit SD_MMC nicht suuuuuper schnell, aber doch immerhin halt ein Weg, die SD-Karte nicht ausbauen zu müssen).

Die Probleme sind hier auf jeden Fall alle gelöst: Lolin D32 pro mit SD_MMC, PN5180, max. fünf Buttons und Port-Expander (SMD).

Möchtest du dennoch bei deiner Variante bleiben, dann poste mal die zweite Config und sei andererseits informiert, dass der ESPuino auf dem Steckbrett mittels Jumperwires eher „so ne Sache“ ist, hehe. Man spart sich einiges an Problemen, wenn man das aufgelötet hat.

Das würde mich mal interessieren. Hast da irgendwie einen Link zu? Ich weiß davon gar nix. Habe mich aber schon gewundert, woher plötzlich die ganzen neuen Likes auf GitHub kamen :slight_smile:.

Hallo @biologist

danke für deine schnelle Antwort. Hier schonmal die Instructables Sachen:

Es muss nicht beim D32 pro bleiben. Das mit dem SD_MMC hatte ich auch schon gelesen. Habe momentan aber kein micro-SD Breakout da (sind aber schon bestellt). Mit den GPIOs komme ich glaube ich aber aus (habs aber auch noch nicht kontrolliert).

Was wäre denn ein gutes ESP32-Wrover Board? Mit genügend PSRAM für OTA Upgrades?

Auf Dauer will ich mir auch ne Platine dafür machen. Insgesamt gibt es 3 Tonuinos die umgerüstet werden sollen und bestimmt noch ein paar weitere die man mal verschenken kann.

Welche Config Datei meinst du genau?
Hier mal die settings-lolin_d32_pro.h (sollte aber komplett original sein):

#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                         21          // GPIO for chip select (RFID)
    #define RFID_MOSI                       13          // GPIO for master out slave in (RFID)
    #define RFID_MISO                       15          // GPIO for master in slave out (RFID)
    #define RFID_SCK                        14          // GPIO for clock-signal (RFID)

    #ifdef RFID_READER_TYPE_PN5180
        #define RFID_BUSY                   33          // PN5180 BUSY PIN
        #define RFID_RST                    22          // PN5180 RESET PIN
        #define RFID_IRQ                    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           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'; Info: Lolin D32 pro is using 35 for battery-voltage-monitoring!
        #define ROTARYENCODER_BUTTON        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                     33          // Button 0: GPIO to detect next
    #define PREVIOUS_BUTTON                  2          // Button 1: GPIO to detect previous
    #define PAUSEPLAY_BUTTON                36          // 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                 5           // i2c-SCL (clock)
        #define ext_IIC_DATA                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                   ROTARYENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep.

    // (optional) Power-control
    #define POWER                           5           // GPIO used to drive transistor-circuit, that switches off peripheral devices while ESP32-deepsleep

    // (optional) Neopixel
    #define LED_PIN                         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                   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            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                   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

Gruß
Daniel

Ahhh, @doncore hat Werbung gemacht, Sehr gut! :smiley:

Der ist schon ok, bleib’ bei dem :slight_smile: Den nutzt der PCB aus meinem Link ja auch. Man kann halt nur den internen Reader nicht nutzen. Sonst ist da alles fein :slight_smile:

Das mitgelieferte File passt. Hier gibt es mindestens auf Pin 33 ein Duplikat (wie gesagt, PN5180 habe ich nie getestet damit). Die Pplay-Taste braucht auch einen externen PullUp. Also man muss in dem Cfg-File einfachen schauen, dass GPIOs, sofern man sie für den einkompilierten Support braucht, nicht doppelt vergeben werden.

Es kommt halt drauf an, was man vor hat. Die GPIOs >= 34 sind auch nur als Inputs nutzbar. Rechne es besser mal durch. Ggü einem WROOM (der aber kein PSRAM besitzt), hat der WROVER die GPIOs 16+17 nicht.

… und immerhin 44€ gewonnen :slight_smile:
Das deckt aber auch nicht im Ansatz die Kosten (weil ich es genüsslich übertrieben habe).
Ich mache immer wieder mal bei Contests auf instructable mit.
Auch um in der Übung zu bleiben etwas in englisch zu schreiben.
Ich bin da auch selber Judge (außer bei den Wettbewerben, an denen ich teilnehme).

1 „Gefällt mir“

Hi,

ich habe inzwischen den D32 Pro mit dem Originalboard von Torsten (Lolin D32 pro SDMMC Port-Expander) aufgebaut. Leider bekomme ich hier den gleichen Fehler.

Hier mal meine aktuelle Settings.h:

#ifndef __ESPUINO_SETTINGS_H__
#define __ESPUINO_SETTINGS_H__
    #include "Arduino.h"
    #include "values.h"

    //######################### INFOS ####################################
    // This is the general configfile for ESPuino-configuration.

    //################## HARDWARE-PLATFORM ###############################
    /* Make sure to also edit the configfile, that is specific for your platform.
    If in doubts (your develboard is not listed) use HAL 1
    1: Wemos Lolin32                        => settings-lolin32.h
    2: ESP32-A1S Audiokit                   => settings-espa1s.h
    3: Wemos Lolin D32                      => settings-lolin_D32.h
    4: Wemos Lolin D32 pro                  => settings-lolin_D32_pro.h
    5: Lilygo T8 (V1.7)                     => settings-ttgo_t8.h
    6: ESPuino complete                     => settings-complete.h
    7: Lolin D32 pro SDMMC Port-Expander    => settings-lolin_d32_pro_sdmmc_pe.h
    8: AZDelivery ESP32 NodeMCU             => settings-azdelivery_sdmmc.h
    99: custom                              => settings-custom.h
    more to come...
    */
    #ifndef HAL             // Will be set by platformio.ini. If using Arduini-IDE you have to set HAL according your needs!
        #define HAL 7       // HAL 1 = LoLin32, 2 = ESP32-A1S-AudioKit, 3 = Lolin D32, 4 = Lolin D32 pro; ... 99 = custom
    #endif


    //########################## 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

    #if defined(RFID_READER_TYPE_MFRC522_I2C) || defined(RFID_READER_TYPE_MFRC522_SPI)
        constexpr uint8_t rfidGain = 0x07 << 4;      // Sensitivity of RC522. For possible values see reference: https://forum.espuino.de/uploads/default/original/1X/9de5f8d35cbc123c1378cad1beceb3f51035cec0.png
    #endif


    //############# Port-expander-configuration ######################
    #ifdef PORT_EXPANDER_ENABLE
        constexpr uint8_t expanderI2cAddress = 0x20;  // I2C-address of PCA9555 (0x20 is true if PCA's pins A0+A1+A2 are pulled to GND)
    #endif

    //################## BUTTON-Layout ##################################
    /* German documentation: https://forum.espuino.de/t/das-dynamische-button-layout/224
    Please note the following numbers as you need to know them in order to define actions for buttons.
    Even if you don't use all of them, their numbers won't change
        0: NEXT_BUTTON
        1: PREVIOUS_BUTTON
        2: PAUSEPLAY_BUTTON
        3: ROTARYENCODER_BUTTON
        4: BUTTON_4
        5: BUTTON_5

    Don't forget to enable/configure those buttons you want to use in your develboard-specific config (e.g. settings-custom.h)

    Single-buttons [can be long or short] (examples):
        BUTTON_0_SHORT => Button 0 (NEXT_BUTTON) pressed shortly
        BUTTON_3_SHORT => Button 3 (ROTARYENCODER_BUTTON) pressed shortly
        BUTTON_4_LONG => Button 4 (BUTTON_4) pressed long

    Multi-buttons [short only] (examples):
        BUTTON_MULTI_01 => Buttons 0+1 (NEXT_BUTTON + PREVIOUS_BUTTON) pressed in parallel
        BUTTON_MULTI_12 => Buttons 1+2 (PREV_BUTTON + PAUSEPLAY_BUTTON) pressed in parallel

    Actions:
        To all of those buttons, an action can be assigned freely.
        Please have a look at values.h to look up actions available (>=100 can be used)
        If you don't want to assign an action or you don't use a given button: CMD_NOTHING has to be set
    */
    // *****BUTTON*****        *****ACTION*****
    #define BUTTON_0_SHORT    CMD_NEXTTRACK
    #define BUTTON_1_SHORT    CMD_PREVTRACK
    #define BUTTON_2_SHORT    CMD_PLAYPAUSE
    #define BUTTON_3_SHORT    CMD_MEASUREBATTERY
    #define BUTTON_4_SHORT    CMD_SEEK_BACKWARDS
    #define BUTTON_5_SHORT    CMD_SEEK_FORWARDS

    #define BUTTON_0_LONG     CMD_LASTTRACK
    #define BUTTON_1_LONG     CMD_FIRSTTRACK
    #define BUTTON_2_LONG     CMD_PLAYPAUSE
    #define BUTTON_3_LONG     CMD_SLEEPMODE
    #define BUTTON_4_LONG     CMD_NOTHING
    #define BUTTON_5_LONG     CMD_NOTHING

    #define BUTTON_MULTI_01   CMD_TOGGLE_WIFI_STATUS
    #define BUTTON_MULTI_02   CMD_ENABLE_FTP_SERVER
    #define BUTTON_MULTI_03   CMD_NOTHING
    #define BUTTON_MULTI_04   CMD_NOTHING
    #define BUTTON_MULTI_05   CMD_NOTHING
    #define BUTTON_MULTI_12   CMD_TELL_IP_ADDRESS
    #define BUTTON_MULTI_13   CMD_NOTHING
    #define BUTTON_MULTI_14   CMD_NOTHING
    #define BUTTON_MULTI_15   CMD_NOTHING
    #define BUTTON_MULTI_23   CMD_NOTHING
    #define BUTTON_MULTI_24   CMD_NOTHING
    #define BUTTON_MULTI_25   CMD_NOTHING
    #define BUTTON_MULTI_34   CMD_NOTHING
    #define BUTTON_MULTI_35   CMD_NOTHING
    #define BUTTON_MULTI_45   CMD_NOTHING

    //#################### Various settings ##############################

    // Serial-logging-configuration
    #define SERIAL_LOGLEVEL LOGLEVEL_DEBUG              // Current loglevel for serial console

    // Static ip-configuration
    #ifdef STATIC_IP_ENABLE
        #define LOCAL_IP   192,168,2,100                // ESPuino's IP
        #define GATEWAY_IP 192,168,2,1                  // IP of the gateway/router
        #define SUBNET_IP  255,255,255,0                // Netmask of your network (/24 => 255.255.255.0)
        #define DNS_IP     192,168,2,1                  // DNS-server of your network; in private networks it's usually the gatewy's IP
    #endif

    // Buttons (better leave unchanged if in doubts :-))
    constexpr uint8_t buttonDebounceInterval = 50;                // Interval in ms to software-debounce buttons
    constexpr uint16_t intervalToLongPress = 700;                 // Interval in ms to distinguish between short and long press of previous/next-button

    // RFID-RC522
    #define RFID_SCAN_INTERVAL 100                      // Interval-time in ms (how often is RFID read?)

    // Automatic restart
    #ifdef SHUTDOWN_IF_SD_BOOT_FAILS
        constexpr uint32_t deepsleepTimeAfterBootFails = 20;      // Automatic restart takes place if boot was not successful after this period (in seconds)
    #endif

    // FTP
    // Nothing to be configured here...
    // Default user/password is esp32/esp32 but can be changed via webgui

    // ESPuino will create a WiFi if joing existing WiFi was not possible. Name can be configured here.
    constexpr const char accessPointNetworkSSID[] PROGMEM = "ESPuino";     // Access-point's SSID
    constexpr const char nameBluetoothDevice[] PROGMEM = "ESPuino";        // Name of your ESPuino as Bluetooth-device

    // Where to store the backup-file for NVS-records
    constexpr const char backupFile[] PROGMEM = "/backup.txt"; // File is written every time a (new) RFID-assignment via GUI is done
    constexpr const char playlistCacheFile[] PROGMEM = "playlistcache.csv"; // Filename that is used for caching playlists

    //#################### Settings for optional Modules##############################
    // (optinal) Neopixel
    #ifdef NEOPIXEL_ENABLE
        #define NUM_LEDS                    24          // number of LEDs
        #define CHIPSET                     WS2812B     // type of Neopixel
        #define COLOR_ORDER                 GRB
    #endif

    // (optional) Default-voltages for battery-monitoring via Neopixel
    constexpr float s_warningLowVoltage = 3.4;                      // If battery-voltage is >= this value, a cyclic warning will be indicated by Neopixel (can be changed via GUI!)
    constexpr uint8_t s_voltageCheckInterval = 10;                  // How of battery-voltage is measured (in minutes) (can be changed via GUI!)
    constexpr float s_voltageIndicatorLow = 3.0;                    // Lower range for Neopixel-voltage-indication (0 leds) (can be changed via GUI!)
    constexpr float s_voltageIndicatorHigh = 4.2;                   // Upper range for Neopixel-voltage-indication (all leds) (can be changed via GUI!)

    // (optinal) Headphone-detection (leave unchanged if in doubts...)
    #ifdef HEADPHONE_ADJUST_ENABLE
        constexpr uint16_t headphoneLastDetectionDebounce = 1000; // Debounce-interval in ms when plugging in headphone
    #endif

    // Seekmode-configuration
    constexpr uint8_t jumpOffset = 30;                            // Offset in seconds to jump for commands CMD_SEEK_FORWARDS / CMD_SEEK_BACKWARDS

    // (optional) Topics for MQTT
    #ifdef MQTT_ENABLE
        constexpr uint16_t mqttRetryInterval = 60;                // Try to reconnect to MQTT-server every (n) seconds if connection is broken
        constexpr uint8_t mqttMaxRetriesPerInterval = 1;          // Number of retries per time-interval (mqttRetryInterval). mqttRetryInterval 60 / mqttMaxRetriesPerInterval 1 => once every 60s
        #define DEVICE_HOSTNAME "ESP32-ESPuino"         // Name that is used for MQTT
        constexpr const char topicSleepCmnd[] PROGMEM = "Cmnd/ESPuino/Sleep";
        constexpr const char topicSleepState[] PROGMEM = "State/ESPuino/Sleep";
        constexpr const char topicRfidCmnd[] PROGMEM = "Cmnd/ESPuino/Rfid";
        constexpr const char topicRfidState[] PROGMEM = "State/ESPuino/Rfid";
        constexpr const char topicTrackState[] PROGMEM = "State/ESPuino/Track";
        constexpr const char topicTrackControlCmnd[] PROGMEM = "Cmnd/ESPuino/TrackControl";
        constexpr const char topicLoudnessCmnd[] PROGMEM = "Cmnd/ESPuino/Loudness";
        constexpr const char topicLoudnessState[] PROGMEM = "State/ESPuino/Loudness";
        constexpr const char topicSleepTimerCmnd[] PROGMEM = "Cmnd/ESPuino/SleepTimer";
        constexpr const char topicSleepTimerState[] PROGMEM = "State/ESPuino/SleepTimer";
        constexpr const char topicState[] PROGMEM = "State/ESPuino/State";
        constexpr const char topicCurrentIPv4IP[] PROGMEM = "State/ESPuino/IPv4";
        constexpr const char topicLockControlsCmnd[] PROGMEM ="Cmnd/ESPuino/LockControls";
        constexpr const char topicLockControlsState[] PROGMEM ="State/ESPuino/LockControls";
        constexpr const char topicPlaymodeState[] PROGMEM = "State/ESPuino/Playmode";
        constexpr const char topicRepeatModeCmnd[] PROGMEM = "Cmnd/ESPuino/RepeatMode";
        constexpr const char topicRepeatModeState[] PROGMEM = "State/ESPuino/RepeatMode";
        constexpr const char topicLedBrightnessCmnd[] PROGMEM = "Cmnd/ESPuino/LedBrightness";
        constexpr const char topicLedBrightnessState[] PROGMEM = "State/ESPuino/LedBrightness";
        constexpr const char topicWiFiRssiState[] PROGMEM = "State/ESPuino/WifiRssi";
        #ifdef MEASURE_BATTERY_VOLTAGE
            constexpr const char topicBatteryVoltage[] PROGMEM = "State/ESPuino/Voltage";
        #endif
    #endif

    // !!! MAKE SURE TO EDIT PLATFORM SPECIFIC settings-****.h !!!
    #if (HAL == 1)
        #include "settings-lolin32.h"                       // Contains all user-relevant settings for Wemos Lolin32
    #elif (HAL == 2)
        #include "settings-espa1s.h"                        // Contains all user-relevant settings for ESP32-A1S Audiokit
    #elif (HAL == 3)
        #include "settings-lolin_d32.h"                     // Contains all user-relevant settings for Wemos Lolin D32
    #elif (HAL == 4)
        #include "settings-lolin_d32_pro.h"                 // Contains all user-relevant settings for Wemos Lolin D32 pro
    #elif (HAL == 5)
        #include "settings-ttgo_t8.h"                       // Contains all user-relevant settings for Lilygo TTGO T8 1.7
    #elif (HAL == 6)
        #include "settings-complete.h"                      // Contains all user-relevant settings for ESPuino complete
    #elif (HAL == 7)
        #include "settings-lolin_d32_pro_sdmmc_pe.h"        // Pre-configured settings for ESPuino Lolin D32 pro with SDMMC + port-expander (https://forum.espuino.de/t/lolin-d32-pro-mit-sd-mmc-pn5180-max-fuenf-buttons-und-port-expander-smd/638)
    #elif (HAL == 8)
        #include "settings-azdelivery_sdmmc.h"              // Pre-configured settings for AZ Delivery ESP32 NodeMCU / Devkit C (https://forum.espuino.de/t/az-delivery-esp32-nodemcu-devkit-c-mit-sd-mmc-und-pn5180-als-rfid-leser/634)
    #elif (HAL == 99)
        #include "settings-custom.h"                        // Contains all user-relevant settings custom-board
    #endif

    //#define ENABLE_ESPUINO_DEBUG                            // Needs modification of platformio.ini (https://forum.espuino.de/t/rfid-mit-oder-ohne-task/353/21); better don't enable unless you know what you're doing :-)

#endif

Alles andere ist original wie auf github…

Was kann denn das jetzt noch sein?

Die SD Karte ist in meinem Testaufbau mit einem lolin32 lite problemlos lesbar.

Gruß
Daniel

Hallo Daniel,

hast du es mal mit einem anderen PN5180 oder mit eine RC522 probiert?
Also du hattest ja per PN geschrieben, dass der Bootvorgang funktioniert; jedoch nur dann, wenn der PN5180 nicht angeschlossen ist. Dessen Jumper hast du aber gesetzt?

@triggad23 Was mir eben noch einfiel: Kompilierst du für den passenden Task? Ich sehe, du hast 7 ausgewählt als HAL, das wird bei Platformio jedoch eh überschrieben. Du musst am unteren Bildschirmrand das Passende anklicken: Probleme mit Visual Studio Code/Platformio?.

Hi,

anderen PN5180 habe ich nicht, aber der, den ich habe, funktioniert mit nem Lolin32lite problemlos…

Ich ziehe den D32pro gleich nochmal ab und verbinde den nur mit Steckkabeln direkt mit dem SD Reader. Dann sollte es ja eigentlich funktionieren.

Ich kompiliere und uploade immer über diesen Eintrag:

Das sollte doch so richtig sein oder?

Gruß
Daniel

Ja, aber ganz unten in der Statusleiste muss auch das passende Profil gewählt sein. Da steht irgendwas mit env:

Habs da auch ausprobiert. Scheint aber das gleiche zu machen. Er musste nicht neu kompilieren vor dem Upload.

Ich habe inzwischen mal ein wenig gemessen. Am 3.3V Pin des SD Readers kommen nur schwankende ca 1V an… scheint also so, als ob der Mosfet nicht sauber durchschaltet. Hab ich die evtl vertauscht? Hier mal 2 Fotos die ich gerade mit nem USB-Mikroskop gemacht habe:

IRML2244:

IRML6244:

Ist nicht gut zu lesen, aber vielleicht reichts ja um zu erkennen ob ich was vertauscht habe.

Gruß
Daniel

Nee, also vertauscht sind sie nicht.

Aber ich habe so ein bisschen den Eindruck, dass der 2244 nicht (oder nur teilweise) auf seinen Pads hockt (Offset nach rechts). Ich würde das nochmal nachlöten.
Ansonsten kannst mal eine Brücke von 3.3V am D32 pro rüber z.B. zu den 3.3V am MAX löten. Damit überbrückst du die Mosfet-Schaltung. Wenn es dann geht, dann liegt es auf jeden Fall an der Mosfet-Schaltung (oder deren Ansteuerung - was ich aber mal nicht hoffe).

Was mir auch gerade noch einfällt: In Kombination mit der Kopfhörerplatine hatte ich hier am D32 pro kürzlich das Problem, dass die Spannung der Mosfets beim Start 3.3V war und dann immer wieder zusammengebrochen ist. Das ging dann so ein paar Mal und dann hat der ESP32 offenbar aufgegeben. Fixen konnte ich das so:

Zwischen den Zeilen 38 und 39 habe ich ein delay(50) eingebaut und das Problem war erledigt. An keinem anderen Board (Lolin32, Lolin D32, DevkitC) hatte ich dieses Problem.

Das muss ich endlich mal in einen Commit hauen. Das Problem bestand aber wie gesagt auch nur mit Kopfhörerplatine (und dann auch nicht immer). Ohne nicht.

Asche auf mein Haupt, es war wirklich ne kalte Lötstelle am 2244… Irgendwie konnte ich SMD löten früher besser…
jetzt startet er, habe aber momentan nur den SD-Reader und den MAX dran.

Alles weitere muss ich dann heute abend kucken. Erstmal arbeiten…

Danke für deine Hilfe!

Sieht halb gut aus. Der PN5180 funktioniert und Musik kommt auch raus. Ich glaube aber der Button des Encoders geht nicht (andere Buttons habe ich noch nicht dran).

Ich habe mal nen I2C Scanner für den ESP32 ausprobiert:

Sollte dieser den Portexpander sehen? Weil er findet nämlich nix…

Kann sein, dass ich hier auch noch ne kalte Lötstelle habe… werde echt zu alt für SMD :wink: ab 40 nur noch bedrahtet… werde ich mir morgen am Schreibtisch mal ankucken.

Gruß
Daniel

Ja, der sollte gefunden werden. 0x20 ist seine Adresse.
Hast dem i2c-Scanner die richtigen GPIOs mitgegeben?

Nimm mal eine Drahtbrücke und imitiere mal einen Button, indem du so einen Kontakt kurzschließt.

Doch gefunden:

Scanning…
I2C device found at address 0x20
done

Sollte dann eine Ausgabe im Terminal kommen wenn ich den Button drücke?

Falls jemand anders später mal den I2C Scanner braucht:

/*********
  Rui Santos
  Complete project details at https://randomnerdtutorials.com  
*********/

#include <Wire.h>

#define I2C_SDA 13
#define I2C_SCL 4
 
void setup() {
  Wire.begin(I2C_SDA, I2C_SCL);
  Serial.begin(115200);
  Serial.println("\nI2C Scanner");
}
 
void loop() {
  byte error, address;
  int nDevices;
  Serial.println("Scanning...");
  nDevices = 0;
  for(address = 1; address < 127; address++ ) {
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
    if (error == 0) {
      Serial.print("I2C device found at address 0x");
      if (address<16) {
        Serial.print("0");
      }
      Serial.println(address,HEX);
      nDevices++;
    }
    else if (error==4) {
      Serial.print("Unknow error at address 0x");
      if (address<16) {
        Serial.print("0");
      }
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0) {
    Serial.println("No I2C devices found\n");
  }
  else {
    Serial.println("done\n");
  }
  delay(5000);          
}

Kontroll-Kommando empfangen via Queue: 3
Playmode kann nicht verändert werden, wenn keine Playlist aktiv ist.

Scheint doch zu funktionieren… dann scheint ja alles gut zu sein.

Hmm, zu früh gefreut.
Ich bekomme den ESP nicht mehr aufgeweckt, wenn er in den Sleep Modus gegeangen ist. Weder per Pushbutton des Encoders, noch per Plauybutton…

Wenn ich das richtig verstanden habe sollte er doch über jeden Button der auf dem Portexpander liegt aufzuwecken sein oder?

 #define WAKEUP_BUTTON                   36 

Ja das passt eigentlich. Versuche mal in der System.cpp das delay(50) reinzumachen, was ich oben beschrieben habe.