Page 2 of 3

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Mon Apr 15, 2024 7:17 am
by uhi22
RetroZero wrote: Sun Apr 14, 2024 6:48 am @Jacobmess, thankyou for this info!! This was my problem. The Wifican password is "topsecret" and not my home network password.
So once the "credentials.h file has been modified with local your wifi details", load the sketch and connect to the new "wifican network" using "topsecret" as the password. (I assume we can change this directly in the wifi.ino if we want to)
It might seem so simple, that it not need saying. Many days of rebooting later, I have a wifican up and running. I'll add this to the wiki alongside @gregski's CanDue.
Many thanks again....Happy Can sniffing!
Yes, the wifi approch needs better documentation. Would be really great to have it on the wiki.
I try to explain with my words here:
The wifican supports two different modes of wifi operation. The mode is selected by the level of pin35 during startup.
(1) The "home mode". In the source code called WIFI_MODE_STATION. This mode is reached when during the boot the pin35 is high (3.3V). The wifican tries to connect to your home wifi. You configured the name of your wifi and the password in wifi_credentials.h. The wifican will be in your home network, so you can use SavvyCAN to observe the CAN while you are in parallel browsing the internet or sending mails.
(2) The "field mode". In the source code called WIFI_MODE_ACCESS_POINT. This mode is reached if during boot the pin35 is grounded. The wifican will create its own wifi network, called "wifican" and with the password "topsecret", configurable here: https://github.com/uhi22/wifican/blob/3 ... an.ino#L15. To use this mode, go to the wifi settings of your laptop, and connect to the "wifican". This means, you will loose your internet connection, because you change your wifi connection from your router to the wifican. This mode is intended to use when you are outside, where you do not reach your home wifi network anyway.

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Mon Apr 15, 2024 10:25 am
by RetroZero
Once I've got mine up and running and that I understand, I'll do a wiki update.
I'll try the debug setup first that seems to loop. Then get some info from a can bus. I have an instrument cluster I'm playing with, but I think it needs a wake up message first, so will try to connect to working bus firstly.
I'm glad the setup works with Savvycan!

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Mon Apr 15, 2024 11:45 am
by uhi22
For debugging your setup, you could add the data base file (dbc) of the "virtual" debug messages into SavvyCAN. This file is here: https://github.com/uhi22/wifican/blob/m ... opment.dbc
This allows you to see how long the wifican is running (wificanAliveCounter is counting up), and how many messages it has seen on CAN (wificanTotalRxMessages)

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Mon Apr 15, 2024 12:23 pm
by RetroZero
Ok, thanks for that. I'll do that. It's perfect as I'm trying to find reliable dbc files....

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Mon Apr 15, 2024 7:47 pm
by RetroZero
For info, I only can get it working with Pin35 to GND. Tried Pin35 to Pin 47, Tried Pin35 to 3.3v.
So for now, only remote access is possible. Wifican is not detectable when Pin 35 pulled HIGH..
My wifi network and password have to be Inside of the "wifi_SSID" and "wifi_password" emplacements that you have provided? Just making double sure I'm not screwing this up all by myself. Maybe I have a dodgy board?

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Mon Apr 15, 2024 8:00 pm
by Jacobsmess
RetroZero wrote: Mon Apr 15, 2024 7:47 pm For info, I only can get it working with Pin35 to GND. Tried Pin35 to Pin 47, Tried Pin35 to 3.3v.
So for now, only remote access is possible. Wifican is not detectable when Pin 35 pulled HIGH..
My wifi network and password have to be Inside of the "wifi_SSID" and "wifi_password" emplacements that you have provided? Just making double sure I'm not screwing this up all by myself. Maybe I have a dodgy board?
I've only ever run mine remotely never via my own WiFi as my connection isn't great where my workshop is but yes you need to enter your WiFi SSID and password into the WiFi credentials file where Uhi specifies.

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Mon Apr 15, 2024 8:57 pm
by RetroZero
That's what I did. No wifican. Wanted to get this all sorted out to add to the wiki.
I'm away a few days so remote mode will have to until the weekend.

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Tue Apr 16, 2024 6:52 am
by uhi22
RetroZero wrote: Mon Apr 15, 2024 7:47 pm Wifican is not detectable when Pin 35 pulled HIGH..
You can check the following. While still connected with the cable to the arduino IDE, open the serial monitor in the Arduino IDE. Press the reset button on the board. You should see some logging in the serial monitor.

Code: Select all

wifiMode1
....
WifiMode is 'station'. Connecting to PlischUndPlum
....
[  1903][V][WiFiGeneric.cpp:355] _arduino_event_cb(): STA Connected: SSID: PlischUndPlum, BSSID: dc:15:c8:0a:66:3c, Channel: 11, Auth: WPA2_PSK
[  1905][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 4 - STA_CONNECTED
STA Connected[  1912][V][WiFiGeneric.cpp:369] _arduino_event_cb(): STA Got New IP:192.168.2.123
[  1923][D][WiFiGeneric.cpp:1039] _eventCallback(): Arduino Event: 7 - STA_GOT_IP
[  1928][D][WiFiGeneric.cpp:1102] _eventCallback(): STA IP: 192.168.2.123, MASK: 255.255.255.0, GW: 192.168.2.1
STA IPv4: 192.168.2.123
WiFi connected
IP address: 
192.168.2.123
telnet is listening
This log shows whether the connection to your home network was successful. What do you mean that "wifican is not detectable"? You could check in the web interface of your router, whether you see the device. In my case, I have a FritzBox router, it looks like this:
image.png
image.png (3.84 KiB) Viewed 8776 times
It is normal, that you do not see the wifican in the wifi list of your laptop. Because it does not create a own network, it uses your existing home network.
When the SavvyCAN and the wifican is in the same network, the SavvyCAN auto-detects the IP in the connection window:
image.png
image.png (6.98 KiB) Viewed 8776 times
RetroZero wrote: Mon Apr 15, 2024 7:47 pm Maybe I have a dodgy board?
This is unlikely. If the board works as wifi access point, it will also work as wifi station.

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Fri Apr 19, 2024 1:51 pm
by RetroZero
I'm back at home. I must be missing something.
I can get SavvyCan to connect only when in "field mode".
It means I can't have internet at the same time.
In Serial Monitor, there are simple "blank squares" and then "x" between them. If I press the "reset button" , the "sqares" and "x" keep running on.
Since I am not sure of my connection, I am not sure to be capturing CAN data

Edit : For info, I can "capture CAN" messages in "field mode". My objective is to send messages to different light signals and instrument cluster RPM on this cluster. This experiment is preparing me for installing and working with a VW 3.6kw charger......

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Fri Apr 19, 2024 9:10 pm
by uhi22
Sounds like wrong baud rate of the serial monitor. 115200 is used in the Serial.begin.

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Sat Apr 20, 2024 5:41 am
by RetroZero
That would be to check messages in 'serial monitor' right?
I'll try to check pathway for wifi_credential.h to make sure it's taking the correct password etc.
There's no firewall settings or something that could block this type of connection?
When I browse wifi networks around me,connected or not, there's no wifican when pin 37 is pulled high (pin 47).

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Sat Apr 20, 2024 6:52 am
by uhi22
This is normal. With pin 37 high, the device is a "Station", it does not publish an own wifi network. It will try to connect your home network, so it does not appear in a wifi list. The only relevant thing is that you provided the right name and password in the credentials file.

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Sat Apr 20, 2024 8:01 am
by RetroZero
It looks like the correct details are in the credentials file, but Savvycan doesn't find it, or connect when I manually put in ip address. I'll change the baud rate in arduino and see what info I can retrieve to compare what you posted. Thanks for the replies, this is a great tool I think . Can't wait to be able to send a few can commands and see that I managed the baby step in 'reverse engineering '

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Sun Apr 21, 2024 4:43 pm
by RetroZero
Thanks again, but after several attempts , I get a "STA STARTED" and then repeatedly "STA DISCONNECTED" when Resetting my ESP32.
I've errased and refreshed the sketch a few times now. I even reset my Wifi and WPS button. I wonder if I have some kind of setting blocking the connection , like a pop up blocker or something. I'll keep at it.

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Sun Apr 21, 2024 4:50 pm
by uhi22
No. A blocker on the PC would not prevent the esp from connecting your router. Are you sure your router provides a 2.4GHz wifi, not only 5GHz? Is the router near? Are you sure the wifi name and password is the same as the router expects?

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Sun Apr 21, 2024 5:32 pm
by RetroZero
I have 2 wifi names, I removed the _5GHZ from the file, and it has connected to the 2.4GHZ network. I can also connect it via SavvyCan!!!!
Huge thanks, and time for me to do some Wiki writing. Thanks again @Uhi222 !

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Sun Apr 21, 2024 6:02 pm
by RetroZero
Please check that I have correctly documented your great solution in the Wiki 8-)

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Wed Apr 24, 2024 6:39 am
by uhi22
Many thanks for updating the wiki. I also now updated the wifican documentation, and added links to the wiki and to this thread.
https://github.com/uhi22/wifican?tab=re ... tart-guide

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Wed Apr 24, 2024 4:34 pm
by RetroZero
Happy can fuzzing and dbc searching 😉

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Mon Apr 29, 2024 7:20 am
by uhi22
Just noticed, that the transmit path of WifiCAN has a problem. The transmit messages, which I configure in SavvyCAN are not physically on the bus. Investigation is ongoing.
https://github.com/uhi22/wifican/issues/1

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Mon Apr 29, 2024 5:01 pm
by RetroZero
I found some info on can id that I'll try to configure and send to my bench setup to instrument cluster. Will confirm if it works. Trying to see if I can use my vcds to extract can related data at the same time.

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Mon Apr 29, 2024 5:06 pm
by uhi22
Using the bus number 3 the transmitting works. This number is also shown in the main window. Not sure why it is number 3, but at least it works.
image.png
image.png (4.39 KiB) Viewed 7902 times

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Mon Apr 29, 2024 9:01 pm
by RetroZero
I can confirm transmitting works on Bus 3 !!!! Huge thanks @uhi22 !!!
I started with some Fuzzing and found my ID for RPM - 0x280. I'll play around now to see how to select and hone in on bit values.
Baby steps

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Sun Jun 02, 2024 4:40 pm
by RetroZero
So, thought I would move this discussion here because I think my setup is linked to the ESP32 config, and hope to find a work around to use the CAN Crocodile with it.
If I connect a second CAN Transceiver in parallel to the initial one setup with wifican, the Bus seems to shut down. This is when connecting the TX and RX and/or the CAN-H and CAN-L to the existing setup.
If I simply give the Can Crocodile +12v and GND and connect it to the CAN bus, it picks up traffic, and doesn't shut down the BUS.
If I then connect the CAN lines to the two remaining connecters for CAN on the initial transceiver, the bus shuts down.
It seems I cannot conect the 2 on the same BUS.
At the same time, If I connect the CAN crocodile to my working Golf VI, the data doesn't seem coherant iether.
Any thoughts?

Re: Use ESP32 Web interface also as GVRET CAN device?

Posted: Mon Jun 03, 2024 5:21 am
by RetroZero
Could I run this setup on a Esp32-s3-pico board?
That way, I could connect original ESP32-S3 to my cluster setup, and the Pico one to Crocodile clip.
I will need to then give the 2 networks different names and see what the Crocodile is sending out as data.