NEWS
Phrasingfehler Arduino ide
-
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(); }
-
Das ergab eine Google Suche
https://github.com/me-no-dev/ESPAsyncWebServer/issues/1419
Aber auch noch das readme des repos beachten
-
Irgendwie zu hoch für mich.
Finde als Lösung nur 3 Zeilen zu ersetzen, aber dafür den riesen Text? -
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
-
-
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 -
@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...
-
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.