parent
90ea3f6b25
commit
1f53241a9a
|
@ -63,7 +63,10 @@ bool touch_STATE[4] = {1, 1, 1, 1}; // 定义按键触发对象状态变量初
|
||||||
|
|
||||||
const char *username = "admin"; //web用户名
|
const char *username = "admin"; //web用户名
|
||||||
const char *userpassword = "12345678"; //web用户密码
|
const char *userpassword = "12345678"; //web用户密码
|
||||||
const char* ServerName = "ESP32-LELO-RGB";
|
const char *ServerName = "ESP32-Reuleaux-RGB";
|
||||||
|
char mac_tmp[6];
|
||||||
|
const char *ssid = mac_tmp;
|
||||||
|
const char *password = "12345678";
|
||||||
char DateTimeStr[20] = "1970-01-01 00:00:00";
|
char DateTimeStr[20] = "1970-01-01 00:00:00";
|
||||||
char Debug_Log[255][255];
|
char Debug_Log[255][255];
|
||||||
uint32_t loop_time_begin = millis();
|
uint32_t loop_time_begin = millis();
|
||||||
|
@ -95,8 +98,6 @@ uint8_t i2cData[14]; // Buffer for I2C data
|
||||||
// driver instance
|
// driver instance
|
||||||
double acc2rotation(double x, double y);
|
double acc2rotation(double x, double y);
|
||||||
float constrainAngle(float x);
|
float constrainAngle(float x);
|
||||||
const char *ssid = "esp32";
|
|
||||||
const char *password = "12345678";
|
|
||||||
|
|
||||||
bool wifi_flag = 0;
|
bool wifi_flag = 0;
|
||||||
AsyncUDP udp; //创建UDP对象
|
AsyncUDP udp; //创建UDP对象
|
||||||
|
@ -242,25 +243,35 @@ void setup() {
|
||||||
|
|
||||||
pinMode(ACTIVE_PIN, OUTPUT);
|
pinMode(ACTIVE_PIN, OUTPUT);
|
||||||
digitalWrite(ACTIVE_PIN, HIGH);
|
digitalWrite(ACTIVE_PIN, HIGH);
|
||||||
|
|
||||||
uint32_t chipId = 0;
|
uint32_t chipId = 0;
|
||||||
for (int i = 0; i < 17; i = i + 8) {
|
for (int i = 0; i < 17; i = i + 8) {
|
||||||
chipId |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i;
|
chipId |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i;
|
||||||
}
|
}
|
||||||
|
Serial.printf("Chip ID: %d\r\n", chipId);
|
||||||
|
|
||||||
Serial.printf("ESP32 Chip model = %s Rev %d\n", ESP.getChipModel(), ESP.getChipRevision());
|
Serial.printf("ESP32 Chip ID = %04X",(uint16_t)(ESP.getEfuseMac()>>32));//print High 2 bytes
|
||||||
Serial.printf("This chip has %d cores\n", ESP.getChipCores());
|
Serial.printf("%08X\r\n",(uint32_t)ESP.getEfuseMac());//print Low 4bytes.
|
||||||
Serial.print("Chip ID: "); Serial.println(chipId);
|
|
||||||
|
|
||||||
//获取IDF版本
|
Serial.printf("Chip model = %s Rev %d\r\n", ESP.getChipModel(), ESP.getChipRevision());
|
||||||
printf("SDK version:%s\n", esp_get_idf_version());
|
Serial.printf("This chip has %d cores CpuFreqMHz = %u\r\n", ESP.getChipCores(),ESP.getCpuFreqMHz());
|
||||||
//获取芯片内存
|
Serial.printf("get Cycle Count = %u\r\n",ESP.getCycleCount());
|
||||||
Serial.print("Max Free Heap: ");
|
Serial.printf("SDK version:%s\r\n", ESP.getSdkVersion()); //获取IDF版本
|
||||||
Serial.println(ESP.getMaxAllocHeap());
|
|
||||||
//获取芯片可用内存
|
//获取片内内存 Internal RAM
|
||||||
printf("esp_get_free_heap_size : %d \n", esp_get_free_heap_size());
|
Serial.printf("Total heap size = %u\t",ESP.getHeapSize());
|
||||||
printf("getFreeHeap : %d \n", ESP.getFreeHeap());
|
Serial.printf("Available heap = %u\r\n",ESP.getFreeHeap());
|
||||||
//获取从未使用过的最小内存
|
Serial.printf("Lowest level of free heap since boot = %u\r\n",ESP.getMinFreeHeap());
|
||||||
printf("esp_get_minimum_free_heap_size : %d \n", esp_get_minimum_free_heap_size());
|
Serial.printf("Largest block of heap that can be allocated at once = %u\r\n",ESP.getMaxAllocHeap());
|
||||||
|
|
||||||
|
//SPI RAM
|
||||||
|
Serial.printf("Total Psram size = %u\t",ESP.getPsramSize());
|
||||||
|
Serial.printf("Available Psram = %u\r\n",ESP.getFreePsram());
|
||||||
|
Serial.printf("Lowest level of free Psram since boot = %u\r\n",ESP.getMinFreePsram());
|
||||||
|
Serial.printf("Largest block of Psram that can be allocated at once = %u\r\n",ESP.getMinFreePsram());
|
||||||
|
|
||||||
|
|
||||||
|
printf("macAddress 0x%02X:0x%02X:0x%02X:0x%02X:0x%02X:0x%02X\r\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
|
||||||
|
|
||||||
if (!EEPROM.begin(1000)) {
|
if (!EEPROM.begin(1000)) {
|
||||||
Serial.println("Failed to initialise EEPROM");
|
Serial.println("Failed to initialise EEPROM");
|
||||||
|
@ -346,6 +357,8 @@ void setup() {
|
||||||
delay(500);
|
delay(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sprintf(mac_tmp,"%02X\r\n",(uint32_t)(ESP.getEfuseMac()>>(24) ));
|
||||||
|
sprintf(mac_tmp,"ESP32-%c%c%c%c%c%c",mac_tmp[4],mac_tmp[5],mac_tmp[2],mac_tmp[3],mac_tmp[0],mac_tmp[1] );
|
||||||
//wifi初始化
|
//wifi初始化
|
||||||
WiFi.mode(WIFI_AP);
|
WiFi.mode(WIFI_AP);
|
||||||
while (!WiFi.softAP(ssid, password)) {}; //启动AP
|
while (!WiFi.softAP(ssid, password)) {}; //启动AP
|
||||||
|
@ -359,11 +372,7 @@ void setup() {
|
||||||
}
|
}
|
||||||
udp.onPacket(onPacketCallBack); //注册收到数据包事件
|
udp.onPacket(onPacketCallBack); //注册收到数据包事件
|
||||||
|
|
||||||
Serial.print("\nMax Free Heap: ");
|
ArduinoOTA.setHostname(ServerName);
|
||||||
Serial.println(ESP.getMaxAllocHeap());
|
|
||||||
Serial.println("");
|
|
||||||
|
|
||||||
ArduinoOTA.setHostname("ESP32-Reuleaux");
|
|
||||||
//以下是启动OTA,可以通过WiFi刷新固件
|
//以下是启动OTA,可以通过WiFi刷新固件
|
||||||
ArduinoOTA.onStart([]() {
|
ArduinoOTA.onStart([]() {
|
||||||
String type;
|
String type;
|
||||||
|
@ -485,8 +494,10 @@ void setup() {
|
||||||
|
|
||||||
StartWebServer();
|
StartWebServer();
|
||||||
|
|
||||||
Serial.println("System is ready");
|
Serial.print("System is ready \t Free Heap: ");
|
||||||
|
Serial.println(ESP.getFreeHeap());
|
||||||
Serial.println("-----------------------------------------------");
|
Serial.println("-----------------------------------------------");
|
||||||
|
Serial.println("");
|
||||||
|
|
||||||
Debug_Log_func("setup", 1);
|
Debug_Log_func("setup", 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue