debug
This commit is contained in:
parent
b1be320655
commit
de7f4f0baf
@ -2,7 +2,7 @@
|
|||||||
#include <ETH.h>
|
#include <ETH.h>
|
||||||
#include "WebSocketManager.h"
|
#include "WebSocketManager.h"
|
||||||
|
|
||||||
WebSocketManager wsManager("wss://hq.ecomotus.co.uk", 443, "/");
|
WebSocketManager wsManager("wss://api.ecomotus.co.uk", 443, "/socket");
|
||||||
|
|
||||||
static BLEUUID serviceUUID("0000ff00-0000-1000-8000-00805f9b34fb"); //xiaoxiang bms service
|
static BLEUUID serviceUUID("0000ff00-0000-1000-8000-00805f9b34fb"); //xiaoxiang bms service
|
||||||
static BLEUUID charUUID_rx("0000ff01-0000-1000-8000-00805f9b34fb"); //xiaoxiang bms rx id
|
static BLEUUID charUUID_rx("0000ff01-0000-1000-8000-00805f9b34fb"); //xiaoxiang bms rx id
|
||||||
@ -31,8 +31,8 @@ static bool eth_ready = false;
|
|||||||
void setup() {
|
void setup() {
|
||||||
esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT);
|
esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT);
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE);
|
|
||||||
WiFi.onEvent(WiFiEvent);
|
WiFi.onEvent(WiFiEvent);
|
||||||
|
ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE);
|
||||||
BLEDevice::init("");
|
BLEDevice::init("");
|
||||||
wsManager.begin();
|
wsManager.begin();
|
||||||
wsManager.sendText("hello");
|
wsManager.sendText("hello");
|
||||||
@ -50,6 +50,11 @@ void loop() {
|
|||||||
|
|
||||||
Serial.println("Devices found: " + String(foundDevices.getCount()));
|
Serial.println("Devices found: " + String(foundDevices.getCount()));
|
||||||
|
|
||||||
|
while(!eth_ready){
|
||||||
|
Serial.println("Wait for eth...");
|
||||||
|
delay(250);
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < foundDevices.getCount(); i++) {
|
for (int i = 0; i < foundDevices.getCount(); i++) {
|
||||||
delay(1000);
|
delay(1000);
|
||||||
Serial.printf("\r\n\r\n===============================\r\n\r\n");
|
Serial.printf("\r\n\r\n===============================\r\n\r\n");
|
||||||
|
@ -23,6 +23,7 @@ public:
|
|||||||
char buffer[512]; // Define a buffer to hold the constructed message
|
char buffer[512]; // Define a buffer to hold the constructed message
|
||||||
snprintf(buffer, sizeof(buffer), format, args...); // Use snprintf to format the string
|
snprintf(buffer, sizeof(buffer), format, args...); // Use snprintf to format the string
|
||||||
webSocket.sendTXT(buffer);
|
webSocket.sendTXT(buffer);
|
||||||
|
Serial.print("[WebSocket] Sent: ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user