morcibacsi / PSAVanCanBridge

VAN - CAN protocol bridge (V2C) for cars made by PSA Group (Peugeot, Citroen)
GNU General Public License v3.0
116 stars 27 forks source link

BSI crash after few minutes #34

Open bronisMateusz opened 9 months ago

bronisMateusz commented 9 months ago

Hello,

I am still struggling with the configuration of the whole project in my Peugeot 206 RC and code from main branch.

I replaced the display from color to monochrome (I wanted BT support, and the color one didn't offer it without an additional module). Before that, I didn't have a chance to test the project longer, because I was waiting for this display.

Today I managed to do it and unfortunately I still have problems with the BSI. After a few minutes of running the kit, the BSI stops working, the main gauges start flashing.

Display number: 9803399680 IMG_5648

When everything is connected, some of the options from the display are unavailable: 087AFED7-AC55-4880-A914-EDC0D61130F6_1_105_c (I don't know if it should be possible to do this, but you can't highlight that first icon.) 300E6A35-0411-4588-BF59-46AEA2924E14_1_105_c AACF1F7C-6DCD-4476-9EAF-0FD825A86591_1_105_c

In the settings of the board I have: C3 - activated, C11 - activated, S1 - RD45, S2 - CAN2004, E2 - 60

bronisMateusz commented 6 months ago

Unfortunately, there are again problems on my part. I have been using the car extensively in the last few days and two days in a row I had a BSI failure. One occurred after 1.5h of driving and the other after just a few minutes. Yesterday I did another 1,5h tour and everything was ok.I will try to register something in the nearest days.

@Toniob In your car also reset trip performs after such a long time button press, as in my video?

Toniob commented 6 months ago

On friday, I made 2 trips of 2 hours each, and everything went ok with the BSI. But after the first, after a few hours, when I came back to the car, the display was not powering on. I had to unplug and plug again the bridge to make it work again. I think that's the esp32 which crashed. Too much heat maybe ?

Is there a way to have a watchdog on the bridge ? And if it doesn't reply anymore, it is rebooted automatically ? Something implemented in the ESP32 maybe ?

I also tried the trip reset and strange thing, the button on the car did nothing. No trip reset, but the button had no function anymore, not even the statistics display, as it should be. I'll probably try again another day. It remember it was working beofre so I really don't understand what happened.

bronisMateusz commented 3 months ago

Hi, I am back with the logs after this long break. To be honest, I had lost a bit of hope and opted for stability, i.e. driving with 2 displays plugged in, but nevertheless this topic kept me going. I managed to catch the moment again today that crash the BSI on the most recent version of the code from the bsi_crash_fix branch. I hope this will give new information for this problem.

log08.07.24.txt

Config.h:


#ifndef _Config_h
    #define _Config_h

#include <stdint.h>
#include <WString.h>

#include "Config_PSAVanCanBridge_WifiAp.h"
//#include "Config_PSAVanCanBridge_Bluetooth.h"
//#include "Config_WifiAp_Replay.h"
//#include "Config_WifiClient.h"

struct Config
{
    String  VERSION = "2.0.0";
    //#define PRINT_DEBUG

    #define VIN_LENGTH 17

    // 11: HW revision v1.1
    // 14: HW revision v1.4
    #define HW_VERSION 14

    #ifdef WIFI_ENABLED
        //#define WEBSOCKET_SERIAL
    #endif

    #ifndef WEBSOCKET_SERIAL
        // if defined messages are sent on bluetooth connection, otherwise standard serial is used
        #ifndef WIFI_ENABLED
            #define USE_BLUETOOTH_SERIAL
        #endif
    #endif

    const bool REPLAY_MODE = REPLAY_MODE_VALUE;

    // if true then we can control the display from the built-in webpage
    bool DISPLAY_CONTROL = false;

    bool ORIGINAL_DISPLAY_PRESENT = false;

    // if true then data of RD2/RD3 is bridged for the new display
    bool BRIDGE_RADIO_DATA = false;

    bool BRIDGE_ODOMETER_DATA = false;

    // if true then remote stalk data is bridged for the head unit
    bool BRIDGE_REMOTE_STALK_DATA = true;

    // if true then the ignition signal is used from the VAN bus otherwise the ignition is considered as always on
    bool USE_IGNITION_SIGNAL_FROM_VAN_BUS = true;

    //0: none / PSA CAN
    //1: PSA VAN - the distance data from the parking aid is queried with a diagnostic message (only works with rev 1.4)
    //2: Chinese
    uint8_t PARKING_AID_TYPE = 0;

    bool READ_SERIAL_PORT_FOR_COMMANDS = false;

    bool ENABLE_PARKING_AID_SOUND_FROM_SPEAKER = 0;

    uint8_t FUEL_TANK_CAPACITY_IN_LITERS = 50;

    uint32_t MILEAGE_AT_CMB_TRIP_RESET = 0;

    bool ENABLE_MANUAL_GEARBOX_DISPLAY = false;

    //0: final, 1: 1st, 2: 2nd ...
    float GEAR_RATIOS[7] = { 2.923, 1.869, 1.36, 1.051, 0.86, 0, 0 };

    //the values are in centimeters and are coming from observing the values of a 5008 from 2012
    uint8_t AAS_REAR_CORNER_DISTANCES[4] = { 60, 50, 40, 30 };
    uint8_t AAS_REAR_DISTANCES[4] = { 145, 100, 50, 30 };

    uint8_t TIRE_SIZE = 17;
    uint8_t TIRE_WIDTH = 205;
    uint8_t TIRE_RATIO = 40;

    // 0: CAN2004
    // 1: CAN2010
    uint8_t CAN_TYPE = 0;

    // 0: Aftermarket
    // 1: RD4/RD43
    // 2: RD45
    // 3: RD45 (CAN2010)
    // 4: RD3
    // 5: RTx
    uint8_t RADIO_TYPE = 2;

    bool DISPLAY_CONTROL_WITH_COM = false;

    bool LEFT_STICK_BUTTON_SHOWS_OIL_TEMP = false;

    bool USE_BRIGHTNESS_FROM_CAN_ODOMETER = false;
    uint8_t VIN_FOR_HEADUNIT[VIN_LENGTH] = { 0 };

    // if true, then SEND 0x167 on CAN bus
    bool NO_EMF_C_INSTALLED = false;

    // 1: original layout
    // 2: my layout (displays fuel level, vehicle speed, rpm instead of the basic trip computer data)
    uint8_t DISPLAY_MODE = 1;

    // if true then AC changes are sent to the display
    bool SEND_AC_CHANGES_TO_DISPLAY = false;

    // if true then AC changes are sent to the display
    bool SEND_AC_FAN_CHANGES_TO_DISPLAY = false;

    bool ENABLE_REVERSE_CAMERA_ON_RTX = false;

    // if true the AC status is queried with a diagnostic message (only works with rev 1.4)
    bool QUERY_AC_STATUS = false;

    const bool WIFI_AP_MODE = WIFI_AP_MODE_VALUE;
    const char* WIFI_AP_NAME = WIFI_AP_NAME_VALUE;
    const char* WIFI_SSID = WIFI_SSID_VALUE;
    const char* WIFI_PASSWORD = WIFI_PASSWORD_VALUE;

    Config();
};

#endif

IMG_0129 IMG_0130

morcibacsi commented 3 months ago

Thanks for the log, I'll try to investigate. I didn't have much time lately to work on the project (any project actually), the BSI I bough to investigate the issue is just resting on my desk, waiting to wire things up :(

bronisMateusz commented 3 months ago

I completely understand this. Also, I haven't uploaded my BSI version here before as I haven't had the car for a long time, but this is the 9650584680 version. image