New answers tagged

1

The functions configTime and getLocalTime are from ESP32 core file esp32-hal-time.c. This wraps the ESP32 SDK functions. You can use the SDK functions to set the time and zone. They work with the RTC peripheral of the ESP32. You can use setTimeZone to set the time zone. The time.h is standard C time library. The ESP32 SDK makes it to work with the built in ...


3

The function you are looking for is strstr(), which takes two strings, and returns a pointer to where the second string appears in the first (or NULL if it doesn't appear). You could use it something like this: void setup() { Serial.begin(15200); Serial.println("Load"); char *p = strstr(payload, "ssid="); char *q = strstr(payload, "pass=")...


1

The normal way of parsing such complex strings in any language is to use Regular Expressions. Normally these are pretty heavy-weight to use, but thankfully Nick Gammon has written an Arduino implementation of regexp.


1

Ok i found the solution. It was not too complicated. I just assumed the problem was in the code. This works well enough (dont ask me about the counter--) unsigned short EKG_recording::count_files_from_SD() { root = SD.open("/"); root.rewindDirectory(); //Sets to beginning of directory while (true) { File entry = root.openNextFile(); if(!...


1

I assume that you misunderstand how JavaScript works. JS is executed on the client side and therefore the esp can easily serve JS code the same way it would provide any html content. Take a look at the Webserver examples and embed your JavaScript code into the html content that the examples use. The important thing to note is that the esp does not execute ...


3

ARP isn't generally used the way you described. Per the spec, to resolve an IP address into a MAC address, you broadcast an ARP request for the IP address, and receive a unicast response from the host whose address it is - not a router. It also only resolves a single IP address in one request; it doesn't return the contents of the entire ARP cache. While ...


1

If you want server-push, you can use Server Sent Events or a Websocket instead of polling with XMLHttpRequest. So yes, it can be done, and I have implemented both using a Nano 33 IoT at one end and Javascript in a browser on the other. Some example code is here: https://github.com/ocrdu/arduino-webinterface-sse and here: https://github.com/ocrdu/arduino-...


2

time.h is provided by the compiler (more specifically the C library in use in the compiler). I believe the xtensa-esp32 compiler uses newlib as the C library. If that is the case, the documentation is here: https://sourceware.org/newlib/libc.html#Timefns


0

Acceleration is a vector quantity. Therefore, instead of looking at the average values of X,Y, and Z, you should probably look at the magnitude of the acceleration vector, that is (X^2+Y^2+Z^2)^0.5. Then, you can set an acceleration threshold below which you would send no data. The benefit of using the magnitude of the acceleration vector is that it is ...


2

The Arduino boards with the NINA module: MKR 1010 WiFi, MKR 4000 vidor, Uno WiFi and Nano 33 IoT use the NINA module for WiFi networking with the WiFiNINA library and for BLE with the ArdunioBLE library. Additionally the flash memory of the NINA module will be available as storage. The NINA module runs a firmware made by Arduino with ESP32 IDF framework. I ...


0

The two chips are connected together by both UART and SPI channels. I am unsure, but I think the main communication is performed over SPI and the UART is only used for programming and debugging of the NINA.


0

In general terms, you could simply require a client to authenticate first. This would require a bit of a deviation from the example you linked to (which actually only handles reading of the characteristic) to handle multiple connections and their state, but it should be pretty straightforward. The Arduino BLE library seems to lack sending quite a bit of ...


0

You can either use a breadboard Or Female to Female Jumber wires. Ofoucrse you can always solder yourself the two modules together with wires. PS. Too low reputation to comment, so i insert this as answer


2

You are repeatedly overwriting the ssid property of the same object. Instead, you want to write different properties, like wifiJsonObject["ssid" + String(i+1)] = WiFi.SSID(i); Then, only serialize the document once, when it is complete. That being said, I strongly concur with Juraj in that the correct way to represent a list in JSON (and wifiList is ...


2

EEPROM on the ESP32 doesn't work like you would expect. It uses the SDK's "Non-Volatile Ram" storage system to store the data within the nvs partition. This works through a system of "Key / Value" pairs, and the data is stored as a "BLOB" (Binary Large OBject) for the key eeprom in the namespace eeprom. Quite what the internal layout of the data within ...


2

to return 'epoch' seconds there is a function time in time.h time_t now; time(&now); time_t is defined as long this time is retrieved by the ESP32 SDK from NTP servers configured with ESP32 Arduino function configTime EDIT: it is the standard C time() function


0

simply, using strcpy, and using a char with a given length, works RTC_DATA_ATTR char ssid["dedicated length"]; strcpy(ssid, cSsid->getValue().c_str(), "dedicated length");


Top 50 recent answers are included