How can I make the code opening a new file and putting as filename the timestamp? For example:
"07_07_2020_23_30_34.txt"
So that I read from the RTC and print it as a filename.
How can I make the code opening a new file and putting as filename the timestamp? For example:
"07_07_2020_23_30_34.txt"
So that I read from the RTC and print it as a filename.
alex5678:
How can I make the code opening a new file and putting as filename the timestamp? For example:"07_07_2020_23_30_34.txt"
So that I read from the RTC and print it as a filename.
FAT file system names are limited to 8.3 format. 8 characters for name, dot and 3 characters for the extension.
char fn[20];
sprintf(fn, "%s%02d-%02d-%02d.CSV", CSV_DIR, year(t) - 2000, month(t), day(t));
File file = FS.open(fn, FILE_WRITE);
How can I read the IP and the mac from an Arduino MEGA 2560 connected my router through the Ethernet port? I also tried Advanced IP Scanner as suggested to post #3 by SteveMann, but it finds too many devices and I closed it. I do not have some many on my home. I do not know what goes wrong. Does it only scan inside my home network I suppose?? I tried however the MAC and the IP that the scanner found, and put it inside the code of the Arduino but I cannot connect to the IP through the browser...
alex5678:
How can I read the IP and the mac from an Arduino MEGA 2560 connected my router through the Ethernet port? I also tried Advanced IP Scanner as suggested to post #3 by SteveMann, but it finds too many devices and I closed it. I do not have some many on my home. I do not know what goes wrong. Does it only scan inside my home network I suppose?? I tried however the MAC and the IP that the scanner found, and put it inside the code of the Arduino but I cannot connect to the IP through the browser...
the MAC address is assigned in the sketch.
you can reserve an IP address on your router's DHCP settings for the Arduino to have always the same IP address.
you could use MDNS to access the Arduino by name, but I never used it on Ethernet so I don't have instructions or an example