boot logging
This commit is contained in:
parent
6416ead186
commit
5354da5dc3
16
src/main.cpp
16
src/main.cpp
|
@ -52,7 +52,9 @@ void setup()
|
||||||
// Initialize both displayports
|
// Initialize both displayports
|
||||||
INTERNAL_DISPLAY_UART.begin(INTERNAL_DISPLAY_BAUDRATE);
|
INTERNAL_DISPLAY_UART.begin(INTERNAL_DISPLAY_BAUDRATE);
|
||||||
DISPLAY_UART.begin(DISPLAY_COMMUNICATION_BAUDRATE, SERIAL_8N1, DISPLAY_RX, DISPLAY_TX);
|
DISPLAY_UART.begin(DISPLAY_COMMUNICATION_BAUDRATE, SERIAL_8N1, DISPLAY_RX, DISPLAY_TX);
|
||||||
|
ESP_LOGI("CUD IoT OS", "Starting Initialization");
|
||||||
// Reset both display
|
// Reset both display
|
||||||
|
ESP_LOGV("CUD IoT OS", "Resetting both displays");
|
||||||
send_stop_bytes(INTERNAL_DISPLAY_UART);
|
send_stop_bytes(INTERNAL_DISPLAY_UART);
|
||||||
INTERNAL_DISPLAY_UART.print("rest");
|
INTERNAL_DISPLAY_UART.print("rest");
|
||||||
send_stop_bytes(INTERNAL_DISPLAY_UART);
|
send_stop_bytes(INTERNAL_DISPLAY_UART);
|
||||||
|
@ -62,39 +64,53 @@ void setup()
|
||||||
// Wait for the display to reset
|
// Wait for the display to reset
|
||||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||||
// Initialize the ESPMegaPRO
|
// Initialize the ESPMegaPRO
|
||||||
|
ESP_LOGV("CUD IoT OS", "Initializing ESPMegaPRO");
|
||||||
espmega.begin();
|
espmega.begin();
|
||||||
// Initialize IoT Modules
|
// Initialize IoT Modules
|
||||||
|
ESP_LOGV("CUD IoT OS", "Initializing IoT Modules");
|
||||||
espmega.enableIotModule();
|
espmega.enableIotModule();
|
||||||
// Setup Ethernet
|
// Setup Ethernet
|
||||||
|
ESP_LOGV("CUD IoT OS", "Initializing Ethernet");
|
||||||
ETH.begin();
|
ETH.begin();
|
||||||
|
ESP_LOGD("CUD IoT OS", "Binding Ethernet Interface");
|
||||||
espmega.iot->bindEthernetInterface(Ð);
|
espmega.iot->bindEthernetInterface(Ð);
|
||||||
// Connect to Network
|
// Connect to Network
|
||||||
|
ESP_LOGV("CUD IoT OS", "Connecting to Network");
|
||||||
espmega.iot->loadNetworkConfig();
|
espmega.iot->loadNetworkConfig();
|
||||||
espmega.iot->connectNetwork();
|
espmega.iot->connectNetwork();
|
||||||
// Connect to the MQTT Broker
|
// Connect to the MQTT Broker
|
||||||
|
ESP_LOGV("CUD IoT OS", "Connecting to MQTT Broker");
|
||||||
espmega.iot->loadMqttConfig();
|
espmega.iot->loadMqttConfig();
|
||||||
espmega.iot->connectToMqtt();
|
espmega.iot->connectToMqtt();
|
||||||
// Enable Web Server
|
// Enable Web Server
|
||||||
|
ESP_LOGV("CUD IoT OS", "Enabling Web Server");
|
||||||
espmega.enableWebServer(80);
|
espmega.enableWebServer(80);
|
||||||
// Initialize Internal Display
|
// Initialize Internal Display
|
||||||
|
ESP_LOGV("CUD IoT OS", "Initializing Internal Display");
|
||||||
espmega.enableInternalDisplay(&INTERNAL_DISPLAY_UART);
|
espmega.enableInternalDisplay(&INTERNAL_DISPLAY_UART);
|
||||||
// Initialize Air Conditioner
|
// Initialize Air Conditioner
|
||||||
|
ESP_LOGV("CUD IoT OS", "Initializing Air Conditioner");
|
||||||
espmega.installCard(2, &ac);
|
espmega.installCard(2, &ac);
|
||||||
ac.bindFRAM(&espmega.fram, AC_FRAM_ADDR);
|
ac.bindFRAM(&espmega.fram, AC_FRAM_ADDR);
|
||||||
espmega.display->bindClimateCard(&ac); // Show our climate card on the display
|
espmega.display->bindClimateCard(&ac); // Show our climate card on the display
|
||||||
// Register all cards with iot
|
// Register all cards with iot
|
||||||
|
ESP_LOGV("CUD IoT OS", "Registering Cards with IoT");
|
||||||
espmega.iot->registerCard(0);
|
espmega.iot->registerCard(0);
|
||||||
espmega.iot->registerCard(1);
|
espmega.iot->registerCard(1);
|
||||||
espmega.iot->registerCard(2);
|
espmega.iot->registerCard(2);
|
||||||
// Initialize Remote Variables
|
// Initialize Remote Variables
|
||||||
|
ESP_LOGV("CUD IoT OS", "Initializing Remote Variables");
|
||||||
aqi.begin(10, AQI_STATE_TOPIC, espmega.iot, true, AQI_REQUEST_TOPIC);
|
aqi.begin(10, AQI_STATE_TOPIC, espmega.iot, true, AQI_REQUEST_TOPIC);
|
||||||
// Input callbacks
|
// Input callbacks
|
||||||
// This pre-load the input buffers
|
// This pre-load the input buffers
|
||||||
// We need to do this to prevent switches that are left on the "on" position from triggering the callback
|
// We need to do this to prevent switches that are left on the "on" position from triggering the callback
|
||||||
|
ESP_LOGV("CUD IoT OS", "Pre-loading input buffers");
|
||||||
espmega.inputs.loop();
|
espmega.inputs.loop();
|
||||||
espmega.inputs.registerCallback(handle_input_change);
|
espmega.inputs.registerCallback(handle_input_change);
|
||||||
// Start the display routine
|
// Start the display routine
|
||||||
|
ESP_LOGV("CUD IoT OS", "Starting CUDDisplay");
|
||||||
cudDisplay.begin();
|
cudDisplay.begin();
|
||||||
|
ESP_LOGI("CUD IoT OS", "Initialization Complete");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
|
|
Loading…
Reference in New Issue