Closed Drsimson closed 2 years ago
Thanks!
In my vehicle (406, 2.0 HDI), the fuel level is reported as number of litres left (0...73), in packet IDEN 664, data byte 4. See also: https://github.com/0xCAFEDECAF/VanLiveConnect/blob/4012c4dc46d7faf58a93145d753b6cd15a6db702/VanLiveConnect/PacketToJson.ino#L1768
I think in your vehicle the fuel level is reported as a percentage, in packet IDEN 4FC, data byte 7; see also: https://github.com/0xCAFEDECAF/VanLiveConnect/blob/4012c4dc46d7faf58a93145d753b6cd15a6db702/VanLiveConnect/PacketToJson.ino#L1018
Have a look also at http://pinterpeti.hu/psavanbus/PSA-VAN.html ; scroll down to IDEN 4FC.
You might want to adapt the code around line 1018 of PacketToJson.ino
to report into the fields "fuel_level_filtered"
and "fuel_level_filtered_perc"
, which drive the display on the HTML page. You would have to adapt the code around line 1808 of that same file to not report those fields from there.
If you give your VIN number, I can also try to determine from that what is the vehicle type, so that the correct IDEN is parsed for reporting fuel level. Or you can point to an entry in the following table: http://www.peugeotlogic.com/workshop/wshtml/specs/vincode.htm
For the gear values, you have to find the ratios yourself. I do not have a 206+ vehicle at hand. Please adapt the code around: https://github.com/0xCAFEDECAF/VanLiveConnect/blob/4012c4dc46d7faf58a93145d753b6cd15a6db702/VanLiveConnect/MFD.js.ino#L3824
Yes, in my car the fuel information is distributed in byte 7 of IDEN 4FC But the change in the structure and lines of 1018-1808 had no result for now. According to the VIN table, the car is (2JNFUA). Regarding the display of the gearbox status, it takes time because I change the 1st gear and the others are not displayed correctly. Of course, I have been familiar with your project for a few days now. And I will spend more time on it
Also, there is a compilation error in the last commit
.
.
VanLiveConnect:126:10: fatal error: PrintEx.h: No such file or directory
126 | #include ~~
compilation terminated.
exit status 1
PrintEx.h: No such file or directory
Also, there is a compilation error in the last commit . . VanLiveConnect:126:10: fatal error: PrintEx.h: No such file or directory 126 | #include
| ^ ~~compilation terminated. exit status 1 PrintEx.h: No such file or directory
--> Fixed!
Hello I saw that IDEN 4FC fuel level is defined in the last commit. Your work was great I tested it, the fuel percentage is displayed correctly, but some changes need to be made in the HTML file because the fuel level icon continues to the moon :))
Ah, I see the mistake. Will fix. Thanks for reporting! :-)
Fuel level reported as percentage now displayed
Thank you 👍 . The annoying problem is the random change of language and units % ---> liters ---> gallons And it is displayed only in the correct percentage mode. For example, a strange number of 120 liters is displayed in a liter Of course, the language problem was solved by removing other languages, but there are problems with units
I think your vehicle is sending non-zero data in byte# 4 of bus packets of IDEN 664. This is interpreted as litres of fuel. You could comment out or remove the if-statement starting at line 1828 of PacketToJson.ino.
That should suppress reporting of fuel level in litres/gallons for your vehicle.
Hello . In the screenshots, the background has an image whose file is available in the Extras folder, but it is not uploaded in the html address! Should the file link be defined somewhere?
The background image is found in the data
directory.
To have that served by the web server, you need to use the SPI Flash File System (SPIFFS). This is done by uncommenting the #define
in line 133 of the Config.h file. You must the also upload the data
directory into the ESP board using the "Arduino ESP8266 filesystem uploader", as found at https://github.com/esp8266/arduino-esp8266fs-plugin/releases . See also https://randomnerdtutorials.com/install-esp8266-filesystem-uploader-arduino-ide/ for installation instructions.
Note that, in order to work correctly in combination with the VanBus library, the SPIFFS must be compiled in "read only" mode. For detailed instructions, please read Config.h line 102 and onwards.
Hello, sir I changed line 42 in MFD.JS function updateDateTime() { var locales = { "set_language_french": "en-GB", "set_language_german": "en-GB", "set_language_spanish": "en-GB", "set_language_italian": "en-GB", "set_language_dutch": "en-GB" }; I tried to block the display of other languages But I still see automatic language change. With language changes in Packet to json There are problems in performance and execution. In my country, there is no Type C remote control. Is there a simple way to make the project monolingual? TNX
I would try changing function setLanguage(language)
to simply ignore the passed parameter and overwrite it with the language of you choice, e.g. "set_language_english"
.
Unfortunately, I do not have a Type B MFD, so I cannot test with that :-(
I would try changing
function setLanguage(language)
to simply ignore the passed parameter and overwrite it with the language of you choice, e.g."set_language_english"
.Unfortunately, I do not have a Type B MFD, so I cannot test with that :-(
this is great I have type B screen and can test :) There is also the problem that the fuel percentage will not show in beginning. For example, after running the IP address, I have to turn on the high beam or the indicator so that the fuel percentage is displayed because it is dashed at the beginning.
I have type B screen and can test :)
True, but for real development I would prefer to have this on my desk... ;-)
There is also the problem that the fuel percentage will not show in beginning. For example, after running the IP address, I have to turn on the high beam or the indicator so that the fuel percentage is displayed because it is dashed at the beginning.
Indeed, some data is not regularly sent over the VAN bus. For that, there is the function EquipmentStatusDataToJson. It will be called to report data as soon as a new WebSocket client connects.
Currently, fuel level is not part of that report, but it could be added. The fuel level percentage is already available as a global variable, see line 938.
Currently, fuel level is not part of that report, but it could be added.
Just pushed commit https://github.com/0xCAFEDECAF/VanLiveConnect/commit/1aa909e9f3851014fa09bce5dceb32b7c0bf2afa . You may want to test.
Currently, fuel level is not part of that report, but it could be added.
Just pushed commit 1aa909e . You may want to test.
Oh, thank you Sorry for the late reply, I have little free time and spend it all on my car I tested and it works for fuel but the same functions should be applied for service and oil mileage as they are still dashed . I will try to add them according to the fuel instructions
Hi sir I found that it works on my car, but on a similar car it is processed but not displayed Information. The BSI version was one Both 206+. My car is a 2007 model, this car is a 2006 model!
Hi, difficult to say what is the issue here. The blue flashing light is from the ESP?
Do you see any packets on the Serial output when you run VanBusDump.ino?
Hi, difficult to say what is the issue here. The blue flashing light is from the ESP?
Do you see any packets on the Serial output when you run VanBusDump.ino?
Yes. Blue flashing is from ESP. I will test it, but I don't think the problem is network packets. The version a few months ago was related to the display of indicator icons and lights, it was tested and it worked. Maybe changing the IwIP settings will solve the problem. I will test
Sure, hope it works out :-)
The LED normally flashes on each packet communicated via the WebSocket. (It also flashes 2 times per second if configured in Wi-Fi "station" (client) mode while connecting to a an Access Point, but I assume you are using the standard Access Point mode (#define WIFI_AP_MODE
in Config.h
.)
My best lwIP settings are shown here: https://github.com/0xCAFEDECAF/VanLiveConnect#3-board-settings . I am using "v2 Lower Memory (no features)".
I seem to have better Wi-Fi performance by setting the variable build.sdk
to:
build.sdk=NONOSDK22x_191122
inside the following file:
%LOCALAPPDATA%\Arduino15\packages\esp8266\hardware\esp8266\<your_version>\platform.txt
You may also want to connect the USB serial and see the output after uncommenting the following lines in Config.h
:
#define DEBUG_WEBSERVER
#define DEBUG_WEBSOCKET
#define PRINT_RAW_PACKET_DATA
#define PRINT_JSON_BUFFERS_ON_SERIAL
#define SELECTED_PACKETS VAN_PACKETS_SAT_NAV_PKTS
Sure, hope it works out :-)
The LED normally flashes on each packet communicated via the WebSocket. (It also flashes 2 times per second if configured in Wi-Fi "station" (client) mode while connecting to a an Access Point, but I assume you are using the standard Access Point mode (
#define WIFI_AP_MODE
inConfig.h
.)My best lwIP settings are shown here: https://github.com/0xCAFEDECAF/VanLiveConnect#3-board-settings . I am using "v2 Lower Memory (no features)".
I seem to have better Wi-Fi performance by setting the variable
build.sdk
to:
build.sdk=NONOSDK22x_191122
inside the following file:
%LOCALAPPDATA%\Arduino15\packages\esp8266\hardware\esp8266\<your_version>\platform.txt
You may also want to connect the USB serial and see the output after uncommenting the following lines in
Config.h
:#define DEBUG_WEBSERVER #define DEBUG_WEBSOCKET #define PRINT_RAW_PACKET_DATA #define PRINT_JSON_BUFFERS_ON_SERIAL #define SELECTED_PACKETS VAN_PACKETS_SAT_NAV_PKTS
Wi-Fi performance settings are adjusted according to the instructions . First test and websockets.sendTXT = Fail
The second test, but again, the information was not displayed in the HTML !!! It's interesting that it works well in my car and I'm really confused!!! //Video speed is 2X faster//
Your problem is with the WebSocket connection. It is either not working at all, or continuously connecting and disconnecting. Maybe try another browser client, or another device?
If you have a laptop, you can see what is happening in the browser console by pressing F-12.
Your problem is with the WebSocket connection. It is either not working at all, or continuously connecting and disconnecting. Maybe try another browser client, or another device?
If you have a laptop, you can see what is happening in the browser console by pressing F-12.
I use one device and one browser in two cars. One works and the other does not
I use one device and one browser in two cars. One works and the other does not
That is really strange... I would still advise to try with another browser or device.
Hello, sir . After some time, I returned to your project. I retested commit 9907a76. Everything works well, but the last commit still has the above problems that I sent you in the video. Which file do you think I should start with for troubleshooting?
Looking carefully at the second video, I see some strange characters for the "vin" number in in the JSON object (around 0:02). It could be that it causes the client browser to disconnect while it parses this invalid JSON data.
Could you try to comment out the if-statement on lines 5201...04 in PacketToJson.ino ? That might help.
Hello . It is an interesting project. It works well! thank you In order to personalize the Brazilian language, I defined it. The gear values are not displayed correctly, which is related to the power and torque coefficients because the engine is 1.6 liters. But the display does not show the amount of fuel and only ( /_) is displayed