Comments (8)
I've fixed the status command in AP mode. The only thing i couldn't find is how to get the dns server when in AP mode
Uploaded to my fork
`
#ifdef ESP8266
extern "C" {
#include "user_interface.h" // Used to get Wifi status information
}
#endif
void sendStatus() {
DynamicJsonBuffer jsonBuffer;
JsonObject& root = jsonBuffer.createObject();
int mode = WiFi.getMode(); //const char* modes[] = { "NULL", "STA", "AP", "STA+AP" };
struct ip_info info;
if (mode == 1) { //Station mode
wifi_get_ip_info(STATION_IF, &info);
struct station_config conf;
wifi_station_get_config(&conf);
root["ssid"] = String(reinterpret_cast<char*>(conf.ssid));
root["dns"] = printIP(WiFi.dnsIP());
root["mac"] = WiFi.macAddress();
} else if (mode == 2) { //SoftAP mode
wifi_get_ip_info(SOFTAP_IF, &info);
struct softap_config conf;
wifi_softap_get_config(&conf);
root["ssid"] = String(reinterpret_cast<char*>(conf.ssid));
root["dns"] = "";
root["mac"] = WiFi.softAPmacAddress();
}
IPAddress ipaddr = IPAddress(info.ip.addr);
IPAddress gwaddr = IPAddress(info.gw.addr);
IPAddress nmaddr = IPAddress(info.netmask.addr);
root["ip"] = printIP(ipaddr);
root["gateway"] = printIP(gwaddr);
root["netmask"] = printIP(nmaddr);
root["command"] = "status";
root["heap"] = ESP.getFreeHeap();
root["chipid"] = String(ESP.getChipId(), HEX);
root["cpu"] = ESP.getCpuFreqMHz();
root["availsize"] = ESP.getFreeSketchSpace();
size_t len = root.measureLength();
AsyncWebSocketMessageBuffer * buffer = ws.makeBuffer(len); // creates a buffer (len + 1) for you.
if (buffer) {
root.printTo((char *)buffer->get(), len + 1);
ws.textAll(buffer);
}
}
`
from esp-rfid.
give access untill specific date is also included in my fork Commit
from esp-rfid.
added visualisation to see how much spiffs space is available commit
I was thinking is it not more logical to display space used instead of space available?
it also might be nice to notify the user when SPIFFS is almost full (in user.htm)
from esp-rfid.
Nicely done thank you. I even did not understand how ESP8266 memory mapped. Heap and Flash calculations are just my assumptions based on Arduino IDE compile time feedback.
Most development boards have 16Mbit (4MB) flash. I believe we can get info about SPIFFS then make calculations.
struct FSInfo {
size_t totalBytes;
size_t usedBytes;
http://esp8266.github.io/Arduino/versions/2.0.0/doc/filesystem.html#info
I am stuck on Time. Timezones, UTC, GMT, conversions one from another, Day Light Saving (Summer Time) all these stuff making me pull my hair. I think i am going to give up on timing for now, and focus on fun stuff.
from esp-rfid.
I've got the time from the ntpclient for now and it works fine. i've got a variable in which the UTC timezone can be set and it will adjust.
For the SPIFFS mapping i am indeed using FSInfo. this is however an estimate and is not perfectly correct but it is good enough for this use.
I am currently cleaning and testing my code. I though it might be usefull to come up with a general layout for the .ini file so it's easier to add and remove code.
from esp-rfid.
The memory is not that hard to understand. I'm using the esp12 which has 4M memory
in the arduino IDE you have an option for example "Flash size: 4M (3M SPIFFS)"
the first 1M is used for the .ini file (flash)
the other 3M is used for SPIFFS
Heap is not located in program memory but in data memory (SRAM) so that's another part. This will not conflict with program memory
The way you get the remaining flash space is good so nothing to worry about here. I'm not sure yet if "1044464" in the set.js file is correct though. There might be a way to check this in runtime
from esp-rfid.
I did not mean flash memory but random access memory.
https://github.com/esp8266/esp8266-wiki/wiki/Memory-Map
Just finished my NTP code, too both Javascript and ino. https://github.com/gmag11/NtpClient using this library now.
It's an overkill but at least does not throw exceptions as TimeLib
from esp-rfid.
@rneurink Thank you, it means a lot. 👍
Also shifted some goals to v0.4. This issue now can be closed.
from esp-rfid.
Related Issues (20)
- getuserlist mqtt command doesn't return expected list HOT 1
- Version >118 not work with HID Reader HOT 5
- Write configuration - error
- Problem writing the configuration HOT 9
- Improve rendering of uptime in web UI HOT 3
- stability problem after update to Build-163 and solution HOT 3
- Relais turns ON while restart HOT 5
- my system runing on build 119 but v2.0.0 rc0reading mfrc522 empty uuid HOT 35
- esp-rfid keeps disconnecting from mqtt HOT 5
- NTP unnecessarily blocking loop if connection is not present HOT 7
- Add support for generic serial input HOT 15
- Tag UID isn't read while using MFRC522 and v2.0.0.rc0 HOT 2
- wemos d1 unstable HOT 3
- ESP-RFID Relay Blue Board drivers problem HOT 3
- [FEATURE REQUEST] Do not try to reconnect to Wi-Fi when scanning "Admin" access tags in Client mode HOT 2
- How to get latest generic.bin for Dev branch HOT 2
- MQTT additional Command HOT 1
- Logs show Access granted for expired tags HOT 2
- Opening hours not working HOT 6
- Finished Hardware with Enclosure, Keypad and PN532
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp-rfid.