mirror of
https://github.com/adrigongv23/G26---Telemetry-Software.git
synced 2026-08-25 11:33:17 +02:00
Implementación de IP estática
This commit is contained in:
parent
ec4742145f
commit
385adaf90a
4 changed files with 15 additions and 5 deletions
|
|
@ -58,6 +58,16 @@ void setup() {
|
||||||
|
|
||||||
// 2. INICIAR WIFI
|
// 2. INICIAR WIFI
|
||||||
Serial.println("--- CONECTANDO WIFI ---");
|
Serial.println("--- CONECTANDO WIFI ---");
|
||||||
|
|
||||||
|
//IP estática dentro de la red del CPE (DHCP desactivado en el CPE)
|
||||||
|
IPAddress local_IP(192, 168, 0, 50);
|
||||||
|
IPAddress gateway(192, 168, 0, 254);
|
||||||
|
IPAddress subnet(255, 255, 255, 0);
|
||||||
|
|
||||||
|
if (!WiFi.config(local_IP, gateway, subnet)) {
|
||||||
|
Serial.println("[ERR] Fallo al configurar IP estática");
|
||||||
|
}
|
||||||
|
|
||||||
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
|
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
|
||||||
|
|
||||||
int intentos = 0;
|
int intentos = 0;
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ public:
|
||||||
//Variable publica para el CAN
|
//Variable publica para el CAN
|
||||||
volatile int current_ect_value = 0;
|
volatile int current_ect_value = 0;
|
||||||
volatile int current_rpm_value = 0;
|
volatile int current_rpm_value = 0;
|
||||||
volatile float current_vbatt_value = 0.0
|
volatile float current_vbatt_value = 0.0;
|
||||||
|
|
||||||
//Métodos de recepción de CAN
|
//Métodos de recepción de CAN
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ static bool driver_installed = false;
|
||||||
void CAN::start() {
|
void CAN::start() {
|
||||||
Serial.println("Starting CAN Controller...");
|
Serial.println("Starting CAN Controller...");
|
||||||
twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT((gpio_num_t)TX_PIN, (gpio_num_t)RX_PIN, TWAI_MODE_NORMAL);
|
twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT((gpio_num_t)TX_PIN, (gpio_num_t)RX_PIN, TWAI_MODE_NORMAL);
|
||||||
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_125KBITS();
|
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_500KBITS();
|
||||||
twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL();
|
twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL();
|
||||||
|
|
||||||
esp_err_t install_status = twai_driver_install(&g_config, &t_config, &f_config);
|
esp_err_t install_status = twai_driver_install(&g_config, &t_config, &f_config);
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ void DataProcessor::send_serial_frame_0(int rpmh, int rpml, int tpsh, int tpsl,
|
||||||
this->current_rpm_value = rpm;
|
this->current_rpm_value = rpm;
|
||||||
this->current_vbatt_value = vbatt;
|
this->current_vbatt_value = vbatt;
|
||||||
|
|
||||||
// Serial.printf("CAN RX -> ECT: %d | RPM: %d | BATT: %.1f \n", ect, rpm, vbatt);;
|
Serial.printf("CAN RX -> ECT: %d | RPM: %d | BATT: %.1f \n", ect, rpm, vbatt);;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue