server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
{
AsyncResponseStream *response = request->beginResponseStream("text/html");
response->printf_P(HTMLhead);
response->printf_P(HTMLMain);
response->printf_P(HTMLfoot);
request->send(response);
});
Hi all. Fairly new and very sorry if answered as I've looked but I'm trying to use AsyncWebServer with SdFat and 128 GB exFAT SDHC. I'm having issues with the following lines in my code since I'm not using SD.h
request->send(SD, "/index.html", "text/html");
});
server.serveStatic("/", SD, "/");
I've tried changing SD
to sd
, and file
objects without success. Also tried FS
and fs
with no luck. I'm fairly new and jsut not sure what filesystem to send from SdFat for request->send
hi all
I made a couple of header file for different prepherals + header file for my asyncserver & asyncwebsocket
my_wifi.h
AsyncWebServer server(80);
AsyncWebSocket WS("/ws");
in other header file I have sensor to measure sumeting and send through websocket
my_sensor.h
WS.textAll(my_data);
but it can not see my WS instance error: 'WS' was not declared in this scope
does anyone know how can I pass my WS instance to other header files
Hi guys, i still have a problem - no idea what to do, heres again my question: I am reading an value continously in my main/loop-code and writing it in a global variabal. in my server.on callback/handler function i am reading this value and returning it to the clients browser. for sure its crashing when i write it the same time.
Q1: how is the best way to avoid this (i am using a locked-variable at the moment).
Q2: since its async somehow, is there task scheduling and running on different cores@esp32 involved? Best way to exchange "data"/share aviables between "global code" and webserver(callbacks?
Hope im not mixing things too much - and sri for some rookie questening stuff :) Tnx for your support. M.
why not with websocket?
WS.text(WSclinet,data);
however after a while _messageQueue.length()
exceeded of maximum size and throw ERROR: Too many messages queued
, does anyone know how to solve it
clearQ
after each transmitting void AsyncWebSocket::clearQ(uint32_t id){
AsyncWebSocketClient * c = client(id);
if(c)
c->QueuFree();
}
.......
void AsyncWebSocketClient::QueuFree(){
_messageQueue.free();
}
any solutions for using ESP32-C3 Stamp with ESPAsyncWebServer and AsyncTCP.h successfully? getting compile errors on arduino ide 1.8.16 with installed esp32 arduino boardmanager version >= 2.0.0....
C:\Users\thoma\Documents\Arduino\libraries\ESPAsyncWebServer-master\src\AsyncWebSocket.cpp: In member function 'IPAddress AsyncWebSocketClient::remoteIP()':
C:\Users\thoma\Documents\Arduino\libraries\ESPAsyncWebServer-master\src\AsyncWebSocket.cpp:843:28: error: call of overloaded 'IPAddress(unsigned int)' is ambiguous
return IPAddress(0U);
^
In file included from C:\Users\thoma\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0\cores\esp32/Arduino.h:163,
from C:\Users\thoma\Documents\Arduino\libraries\ESPAsyncWebServer-master\src\AsyncWebSocket.cpp:21:
C:\Users\thoma\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0\cores\esp32/IPAddress.h:51:5: note: candidate: 'IPAddress::IPAddress(const uint8_t)'
IPAddress(const uint8_t address);
^~~
C:\Users\thoma\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0\cores\esp32/IPAddress.h:50:5: note: candidate: 'IPAddress::IPAddress(uint32_t)'
IPAddress(uint32_t address);
^~~
C:\Users\thoma\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.0\cores\esp32/IPAddress.h:29:7: note: candidate: 'constexpr IPAddress::IPAddress(const IPAddress&)'
class IPAddress: public Printable
^~~~~
exit status 1
Hello everyone.
Hope you all are doing well.
I am having an issue where I get an exception due to the AsyncWebServer library in esp32.
Basically the issue occurs as soon as I connect my device with the esp AccessPoint or when the Esp connects to a WiFi station.
Can someone please help me with this.
Thanks in advance.
abort() was called at PC 0x401abfb2 on core 1
ELF file SHA256: 0000000000000000
Backtrace: 0x400903e8:0x3ffd3290 0x40090745:0x3ffd32b0 0x401abfb2:0x3ffd32d0 0x4020f2dc:0x3ffd32f0 0x4020f2a1:0x3ffd3310 0x4010035a:0x3ffd3330 0x400f4b2d:0x3ffd3370 0x400f72d0:0x3ffd3480 0x400f76de:0x3ffd34c0 0x40119180:0x3ffd34e0 0x400921f2:0x3ffd3500
#0 0x400903e8:0x3ffd3290 in invoke_abort at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:648
#1 0x40090745:0x3ffd32b0 in abort at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:648
#2 0x401abfb2:0x3ffd32d0 in __cxa_allocate_dependent_exception at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/cxx/cxx_exception_stubs.cpp:19
#3 0x4020f2dc:0x3ffd32f0 in operator new(unsigned int) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/new_op.cc:54
#4 0x4020f2a1:0x3ffd3310 in operator new[](unsigned int) at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/libsupc++/new_opv.cc:32
#5 0x4010035a:0x3ffd3330 in WiFiUDP::parsePacket() at C:/Users/umer.arshad/.platformio/packages/framework-arduinoespressif32@src-e9b1fbd6563a55e19ddae15e1fc09589/cores/esp32/Udp.h:46
#6 0x400f4b2d:0x3ffd3370 in handleNotifications() at wled00/udp.cpp:204
#7 0x400f72d0:0x3ffd3480 in WLED::loop() at wled00/bus_manager.h:149
#8 0x400f76de:0x3ffd34c0 in loop() at D:/MyStuff/WattsLights/WLED/wled00/wled00.ino:20
#9 0x40119180:0x3ffd34e0 in loopTask(void*) at C:/Users/umer.arshad/.platformio/packages/framework-arduinoespressif32@src-e9b1fbd6563a55e19ddae15e1fc09589/cores/esp32/main.cpp:23
#10 0x400921f2:0x3ffd3500 in vPortTaskWrapper at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)
Rebooting...
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DOUT, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1084
load:0x40078000,len:11220
load:0x40080400,len:5360
entry 0x4008067c
@atanisoft Thank you for your suggestion. It helped a little with the issue but I still am facing the problem
Basically I am using BLE alongwith WiFi
When I initialize BLE before connecting WiFi it crashes as follows:
Connecting to WFH...
abort() was called at PC 0x401f8477 on core 0
ELF file SHA256: 0000000000000000
Backtrace: 0x40090370:0x3fff0580 0x400906cd:0x3fff05a0 0x401f8477:0x3fff05c0 0x401d7ca0:0x3fff05e0 0x401d6fde:0x3fff0600 0x401fb012:0x3fff0620 0x4009217a:0x3fff0650
#0 0x40090370:0x3fff0580 in invoke_abort at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:648
#1 0x400906cd:0x3fff05a0 in abort at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:648
#2 0x401f8477:0x3fff05c0 in pm_set_sleep_type at ??:?
#3 0x401d7ca0:0x3fff05e0 in wifi_set_ps_process at ??:?
#4 0x401d6fde:0x3fff0600 in ieee80211_ioctl_process at ??:?
#5 0x401fb012:0x3fff0620 in ppTask at ??:?
#6 0x4009217a:0x3fff0650 in vPortTaskWrapper at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)
Rebooting...
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DOUT, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1084
load:0x40078000,len:11220
load:0x40080400,len:5360
entry 0x4008067c
On the contrary, when I reverse the order of WiFi and BLE and connect to WiFi before then it connects to WiFi correctly but crashes in the BLE as follows:
Connecting to WFH...
Connected! IP address: 192.168.10.21
Init STA interfaces
mDNS started
going to init ble
abort() was called at PC 0x401a8332 on core 1
ELF file SHA256: 0000000000000000
Backtrace: 0x40090370:0x3ffd3170 0x400906cd:0x3ffd3190 0x401a8332:0x3ffd31b0 0x401aca70:0x3ffd31d0 0x401acc4a:0x3ffd31f0 0x4011905a:0x3ffd3220 0x40114ae2:0x3ffd3240 0x4010d711:0x3ffd3280 0x400f55a2:0x3ffd32b0 0x400f56a4:0x3ffd32f0 0x400f6b03:0x3ffd3310 0x400f6b4a:0x3ffd33d0 0x400f6f62:0x3ffd3410 0x40116e2c:0x3ffd3430 0x4009217a:0x3ffd3450
#0 0x40090370:0x3ffd3170 in invoke_abort at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:648
#1 0x400906cd:0x3ffd3190 in abort at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:648
#2 0x401a8332:0x3ffd31b0 in coex_init at ??:?
#3 0x401aca70:0x3ffd31d0 in esp_phy_rf_init at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/esp32/phy_init.c:524
#4 0x401acc4a:0x3ffd31f0 in esp_phy_load_cal_and_init at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/esp32/phy_init.c:673
#5 0x4011905a:0x3ffd3220 in esp_bt_controller_enable at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/bt/bt.c:1704
#6 0x40114ae2:0x3ffd3240 in btStart at C:\Users\umer.arshad\.platformio\packages\framework-arduinoespressif32\cores\esp32/esp32-hal-bt.c:45
#7 0x4010d711:0x3ffd3280 in BLEDevice::init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) at C:/Users/umer.arshad/.platformio/packages/framework-arduinoespressif32@src-e9b1fbd6563a55e19ddae15e1fc09589/libraries/BLE/src/BLEDevice.cpp:591
#8 0x400f55a2:0x3ffd32b0 in ble_init() at wled00/usermod.cpp:110
#9 0x400f56a4:0x3ffd32f0 in userConnected() at wled00/usermod.cpp:123
#10 0x400f6b03:0x3ffd3310 in WLED::handleConnection() at wled00/bus_manager.h:149
#11 0x400f6b4a:0x3ffd33d0 in WLED::loop() at wled00/bus_manager.h:149
#12 0x400f6f62:0x3ffd3410 in loop() at D:/MyStuff/WattsLights/WLED/wled00/wled00.ino:20
#13 0x40116e2c:0x3ffd3430 in loopTask(void*) at C:\Users\umer.arshad\.platformio\packages\framework-arduinoespressif32\cores\esp32/main.cpp:23
#14 0x4009217a:0x3ffd3450 in vPortTaskWrapper at /home/cschwinne/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)
Rebooting...
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0
Hi all, I'm using async webserver call back to start or stop the timer , I can start and change alaram period without any problem but when I stop the timer I've got following error and chip reset
abort() was called at PC 0x400eca91 on core 0
Backtrace:0x4008369d:0x3ffbeadc |<-CORRUPTED
my call back is
void dosing(String side, String value,AsyncWebServerRequest *request){
request->send(200, "text/plain", "sure");
uint8_t s=side.toInt();
uint32_t v=value.toInt();
//PRINTS("speed=",v);
if(v<11) stepper.stop();
}
//////////////////////////////////
// class method
void Stepper::stop(void){
//timerDetachInterrupt(timers[timer_n]);
timerAlarmDisable(timers[timer_n]);
timerStop(timers[timer_n]);
}
/////
void onBody(AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total){
if(!index){
Serial.printf("BodyStart: %u B\n", total);
}
for(size_t i=0; i<len; i++){
Serial.write(data[i]);
}
if(index + len == total){
Serial.printf("BodyEnd: %u B\n", total);
}
}
server.on("/connect", HTTP_POST, [](AsyncWebServerRequest * request) {
Serial.print("connect");
request->send(200);
}, onBody);
server.onFileUpload(onUpload);
server.onRequestBody(onBody);
Any clue why my code isn't printing anything out when i send call that route and send it a message of 'ping'?