
11
on: June 21, 2025, 02:10:19 14:10
|
||
Started by Ahmad_k - Last post by Ahmad_k | ||
Sorry for late answer, that was not the CIN, the 470uF was at the input, I changed a little bit the schematic, it was for reference only. The chip was fake and everything is working perfectly now with genuine ICs
|
12
on: June 21, 2025, 01:30:21 13:30
|
||
Started by Wizpic - Last post by Wizpic | ||
Thank you, I never thought about that way, I like the layout of it better than my 2 versions , so I tested it and works perfectly, I can play around with the layout and stuff like that and I also like that it shows connecting/disconnected part
|
13
on: June 21, 2025, 10:25:37 10:25
|
||
Started by Wizpic - Last post by mars01 | ||
Hi,
I've added your question to Google Gemini 2.5 PRO AI and here is what it came up with: Code: <!DOCTYPE html> The result looks like this: ![]() And the explanation of what it did to fix your code: Quote The issue in your "new layout" is that the JavaScript is trying to update elements by an id that doesn't exist or is on the wrong element. You're trying to update the text inside a table cell (<td>) when you should be updating the value of the text box (<input>). I've created a clean, modernized version of your CAN bus monitor page. This new code combines the layout you wanted with the working WebSocket logic from your original file. It's built to be responsive, easy to read, and simple to modify. I've made the following key changes to fix your layout and make it more robust: - Correct JavaScript Targeting: The main issue is fixed. The JavaScript now correctly targets each <input> field by its unique id (error-counter, rx-counter, frame-counter) and updates its value. - Modern HTML & CSS: The code uses Tailwind CSS for a clean, responsive design that looks great on both mobile phones and desktop browsers. The layout is managed with a CSS Grid, which is more flexible than tables for this purpose. - Readability: I've cleaned up the structure, removed redundant tags, and added comments to both the HTML and JavaScript to explain what each part does. - User Experience: The input fields are set to readonly since they are for display only. I've also added a "Connecting..." message so you know the page is waiting for data. The HTML and JavaScript code in the canvas is designed specifically to work with an ESP32. Here’s a simple breakdown of how it all fits together: 1. Your ESP32's Role (The Server): You will program your ESP32 using the Arduino IDE or a similar tool. Your C++/Arduino code needs to do three things: - Act as a Web Server: It will store this HTML file in its memory (usually in SPIFFS or LittleFS) and send it to any web browser that connects to the ESP32's IP address. - Create a WebSocket Server: This is the critical part. The ESP32 must run a WebSocket server on port 81, just as the JavaScript expects (ws://${hostname}:81/). - Send Data: The ESP32 will read your CAN bus data, format it into a JSON string like {"ER":5, "RX":1234, "EER":1}, and send this string over the WebSocket connection at regular intervals. 2. This Code's Role (The Client): The HTML file you see in the canvas is the "client-side" code. It runs entirely in the web browser on your phone or computer after being loaded from the ESP32. It listens for the JSON messages from the ESP32's WebSocket server and uses them to update the values in the text boxes. Your next step is to write the ESP32 code that serves this file and provides the data. |
14
on: June 20, 2025, 08:39:03 20:39
|
||
Started by Wizpic - Last post by Wizpic | ||
I've been playing with an ESP32 as a canbus reader, this create a server where I can log on to sing phone through web page I can see the Error's and RX counter, It's all working but now I've found a better lay out but not really fully understand HTML and after some tips/advise.
This is the working layout (old) Code: <html> Code: <html> Below are the images of old and new laout. to start as learning curve. I've been trying to get it to display the RX counter the the white box in the new layout next to the RX counter box but can't seem to get it to work it just shows 0 not fully understanding HTML. So any advise tips would help. I use W3Schools to display the lay out to see what it looks like. |
15
on: June 13, 2025, 03:43:56 15:43
|
||
Started by pupin - Last post by zokij | ||
This member is invited by me. Registration isn't completed yet.
Note: This message sent by the system behalf of zokij. |
16
on: June 12, 2025, 06:36:32 18:36
|
||
Started by metal - Last post by safkans | ||
JLC seems more solution-oriented and practical to me. It can do everything in both. But apart from PCB, especially in 3D printing, JLC makes me happier.
|
17
on: June 12, 2025, 06:23:14 18:23
|
||
Started by askelonright - Last post by safkans | ||
Thank you for invitation. Registration is done.
Note: This message sent by the system behalf of safkans. |
18
on: June 11, 2025, 10:48:44 22:48
|
||
Started by askelonright - Last post by hosmis | ||
This member is invited by me. Registration isn't completed yet.
Note: This message sent by the system behalf of hosmis. |
19
on: June 11, 2025, 08:10:15 20:10
|
||||||||
Started by askelonright - Last post by askelonright | ||||||||
|
20
on: June 10, 2025, 10:39:32 22:39
|
||
Started by Ahmad_k - Last post by vern | ||
Ahmad, I noticed one thing in your schematic:
You have used a 470uF electrolytic cap for CIN, C14. The demonstartion board uses a 2.2uF ceramic cap at that point with a reason! An electrolytic capacitor has a very high ESR at higher frequencies, depending on the type it can be several ohms at 1.2MHz. This can lead to unstable operation and of the LM14203 and to very high EMV. The switcher should draw the input switching current from the input cap, not from the input source. The CINHF C15 is only 0.1uF, that doensn't help either. |