Hi Moth,
Want to thank you for posting this code. It's been a help to kind of get me rolling. I have an ESP32 I am working with as well, trying to use it to log the CANBUS on my R53 Mini.
Couple questions:
-Have you encountered any performance/lag issues with the WIFI version? I have an LG G6 I am testing on and found that there is a delay between data showing up on the serial monitor and it showing up on the phone. I replaced the simulated gear you had with a simple counter and noticed a lot of stuttering on the HP Tuners display. I siplified the code a little bit just to try and make it easier for me to play with. I'll be the first to admit I am not a coder
//V1.001
#include <WiFi.h>
const char* ssid = "TrackAddict";
const char* password = "12345678";
unsigned long tm = 0;
int i =0;
//int ssid_hidden = 0; // 0 = broadcast 1 = hidden
IPAddress ip(192, 168, 0, 29); // this works
IPAddress gateway(192, 168, 0, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress dns(8,8,8,8);
const int serverPort = 35000;
WiFiServer server;
WiFiClient client;
void setup() {
Serial.begin(9600);
WiFi.mode(WIFI_AP);
WiFi.softAP(ssid, password);
delay(100);
WiFi.softAPConfig(ip, gateway,subnet);
server = WiFiServer(serverPort);
server.begin();
}
void loop() {
client = server.available(); //Listen for incoming clients
if (client){ //If a new client connects,
Serial.println("New Client."); //print a message out in the serial port
while (client.connected()){
Serial.println("Client connected.");
Serial.println(client.available());
i = i+1;
tm=millis()/1000,2;
client.print("*NBP1,UPDATE,");
client.println(tm);
client.print("Gear");
client.print(":");
client.println(i);
client.println("#");
Serial.println(tm);
Serial.println (i);
delay (100);
}
}
client.stop();
Serial.println("Client disconnected.");
Serial.println();
}
-Can HP Tuner comment on how the app does the syncing with the NBP? Is it using the time stamp or is it just writing whatever piece of data is the most recent when it updates the log file?
-Beyond tweaking the code did you have to make any tweaks to get the BT version working? I can get NBP to go yellow but not green. Whats interesting is I can see the data just fine in the serial terminal. I wonder if that is a limit of the G6 I am testing on.
I have some stuff on Github here if you want to look
https://github.com/CBlumini/ESP32-CAN-Transmiter