Hot answers tagged

4 votes
Accepted

Crash when serving static files width ESP8266WebServer

Turns out the ESP crash is caused by the debug settings in the Arduino IDE. As soon as the CORE-level is included, the error occurs. There seems to be a bug in the firmware somewhere. Including other ...
user avatar
4 votes
Accepted

How to store a struct in a file?

you can think of a struct as an array (group) of variables which might be of a different sizes and struct helps you take specific portion of this string. Lets say you have a struct of struct foo{ ...
user avatar
  • 318
3 votes

ESP32 AsyncWebServer with softAP does not serve pages

I don't have enough rep to make a comment on your post, but is it possible that when you give the parameter for the function setDefaultFile() that the forward slash on /index.html is causing the path ...
user avatar
3 votes

How to store a struct in a file?

Just as a complement to Tomas' answer (which is perfectly valid), I would like to point out that consecutive members of a struct may not be adjacent in memory. Some structs have padding within them, ...
user avatar
  • 36.9k
3 votes
Accepted

How to install the application + its configuration to many devices of the same kind? (ESP32)

If you don't want to include the individual config data in the sketch for each location there are mainly two possibilities to handle that: As consumer IOT devices often do you can write your code to ...
user avatar
  • 14k
2 votes
Accepted

OTA-program SPIFFS on the ESP8266

Basicly OTA supports the upload of *.bin files. Wether this contains compiled code or a filesystem (SPIFFS/LittleFS) is irrelevant. BUT The space for the OTA (partition) has to be min the size of the *...
user avatar
2 votes
Accepted

Convert Binary to char

myFile.read() returns one character. That character can be represented as a number (such as 65 for 'A') or a character, or whatever you want. Everything is just a number. Letters are just our personal ...
user avatar
  • 103k
2 votes

Store & retrieve parameters after sketch update

There is no need for an SD card. You can write all relevant parameters into a file in SPIFFS (e.g. json if you like) before starting the OTA update. During initialization you read the file and set the ...
user avatar
  • 1,773
2 votes
Accepted

ESP32 AsyncWebServer with softAP does not serve pages

The usage of serveStatic() is wrong. It's not intended to be used inside a callback. Just place the call in the setup of the webserver, i.e.: void WebApp::Begin() { _server.serveStatic("/",...
user avatar
  • 287
2 votes
Accepted

Any way to use DMA to transfer data to SD Card in ESP8266

So, sorry for late response, i figured it out. Because it took lots of time for me and it might be a prevalent issue, i think it worth to contribute my experience for further similar issues. As ...
user avatar
1 vote

How to install the application + its configuration to many devices of the same kind? (ESP32)

I usually use BLE to set the WiFi credentials. After the WiFi connection is taken care of, I usually provision the rest of the configuration data by having a web application in the LAN that I put into ...
user avatar
  • 190
1 vote

Where to store critical data in power outage situation on ESP8266

A local solution would be to use EERAM. This is an EEPROM and an SRAM coupled together with some intelligent power management circuitry - writes get stored in SRAM until the power goes (or an ...
user avatar
  • 103k
1 vote

Where to store critical data in power outage situation on ESP8266

If you worry about the maximum number of write cycles, you could write the data to an SD card or some FRAM connected to the ESP8266, or you could send the data to a (web) server (if you have access to ...
user avatar
  • 1,610
1 vote
Accepted

No SPIFFS data upload in Arduino IDE 2.0.0-rc3 (ESP32 & TTGO) - Ubuntu

FS upload plugins for ESP are not available in IDE 2 yet (2022-01-07). IDE 2.0 doesn't run on Java so it can't use the java plugins of the IDE 1. You have to use IDE 1 for FS upload and exception ...
user avatar
  • 16.4k
1 vote
Accepted

How to write & read from SPIFFS file as object data on ESP8266

I directly see 3 problems with your code: Serial.write() will not return the written data, but the number of send bytes. This means that in your for loop you are only assigning the written number of ...
user avatar
  • 14k
1 vote

Best Data model/Concept to Store Multi-Day Alarm for clock?

That would work. Though I feel like your solution isn't easily readable by humans, and also not easily readable by machines. Removing the |s, making the data a fixed length, and putting each alarm on ...
user avatar
  • 11.1k
1 vote

Best Data model/Concept to Store Multi-Day Alarm for clock?

I would suggest a bit field for storing the days of the week when the alarm is supposed to fire: bit 0: fire on Sundays bit 1: fire on Mondays ... This numbering is meant to match the one of ...
user avatar
  • 36.9k
1 vote
Accepted

ESPTOOL not recognizing ESP32-S2 chip for SPIFFs transfer

Is the missing double dash? esptool.py --chip esp32s2 --port COM3 --baud 115200 write_flash -z 0x110000 filename.spiffs.bin
user avatar
1 vote

writing mqtt payload to spiffs file

Use file.write(payload, length); for byte array. length should be the count of payload bytes, not the size of the payload array. print and write return the count of bytes written. It is not ...
user avatar
  • 16.4k

Only top scored, non community-wiki answers of a minimum length are eligible