Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Off Topic
  4. Microcontroller
  5. Phrasingfehler Arduino ide

NEWS

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    22
    1
    1.0k

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    9.1k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    14
    1
    2.4k

Phrasingfehler Arduino ide

Geplant Angeheftet Gesperrt Verschoben Microcontroller
8 Beiträge 3 Kommentatoren 527 Aufrufe 3 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • David G.D Online
    David G.D Online
    David G.
    schrieb am zuletzt editiert von
    #1

    Was möchte hier die arduino ide von mir?

    Ist mein erstes Projekt und den Code für das Projekt habe ich nur per C&P eingefügt.

    c:\Users\Tin\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp: In function 'bool getMD5(uint8_t*, uint16_t, char*)':
    c:\Users\Tin\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp:74:3: error: 'mbedtls_md5_starts_ret' was not declared in this scope; did you mean 'mbedtls_md5_starts'?
       74 |   mbedtls_md5_starts_ret(&_ctx);
          |   ^~~~~~~~~~~~~~~~~~~~~~
          |   mbedtls_md5_starts
    c:\Users\Tin\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp:75:3: error: 'mbedtls_md5_update_ret' was not declared in this scope; did you mean 'mbedtls_md5_update'?
       75 |   mbedtls_md5_update_ret(&_ctx, data, len);
          |   ^~~~~~~~~~~~~~~~~~~~~~
          |   mbedtls_md5_update
    c:\Users\Tin\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp:76:3: error: 'mbedtls_md5_finish_ret' was not declared in this scope; did you mean 'mbedtls_md5_finish'?
       76 |   mbedtls_md5_finish_ret(&_ctx, _buf);
          |   ^~~~~~~~~~~~~~~~~~~~~~
          |   mbedtls_md5_finish
    
    /*
     * Spy Microphone
     * Digijeunes
     * 
     * Aim: Showing that you should double check your devices and how your data can be used without you knowing it
     * It shoudl be a device where the user have the object close and talk.
     * The voice is recorded on SD card and will be sent to a server online.
     */
    
    #include "Arduino.h"
    #include <FS.h>
    #include "Wav.h"
    #include "I2S.h"
    #include <SD.h>
    #include <WiFi.h>
    #include <WiFiUdp.h>
    #include "time.h"
    #include <AsyncTCP.h>
    #include <ESPAsyncWebServer.h>
    #include <ESP32_FTPClient.h>
    
    char ftp_server[] = "graef.email";
    char ftp_user[]   = "wav@graef.email";
    char ftp_pass[]   = "#Dk7dJWav199";
    
    // you can pass a FTP timeout and debbug mode on the last 2 arguments
    ESP32_FTPClient ftp (ftp_server,ftp_user,ftp_pass, 5000, 0); // Disable Debug to increase Tx Speed
    
    AsyncWebServer server(80);         //object created on default port 80
    
    //comment the first line and uncomment the second if you use MAX9814
    //#define I2S_MODE I2S_MODE_RX
    #define I2S_MODE I2S_MODE_ADC_BUILT_IN
    
    // WiFi 
    const char* ssid     = "meins";
    const char* password = "#dag!ang!beg!hag#28#";
    const char* ntpServer = "pool.ntp.org";
    const long  gmtOffset_sec = 3600;
    const int   daylightOffset_sec = 3600;
    
    const int max_record_time = 60;  // second
    
    const int headerSize = 44;
    const int numCommunicationData = 8000;
    const int numPartWavData = numCommunicationData/4;
    byte header[headerSize];
    char communicationData[numCommunicationData];
    char partWavData[numPartWavData];
    File file;
    
    int micPin = 34;
    int ledPin = 33;
    int buttonPin = 32;
    bool recordingState = false;
    bool stopSignal = false;
    
    unsigned long timeStarted;
    int done = 0;
    void startRecord() { 
      
        // IRAM_ATTR pour les attachInterrupt qui doivent se placer avant le setup et ne servent que de "flag" puisqu'elle 
        // interrompent tout le système et doivent finirent rapidement
        
        detachInterrupt(buttonPin);
        digitalWrite(ledPin, HIGH);
        recordingState = true;
        
        // Recording start
    }
    
    void stopRecord() {
      
        stopSignal = true;
        detachInterrupt(buttonPin);
    }
    
    void setup() {
      
        Serial.begin(115200);
        delay(1000);
        
        //WiFi
        Serial.print("Connecting to ");
        Serial.println(ssid);
        WiFi.begin(ssid, password);
        while (WiFi.status() != WL_CONNECTED) {
          delay(500);
          Serial.print(".");
        }
        // Print local IP address and start web server
        Serial.println("");
        Serial.println("WiFi connected.");
        Serial.println("IP address: ");
        Serial.println(WiFi.localIP());
      
      
        // Set offset time in seconds to adjust for your timezone, for example:
        // GMT +1 = 3600
        // GMT +8 = 28800
        // GMT -1 = -3600
        // GMT 0 = 0
        // Init and get the time
        configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
        
        // SD Card loading
        if (!SD.begin()) Serial.println("SD begin failed");
        while(!SD.begin()){
          Serial.print(".");
          delay(500);
        }
        
        server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
        request->send(SD, "/index.html", "text/html");
        });
      
        server.serveStatic("/", SD, "/");
      
        server.begin();
      
        pinMode(ledPin, OUTPUT);
        pinMode(buttonPin, INPUT_PULLUP);
        attachInterrupt(buttonPin, startRecord, CHANGE);
        digitalWrite(ledPin, LOW);
    }
    
    void loop() {
      char *myStrings[] ={};
      
      //If button has been pressed
      if(recordingState==true){
        
    
          String dateFormat = printLocalTime();
          String filename = "/REC_"+dateFormat+".wav";
          
          String filename4ftp = "REC_"+dateFormat+".wav";
          char filenameftp[filename4ftp.length()+1];
          filename4ftp.toCharArray(filenameftp, filename4ftp.length()+1);
          SD.remove(filename);
          
          file = SD.open(filename, FILE_WRITE);
          if (!file) return;
    
          timeStarted = millis();
          
          attachInterrupt(buttonPin, stopRecord, CHANGE);
          I2S_Init(I2S_MODE, I2S_BITS_PER_SAMPLE_32BIT);
          while((timeStarted + max_record_time * 1000) > millis() && stopSignal == false) {
            
            I2S_Read(communicationData, numCommunicationData);
            
            for (int i = 0; i < numCommunicationData/8; ++i) {
              
              partWavData[2*i] = communicationData[8*i + 2];
              partWavData[2*i + 1] = communicationData[8*i + 3];
              
            }
            file.write((const byte*)partWavData, numPartWavData);
          }
    
          stopSignal=false;
    
          // Create the .wav header file
          int record_time = (millis()-timeStarted)/1000;
          const int waveDataSize = record_time * 88000;
          
          CreateWavHeader(header, waveDataSize);
          file.seek(0);
          file.write(header, headerSize);
    
          file.close();
          i2s_driver_uninstall(I2S_NUM_0);
          
          recordingState=false;
          
          Serial.println("Recording finished");
          
          digitalWrite(ledPin, LOW);
          delay(1000);
    
          //FTP Upload
          ftp.OpenConnection();
          ftp.ChangeWorkDir("upload/spy_mic/");
                                                                         // ::BYTES::
          readAndSendBigBinFile(SD, filenameftp, ftp);                 // 272,546
          ftp.CloseConnection();
          delay(1000);
          attachInterrupt(buttonPin, startRecord, CHANGE);
          
      }
    
      if (done == 1235656){
        ftp.OpenConnection();
      
        ftp.ChangeWorkDir("upload/spy_mic/");
                                                                          // ::BYTES::
        readAndSendBigBinFile(SD, "REC_22-12-01_014700.wav", ftp);                 // 272,546
      
        ftp.CloseConnection();
        done = 1;
      }
    }
    
    // Return formatted time for filename
    String printLocalTime(){
      
        struct tm timeinfo;
        if(!getLocalTime(&timeinfo)){
          return "dateUnknown";
        }
        char timeCompact[16];
        strftime(timeCompact,16, "%y-%m-%d_%H%M%S", &timeinfo);
        return timeCompact;
      
    }
    
    
    
    // ReadFile Example from ESP32 SD_MMC Library within Core\Libraries
    // Changed to also write the output to an FTP Stream
    void readAndSendBigBinFile(fs::FS& fs, const char* path, ESP32_FTPClient ftpClient) {
        ftpClient.InitFile("Type I");
        ftpClient.NewFile(path);
        
        String fullPath = "/";
        fullPath.concat(path);
        Serial.printf("Reading file: %s\n", fullPath);
    
        File file = fs.open(fullPath);
        if (!file) {
            Serial.println("Failed to open file for reading");
            return;
        }
    
        Serial.print("Read from file: ");
        
        while (file.available()) {
            // Create and fill a buffer
            unsigned char buf[1024];
            int readVal = file.read(buf, sizeof(buf));
            ftpClient.WriteData(buf,sizeof(buf));
        }
        ftpClient.CloseFile();
        file.close();
    }
    
    

    Zeigt eure Lovelace-Visualisierung klick
    (Auch ideal um sich Anregungen zu holen)

    Meine Tabellen für eure Visualisierung klick

    OliverIOO MartinPM 2 Antworten Letzte Antwort
    0
    • David G.D David G.

      Was möchte hier die arduino ide von mir?

      Ist mein erstes Projekt und den Code für das Projekt habe ich nur per C&P eingefügt.

      c:\Users\Tin\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp: In function 'bool getMD5(uint8_t*, uint16_t, char*)':
      c:\Users\Tin\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp:74:3: error: 'mbedtls_md5_starts_ret' was not declared in this scope; did you mean 'mbedtls_md5_starts'?
         74 |   mbedtls_md5_starts_ret(&_ctx);
            |   ^~~~~~~~~~~~~~~~~~~~~~
            |   mbedtls_md5_starts
      c:\Users\Tin\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp:75:3: error: 'mbedtls_md5_update_ret' was not declared in this scope; did you mean 'mbedtls_md5_update'?
         75 |   mbedtls_md5_update_ret(&_ctx, data, len);
            |   ^~~~~~~~~~~~~~~~~~~~~~
            |   mbedtls_md5_update
      c:\Users\Tin\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp:76:3: error: 'mbedtls_md5_finish_ret' was not declared in this scope; did you mean 'mbedtls_md5_finish'?
         76 |   mbedtls_md5_finish_ret(&_ctx, _buf);
            |   ^~~~~~~~~~~~~~~~~~~~~~
            |   mbedtls_md5_finish
      
      /*
       * Spy Microphone
       * Digijeunes
       * 
       * Aim: Showing that you should double check your devices and how your data can be used without you knowing it
       * It shoudl be a device where the user have the object close and talk.
       * The voice is recorded on SD card and will be sent to a server online.
       */
      
      #include "Arduino.h"
      #include <FS.h>
      #include "Wav.h"
      #include "I2S.h"
      #include <SD.h>
      #include <WiFi.h>
      #include <WiFiUdp.h>
      #include "time.h"
      #include <AsyncTCP.h>
      #include <ESPAsyncWebServer.h>
      #include <ESP32_FTPClient.h>
      
      char ftp_server[] = "graef.email";
      char ftp_user[]   = "wav@graef.email";
      char ftp_pass[]   = "#Dk7dJWav199";
      
      // you can pass a FTP timeout and debbug mode on the last 2 arguments
      ESP32_FTPClient ftp (ftp_server,ftp_user,ftp_pass, 5000, 0); // Disable Debug to increase Tx Speed
      
      AsyncWebServer server(80);         //object created on default port 80
      
      //comment the first line and uncomment the second if you use MAX9814
      //#define I2S_MODE I2S_MODE_RX
      #define I2S_MODE I2S_MODE_ADC_BUILT_IN
      
      // WiFi 
      const char* ssid     = "meins";
      const char* password = "#dag!ang!beg!hag#28#";
      const char* ntpServer = "pool.ntp.org";
      const long  gmtOffset_sec = 3600;
      const int   daylightOffset_sec = 3600;
      
      const int max_record_time = 60;  // second
      
      const int headerSize = 44;
      const int numCommunicationData = 8000;
      const int numPartWavData = numCommunicationData/4;
      byte header[headerSize];
      char communicationData[numCommunicationData];
      char partWavData[numPartWavData];
      File file;
      
      int micPin = 34;
      int ledPin = 33;
      int buttonPin = 32;
      bool recordingState = false;
      bool stopSignal = false;
      
      unsigned long timeStarted;
      int done = 0;
      void startRecord() { 
        
          // IRAM_ATTR pour les attachInterrupt qui doivent se placer avant le setup et ne servent que de "flag" puisqu'elle 
          // interrompent tout le système et doivent finirent rapidement
          
          detachInterrupt(buttonPin);
          digitalWrite(ledPin, HIGH);
          recordingState = true;
          
          // Recording start
      }
      
      void stopRecord() {
        
          stopSignal = true;
          detachInterrupt(buttonPin);
      }
      
      void setup() {
        
          Serial.begin(115200);
          delay(1000);
          
          //WiFi
          Serial.print("Connecting to ");
          Serial.println(ssid);
          WiFi.begin(ssid, password);
          while (WiFi.status() != WL_CONNECTED) {
            delay(500);
            Serial.print(".");
          }
          // Print local IP address and start web server
          Serial.println("");
          Serial.println("WiFi connected.");
          Serial.println("IP address: ");
          Serial.println(WiFi.localIP());
        
        
          // Set offset time in seconds to adjust for your timezone, for example:
          // GMT +1 = 3600
          // GMT +8 = 28800
          // GMT -1 = -3600
          // GMT 0 = 0
          // Init and get the time
          configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
          
          // SD Card loading
          if (!SD.begin()) Serial.println("SD begin failed");
          while(!SD.begin()){
            Serial.print(".");
            delay(500);
          }
          
          server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
          request->send(SD, "/index.html", "text/html");
          });
        
          server.serveStatic("/", SD, "/");
        
          server.begin();
        
          pinMode(ledPin, OUTPUT);
          pinMode(buttonPin, INPUT_PULLUP);
          attachInterrupt(buttonPin, startRecord, CHANGE);
          digitalWrite(ledPin, LOW);
      }
      
      void loop() {
        char *myStrings[] ={};
        
        //If button has been pressed
        if(recordingState==true){
          
      
            String dateFormat = printLocalTime();
            String filename = "/REC_"+dateFormat+".wav";
            
            String filename4ftp = "REC_"+dateFormat+".wav";
            char filenameftp[filename4ftp.length()+1];
            filename4ftp.toCharArray(filenameftp, filename4ftp.length()+1);
            SD.remove(filename);
            
            file = SD.open(filename, FILE_WRITE);
            if (!file) return;
      
            timeStarted = millis();
            
            attachInterrupt(buttonPin, stopRecord, CHANGE);
            I2S_Init(I2S_MODE, I2S_BITS_PER_SAMPLE_32BIT);
            while((timeStarted + max_record_time * 1000) > millis() && stopSignal == false) {
              
              I2S_Read(communicationData, numCommunicationData);
              
              for (int i = 0; i < numCommunicationData/8; ++i) {
                
                partWavData[2*i] = communicationData[8*i + 2];
                partWavData[2*i + 1] = communicationData[8*i + 3];
                
              }
              file.write((const byte*)partWavData, numPartWavData);
            }
      
            stopSignal=false;
      
            // Create the .wav header file
            int record_time = (millis()-timeStarted)/1000;
            const int waveDataSize = record_time * 88000;
            
            CreateWavHeader(header, waveDataSize);
            file.seek(0);
            file.write(header, headerSize);
      
            file.close();
            i2s_driver_uninstall(I2S_NUM_0);
            
            recordingState=false;
            
            Serial.println("Recording finished");
            
            digitalWrite(ledPin, LOW);
            delay(1000);
      
            //FTP Upload
            ftp.OpenConnection();
            ftp.ChangeWorkDir("upload/spy_mic/");
                                                                           // ::BYTES::
            readAndSendBigBinFile(SD, filenameftp, ftp);                 // 272,546
            ftp.CloseConnection();
            delay(1000);
            attachInterrupt(buttonPin, startRecord, CHANGE);
            
        }
      
        if (done == 1235656){
          ftp.OpenConnection();
        
          ftp.ChangeWorkDir("upload/spy_mic/");
                                                                            // ::BYTES::
          readAndSendBigBinFile(SD, "REC_22-12-01_014700.wav", ftp);                 // 272,546
        
          ftp.CloseConnection();
          done = 1;
        }
      }
      
      // Return formatted time for filename
      String printLocalTime(){
        
          struct tm timeinfo;
          if(!getLocalTime(&timeinfo)){
            return "dateUnknown";
          }
          char timeCompact[16];
          strftime(timeCompact,16, "%y-%m-%d_%H%M%S", &timeinfo);
          return timeCompact;
        
      }
      
      
      
      // ReadFile Example from ESP32 SD_MMC Library within Core\Libraries
      // Changed to also write the output to an FTP Stream
      void readAndSendBigBinFile(fs::FS& fs, const char* path, ESP32_FTPClient ftpClient) {
          ftpClient.InitFile("Type I");
          ftpClient.NewFile(path);
          
          String fullPath = "/";
          fullPath.concat(path);
          Serial.printf("Reading file: %s\n", fullPath);
      
          File file = fs.open(fullPath);
          if (!file) {
              Serial.println("Failed to open file for reading");
              return;
          }
      
          Serial.print("Read from file: ");
          
          while (file.available()) {
              // Create and fill a buffer
              unsigned char buf[1024];
              int readVal = file.read(buf, sizeof(buf));
              ftpClient.WriteData(buf,sizeof(buf));
          }
          ftpClient.CloseFile();
          file.close();
      }
      
      
      OliverIOO Offline
      OliverIOO Offline
      OliverIO
      schrieb am zuletzt editiert von OliverIO
      #2

      @david-g

      Das ergab eine Google Suche

      https://github.com/me-no-dev/ESPAsyncWebServer/issues/1419

      Aber auch noch das readme des repos beachten

      Meine Adapter und Widgets
      TVProgram, SqueezeboxRPC, OpenLiga, RSSFeed, MyTime,, pi-hole2, vis-json-template, skiinfo, vis-mapwidgets, vis-2-widgets-rssfeed
      Links im Profil

      David G.D 1 Antwort Letzte Antwort
      0
      • OliverIOO OliverIO

        @david-g

        Das ergab eine Google Suche

        https://github.com/me-no-dev/ESPAsyncWebServer/issues/1419

        Aber auch noch das readme des repos beachten

        David G.D Online
        David G.D Online
        David G.
        schrieb am zuletzt editiert von
        #3

        @oliverio

        Irgendwie zu hoch für mich.
        Finde als Lösung nur 3 Zeilen zu ersetzen, aber dafür den riesen Text?

        Zeigt eure Lovelace-Visualisierung klick
        (Auch ideal um sich Anregungen zu holen)

        Meine Tabellen für eure Visualisierung klick

        OliverIOO 1 Antwort Letzte Antwort
        0
        • David G.D David G.

          @oliverio

          Irgendwie zu hoch für mich.
          Finde als Lösung nur 3 Zeilen zu ersetzen, aber dafür den riesen Text?

          OliverIOO Offline
          OliverIOO Offline
          OliverIO
          schrieb am zuletzt editiert von
          #4

          @david-g

          du sollst im code nichts ersetzen.
          du musst die ganze bibliothek updaten.
          wenn ich es richtig herauslese benutzt du eine bibliothek die zu v2 passt,
          musst aber v3 verwenden.

          da dieses repo archiviert wurde und mittlerweile woanders hingeführt wurde (deswegen readme lesen), am besten von dort aktualisieren

          Meine Adapter und Widgets
          TVProgram, SqueezeboxRPC, OpenLiga, RSSFeed, MyTime,, pi-hole2, vis-json-template, skiinfo, vis-mapwidgets, vis-2-widgets-rssfeed
          Links im Profil

          David G.D 1 Antwort Letzte Antwort
          0
          • OliverIOO OliverIO

            @david-g

            du sollst im code nichts ersetzen.
            du musst die ganze bibliothek updaten.
            wenn ich es richtig herauslese benutzt du eine bibliothek die zu v2 passt,
            musst aber v3 verwenden.

            da dieses repo archiviert wurde und mittlerweile woanders hingeführt wurde (deswegen readme lesen), am besten von dort aktualisieren

            David G.D Online
            David G.D Online
            David G.
            schrieb am zuletzt editiert von
            #5

            @oliverio

            Ich hatte schon die dort verlinkte Version installiert

            a9b1c6c6-b1f0-4caf-a49e-d9e4f3426a9b-image.png

            Zeigt eure Lovelace-Visualisierung klick
            (Auch ideal um sich Anregungen zu holen)

            Meine Tabellen für eure Visualisierung klick

            OliverIOO 1 Antwort Letzte Antwort
            0
            • David G.D David G.

              @oliverio

              Ich hatte schon die dort verlinkte Version installiert

              a9b1c6c6-b1f0-4caf-a49e-d9e4f3426a9b-image.png

              OliverIOO Offline
              OliverIOO Offline
              OliverIO
              schrieb am zuletzt editiert von
              #6

              @david-g

              das würde ich nochmal prüfen.
              weder das alte noch das neue symbol, das in der fehlermeldung oben angemäkelt wird ist noch in der bibliothek enthalten. das wurde durch folgenden commit entfernt und gegen andere befehle ausgetauscht.
              https://github.com/ESP32Async/ESPAsyncWebServer/commit/57244d47444a3281ba30f4c9da60fb23d05eb495
              ergo hast du noch eine alte bibliothek bei dir

              Meine Adapter und Widgets
              TVProgram, SqueezeboxRPC, OpenLiga, RSSFeed, MyTime,, pi-hole2, vis-json-template, skiinfo, vis-mapwidgets, vis-2-widgets-rssfeed
              Links im Profil

              1 Antwort Letzte Antwort
              0
              • David G.D David G.

                Was möchte hier die arduino ide von mir?

                Ist mein erstes Projekt und den Code für das Projekt habe ich nur per C&P eingefügt.

                c:\Users\Tin\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp: In function 'bool getMD5(uint8_t*, uint16_t, char*)':
                c:\Users\Tin\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp:74:3: error: 'mbedtls_md5_starts_ret' was not declared in this scope; did you mean 'mbedtls_md5_starts'?
                   74 |   mbedtls_md5_starts_ret(&_ctx);
                      |   ^~~~~~~~~~~~~~~~~~~~~~
                      |   mbedtls_md5_starts
                c:\Users\Tin\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp:75:3: error: 'mbedtls_md5_update_ret' was not declared in this scope; did you mean 'mbedtls_md5_update'?
                   75 |   mbedtls_md5_update_ret(&_ctx, data, len);
                      |   ^~~~~~~~~~~~~~~~~~~~~~
                      |   mbedtls_md5_update
                c:\Users\Tin\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp:76:3: error: 'mbedtls_md5_finish_ret' was not declared in this scope; did you mean 'mbedtls_md5_finish'?
                   76 |   mbedtls_md5_finish_ret(&_ctx, _buf);
                      |   ^~~~~~~~~~~~~~~~~~~~~~
                      |   mbedtls_md5_finish
                
                /*
                 * Spy Microphone
                 * Digijeunes
                 * 
                 * Aim: Showing that you should double check your devices and how your data can be used without you knowing it
                 * It shoudl be a device where the user have the object close and talk.
                 * The voice is recorded on SD card and will be sent to a server online.
                 */
                
                #include "Arduino.h"
                #include <FS.h>
                #include "Wav.h"
                #include "I2S.h"
                #include <SD.h>
                #include <WiFi.h>
                #include <WiFiUdp.h>
                #include "time.h"
                #include <AsyncTCP.h>
                #include <ESPAsyncWebServer.h>
                #include <ESP32_FTPClient.h>
                
                char ftp_server[] = "graef.email";
                char ftp_user[]   = "wav@graef.email";
                char ftp_pass[]   = "#Dk7dJWav199";
                
                // you can pass a FTP timeout and debbug mode on the last 2 arguments
                ESP32_FTPClient ftp (ftp_server,ftp_user,ftp_pass, 5000, 0); // Disable Debug to increase Tx Speed
                
                AsyncWebServer server(80);         //object created on default port 80
                
                //comment the first line and uncomment the second if you use MAX9814
                //#define I2S_MODE I2S_MODE_RX
                #define I2S_MODE I2S_MODE_ADC_BUILT_IN
                
                // WiFi 
                const char* ssid     = "meins";
                const char* password = "#dag!ang!beg!hag#28#";
                const char* ntpServer = "pool.ntp.org";
                const long  gmtOffset_sec = 3600;
                const int   daylightOffset_sec = 3600;
                
                const int max_record_time = 60;  // second
                
                const int headerSize = 44;
                const int numCommunicationData = 8000;
                const int numPartWavData = numCommunicationData/4;
                byte header[headerSize];
                char communicationData[numCommunicationData];
                char partWavData[numPartWavData];
                File file;
                
                int micPin = 34;
                int ledPin = 33;
                int buttonPin = 32;
                bool recordingState = false;
                bool stopSignal = false;
                
                unsigned long timeStarted;
                int done = 0;
                void startRecord() { 
                  
                    // IRAM_ATTR pour les attachInterrupt qui doivent se placer avant le setup et ne servent que de "flag" puisqu'elle 
                    // interrompent tout le système et doivent finirent rapidement
                    
                    detachInterrupt(buttonPin);
                    digitalWrite(ledPin, HIGH);
                    recordingState = true;
                    
                    // Recording start
                }
                
                void stopRecord() {
                  
                    stopSignal = true;
                    detachInterrupt(buttonPin);
                }
                
                void setup() {
                  
                    Serial.begin(115200);
                    delay(1000);
                    
                    //WiFi
                    Serial.print("Connecting to ");
                    Serial.println(ssid);
                    WiFi.begin(ssid, password);
                    while (WiFi.status() != WL_CONNECTED) {
                      delay(500);
                      Serial.print(".");
                    }
                    // Print local IP address and start web server
                    Serial.println("");
                    Serial.println("WiFi connected.");
                    Serial.println("IP address: ");
                    Serial.println(WiFi.localIP());
                  
                  
                    // Set offset time in seconds to adjust for your timezone, for example:
                    // GMT +1 = 3600
                    // GMT +8 = 28800
                    // GMT -1 = -3600
                    // GMT 0 = 0
                    // Init and get the time
                    configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
                    
                    // SD Card loading
                    if (!SD.begin()) Serial.println("SD begin failed");
                    while(!SD.begin()){
                      Serial.print(".");
                      delay(500);
                    }
                    
                    server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
                    request->send(SD, "/index.html", "text/html");
                    });
                  
                    server.serveStatic("/", SD, "/");
                  
                    server.begin();
                  
                    pinMode(ledPin, OUTPUT);
                    pinMode(buttonPin, INPUT_PULLUP);
                    attachInterrupt(buttonPin, startRecord, CHANGE);
                    digitalWrite(ledPin, LOW);
                }
                
                void loop() {
                  char *myStrings[] ={};
                  
                  //If button has been pressed
                  if(recordingState==true){
                    
                
                      String dateFormat = printLocalTime();
                      String filename = "/REC_"+dateFormat+".wav";
                      
                      String filename4ftp = "REC_"+dateFormat+".wav";
                      char filenameftp[filename4ftp.length()+1];
                      filename4ftp.toCharArray(filenameftp, filename4ftp.length()+1);
                      SD.remove(filename);
                      
                      file = SD.open(filename, FILE_WRITE);
                      if (!file) return;
                
                      timeStarted = millis();
                      
                      attachInterrupt(buttonPin, stopRecord, CHANGE);
                      I2S_Init(I2S_MODE, I2S_BITS_PER_SAMPLE_32BIT);
                      while((timeStarted + max_record_time * 1000) > millis() && stopSignal == false) {
                        
                        I2S_Read(communicationData, numCommunicationData);
                        
                        for (int i = 0; i < numCommunicationData/8; ++i) {
                          
                          partWavData[2*i] = communicationData[8*i + 2];
                          partWavData[2*i + 1] = communicationData[8*i + 3];
                          
                        }
                        file.write((const byte*)partWavData, numPartWavData);
                      }
                
                      stopSignal=false;
                
                      // Create the .wav header file
                      int record_time = (millis()-timeStarted)/1000;
                      const int waveDataSize = record_time * 88000;
                      
                      CreateWavHeader(header, waveDataSize);
                      file.seek(0);
                      file.write(header, headerSize);
                
                      file.close();
                      i2s_driver_uninstall(I2S_NUM_0);
                      
                      recordingState=false;
                      
                      Serial.println("Recording finished");
                      
                      digitalWrite(ledPin, LOW);
                      delay(1000);
                
                      //FTP Upload
                      ftp.OpenConnection();
                      ftp.ChangeWorkDir("upload/spy_mic/");
                                                                                     // ::BYTES::
                      readAndSendBigBinFile(SD, filenameftp, ftp);                 // 272,546
                      ftp.CloseConnection();
                      delay(1000);
                      attachInterrupt(buttonPin, startRecord, CHANGE);
                      
                  }
                
                  if (done == 1235656){
                    ftp.OpenConnection();
                  
                    ftp.ChangeWorkDir("upload/spy_mic/");
                                                                                      // ::BYTES::
                    readAndSendBigBinFile(SD, "REC_22-12-01_014700.wav", ftp);                 // 272,546
                  
                    ftp.CloseConnection();
                    done = 1;
                  }
                }
                
                // Return formatted time for filename
                String printLocalTime(){
                  
                    struct tm timeinfo;
                    if(!getLocalTime(&timeinfo)){
                      return "dateUnknown";
                    }
                    char timeCompact[16];
                    strftime(timeCompact,16, "%y-%m-%d_%H%M%S", &timeinfo);
                    return timeCompact;
                  
                }
                
                
                
                // ReadFile Example from ESP32 SD_MMC Library within Core\Libraries
                // Changed to also write the output to an FTP Stream
                void readAndSendBigBinFile(fs::FS& fs, const char* path, ESP32_FTPClient ftpClient) {
                    ftpClient.InitFile("Type I");
                    ftpClient.NewFile(path);
                    
                    String fullPath = "/";
                    fullPath.concat(path);
                    Serial.printf("Reading file: %s\n", fullPath);
                
                    File file = fs.open(fullPath);
                    if (!file) {
                        Serial.println("Failed to open file for reading");
                        return;
                    }
                
                    Serial.print("Read from file: ");
                    
                    while (file.available()) {
                        // Create and fill a buffer
                        unsigned char buf[1024];
                        int readVal = file.read(buf, sizeof(buf));
                        ftpClient.WriteData(buf,sizeof(buf));
                    }
                    ftpClient.CloseFile();
                    file.close();
                }
                
                
                MartinPM Online
                MartinPM Online
                MartinP
                schrieb am zuletzt editiert von
                #7

                @david-g Das eingebettete Beispielvideo https://www.instructables.com/Make-Your-Own-Spy-Bug-Arduino-Voice-Recorder/ ist 7 Jahre alt!

                Entweder muss man sich da die passenden Libraries dazu besorgen, oder versuchen, das Beispiel anzupassen...

                Intel(R) Celeron(R) CPU N3000 @ 1.04GHz 8G RAM 480G SSD
                Virtualization : unprivileged lxc container (debian 12 on Proxmox 8.4.14)
                Linux pve 6.8.12-16-pve
                6 GByte RAM für den Container
                Fritzbox 6591 FW 8.03 (Vodafone Leih-Box)
                Remote-Access über Wireguard der Fritzbox

                1 Antwort Letzte Antwort
                0
                • David G.D Online
                  David G.D Online
                  David G.
                  schrieb am zuletzt editiert von
                  #8

                  Hab es eben hinbekommen. Hab eine andere Quelle für den esp async Webserver genommen.
                  Im WLAN ist das Teil jetzt auch.

                  Jetzt fehlt nur noch ein weiteres Breadboard. Was ich hatte war zu klein.

                  Das Micro hab ich eben glaube auch erfolgreich mehr schlecht als recht gelötet.

                  Zeigt eure Lovelace-Visualisierung klick
                  (Auch ideal um sich Anregungen zu holen)

                  Meine Tabellen für eure Visualisierung klick

                  1 Antwort Letzte Antwort
                  0
                  Antworten
                  • In einem neuen Thema antworten
                  Anmelden zum Antworten
                  • Älteste zuerst
                  • Neuste zuerst
                  • Meiste Stimmen


                  Support us

                  ioBroker
                  Community Adapters
                  Donate

                  483

                  Online

                  32.5k

                  Benutzer

                  81.6k

                  Themen

                  1.3m

                  Beiträge
                  Community
                  Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                  ioBroker Community 2014-2025
                  logo
                  • Anmelden

                  • Du hast noch kein Konto? Registrieren

                  • Anmelden oder registrieren, um zu suchen
                  • Erster Beitrag
                    Letzter Beitrag
                  0
                  • Home
                  • Aktuell
                  • Tags
                  • Ungelesen 0
                  • Kategorien
                  • Unreplied
                  • Beliebt
                  • GitHub
                  • Docu
                  • Hilfe