Skip to content

Commit

Permalink
Downloaded filename and AP ssid
Browse files Browse the repository at this point in the history
ap ssid format have serial number
filname have last 4 digit serial number
  • Loading branch information
samuelbles07 committed Dec 7, 2024
1 parent 6cb0698 commit 430e908
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion examples/OneOpenAir/LocalServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ void LocalServer::_GET_dashboard(void) {
void LocalServer::_GET_storage(void) {
char *data = measure.getLocalStorage();
if (data != nullptr) {
server.sendHeader("Content-Disposition", "attachment; filename=\"measurements.csv\"");
String filename =
"measurements-" + ag->deviceId().substring(8) + ".csv"; // measurements-fdsa.csv
server.sendHeader("Content-Disposition", "attachment; filename=\"" + filename + "\"");
server.send(200, "text/plain", data);
free(data);
} else {
Expand Down
5 changes: 4 additions & 1 deletion examples/OneOpenAir/OneOpenAir.ino
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,16 @@ void setup() {
delay(DISPLAY_DELAY_SHOW_CONTENT_MS);
}

String deviceId = ag->deviceId();

// Connect to Wi-Fi network with SSID and password
Serial.print("Setting AP (Access Point)…");
// Remove the password parameter, if you want the AP (Access Point) to be open
WiFi.softAP("airgradient", "cleanair");
WiFi.softAP("ag_" + deviceId, "cleanair");
IPAddress IP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(IP);
Serial.printf("SSID: ag_%s\n", deviceId.c_str());

oledDisplay.setText("", "Offline Storage Mode", "");

Expand Down

0 comments on commit 430e908

Please sign in to comment.