Author Topic: VAN bus interfacing (to read car speed and engine RPM Peugeot 206 1.4 HDI 2002)  (Read 93440 times)

0 Members and 2 Guests are viewing this topic.

Offline morcibacsi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: hu
TSS463 should be there in RD3, multifunction displays, odometers. You can desolder from these.  But yeah, you are right other than that it can be found only on aliexpress. Unfortunately VIN programming is not possible through PP2000 with my bridge. However in the VAN-CAN bridge you can set the VIN number what should be sent to the radio. I have mine like that also. It is also possible to query the VIN number of the radio with a CAN message so having access to a car with a CAN bus BSI is not mandatory. I had plans to create an Android app to setup diagnostic related stuff on the head unit (like VIN, presence of amplifier, region, fault reading, etc..) but unfortunately with RD45 they introduced some kind of security mechanism. So before writing data to the head unit first a length of four byte key have to be queried from it. With some logic this key have to be transformed into another one. And the programming of the head unit is only possible if you send the right transformed key to it. With RD4 and RD43 this is not necessary, so for those an application could be written.
About youtube... I have a little Peugeot-related project ongoing but not sure when will be finished,  but I'll definitely upload it :)
« Last Edit: February 08, 2020, 08:52:02 pm by morcibacsi »
 

Offline reggaester

  • Contributor
  • Posts: 28
  • Country: pl
what is this project?  :D
I'm sorry morcibacsi but I have more questions for you.
1. I have completed almost all parts needed for build it but can you tell me what is this module marked on photo? Can you upload photo of other side your shield?
2. after install the bridge do i still need rd3 and emf b or those not needed?
3. will the functionality be different if I build the minimum version?
4. why is the buzzer?
 

Offline morcibacsi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: hu
The project is top secret  ;D

1. It is a 5V to 3.3V logic level converter. It is needed because the ESP32 does not tolerate 5V on its pins so it has to be converted to 3.3V I attached a photo of the other side but there is not much to see there (apart from my awful soldering skills :) )
2. If you build the 1.4 version of the hardware with the TSS463 then you can remove the old display and radio. (The TSS463 is there to query the trip computer data, door statuses and internal temperature from the BSI).
3. Nope. Actually I have the minimum version, just like on the picture on github. The additional parts are there because the CAN transceiver part is based on the MCP2551 shields. And some others are there for measuring the internal temperature of the car (but actually I found the diagnostic messages to query that from the A/C system). R1, Q1, Bz1 is for the buzzer.
4. I included the buzzer so the board is compatible with my PSAWifiDisplayControl project. That project is for those who are replacing their head unit inside cars with CAN bus. If those cars are equipped with a parking radar then the beeping sound comes from the speakers through the headunit. So removing the head unit makes their radar silent. With the buzzer it would be possible to replicate the beeping sound. Unfortunately I did not have time and access to a car with a parking sensor so that part is not yet implemented in that project.

If you intend to build it then I recommend starting with the minimal board (as shown in the github page) as that is proven to work. The full board was not yet built and haven't been tested. After the minimum is working you can still extend the board with the additional components if you would like to.
 

Offline reggaester

  • Contributor
  • Posts: 28
  • Country: pl
hmm top secret... more details please :D

oh sorry I didn't upload an attachment. I'm asked for this red circle on the photo
 

Offline McBryce

  • Super Contributor
  • ***
  • Posts: 2682
  • Country: de
Looks like a small DC-DC regulator with a footprint so that it can replace a linear 78xx part?

McBryce.
30 Years making cars more difficult to repair.
 

Offline morcibacsi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: hu
Ah yes indeed it is a step down voltage regulator bought from aliexpress: https://www.aliexpress.com/item/32817933017.html I built the board in a way that it is possible to use these regulators or a LM7805 (TO220 package)
 

Offline reggaester

  • Contributor
  • Posts: 28
  • Country: pl
hi morcibacsi
I try compile and upload the PSAVanCanBridge-master to my esp32 wroom and I have some bugs like that:
Code: [Select]
Arduino:1.8.11 (Windows Store 1.8.29.0) (Windows 10), Płytka:"FireBeetle-ESP32, 80MHz, 921600"

libraries\PSAVanCanBridge-master\PSAVanCanBridgeMain.cpp.o: In function `setup()':

C:\Users\mateu\Documents\Arduino\libraries\PSAVanCanBridge-master/PSAVanCanBridgeMain.cpp:593: multiple definition of `setup()'

sketch\sketch_feb14a.ino.cpp.o:sketch_feb14a.ino.cpp:(.text._Z5setupv+0x0): first defined here

libraries\PSAVanCanBridge-master\PSAVanCanBridgeMain.cpp.o: In function `loop()':

PSAVanCanBridgeMain.cpp:(.text._Z4loopv+0x0): multiple definition of `loop()'

sketch\sketch_feb14a.ino.cpp.o:sketch_feb14a.ino.cpp:(.text._Z4loopv+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1
Błąd kompilacji dla płytki FireBeetle-ESP32.

Can you post short tutorial how compile and upload the code to esp using arduino ide please? I admit that this is my first contact with this topic
 

Offline morcibacsi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: hu
Seems you have a sketch named sketch_feb14a.ino You don't need that. Just download the zip, and open the PSAVanCanBridge.ino file. It is empty but don't worry about that as the main code is inside the PSAVanCanBridgeMain.cpp file. Hit compile and you should be good to go. (Make sure you have installed every library from the required section)
 

Offline reggaester

  • Contributor
  • Posts: 28
  • Country: pl
ok, now I have this error:
Code: [Select]
Arduino:1.8.11 (Windows Store 1.8.29.0) (Windows 10), Płytka:"FireBeetle-ESP32, 80MHz, 921600"

core\core.a(main.cpp.o):(.literal._Z8loopTaskPv+0x4): undefined reference to `setup()'

core\core.a(main.cpp.o):(.literal._Z8loopTaskPv+0x8): undefined reference to `loop()'

core\core.a(main.cpp.o): In function `loopTask(void*)':

C:\Users\mateu\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4\cores\esp32/main.cpp:14: undefined reference to `setup()'

C:\Users\mateu\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4\cores\esp32/main.cpp:17: undefined reference to `loop()'

collect2.exe: error: ld returned 1 exit status

exit status 1
Błąd kompilacji dla płytki FireBeetle-ESP32.

 

Offline reggaester

  • Contributor
  • Posts: 28
  • Country: pl
ok, works. I don't rename dir to PSAVanCanBridge. Now it's compile.
Did com monitor should show any messages?
 

Offline morcibacsi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: hu
Yep, in arduino it is mandatory to have the same name for the directory as the .ino file. COM monitor displays the VAN messages, but by default bluetooth is used as an output (this way I can save VAN bus captures with my smartphone in the car). If you comment the line #define USE_BLUETOOTH_SERIAL out in config.h out (or remove it) then it will display the messages on the regular COM port.
 

Offline reggaester

  • Contributor
  • Posts: 28
  • Country: pl
hello
why did you change the can lines in the schema?
where should gnd be in quadlock?
« Last Edit: February 23, 2020, 06:30:16 pm by reggaester »
 

Offline morcibacsi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: hu
I mixed up the lines when I first uploaded it. CAN_H was connected to CAN_L which is wrong. However the pinouts in the wiki (https://github.com/morcibacsi/PSAVanCanBridge/wiki/Pinouts-and-patch-lead) were fine. Just the schema was wrong. GND in the quadlock is A16 (it is also on the wiki, just I forgot to draw its line :()
 

Offline adv

  • Contributor
  • Posts: 10
  • Country: fr
Hello guys, hello Peter  >:D

After a while I finally tested the code for the RDS experimentation  :-+

Big success !!!

[ Specified attachment is not available ]

Thanks a lot man  :clap:

Now have to modify the code to make working it without the need of the laptop (have to press "p" into the serial terminal to send the data)

Few feedbacks after my experience:
- On arduino nano, I was trying to assign MISO, MOSI, CLK on regular data input/output (from line 10 to 12), baaaaad boyyyyy, you'll find them on 6 pins header !
- I was able to remove the FM1 and M1 information from the screen by putting { headerByte, 0xD1, 0x00 instead of { headerByte, 0xD1, 0x09 @ line 62

Have a good sunday !

Be back soon !
 

Offline morcibacsi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: hu
Hey, man! Nice job ;) Please keep us posted with your progress :)
 

Offline reggaester

  • Contributor
  • Posts: 28
  • Country: pl
Hi Peter,
After few days building the bridge i have problem :(
When I connect power the emf and radio is turn on but after few seconds it's stop working,
addicionaly after 2 minutes the LM7805_TO220 is very hot and smoke - input voltage is 12v, outpout is 5v
 

Offline morcibacsi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: hu
LM7805 is a standard 5V voltage regulator. It is normal to be hot because of the principle how it operates. However it isn't normal to smoke. Maybe it was a faulty unit. Try to replace it with another one and try to solder the bottom part on as large base as you can so the board can dissipate the heat. You can also try to install a heatsink on top of it, however that shouldn't be necessary. I have used one for months in my car without any problems (even in the summer when the weather was much warmer under the dashboard where I had it installed). Another option is to replace the LM7805 with a step down converter as shown on this picture: https://www.eevblog.com/forum/projects/van-bus-interfacing-(to-read-car-speed-and-engine-rpm-peugeot-206-1-4-hdi-2002)/msg2910008/#msg2910008
 

Offline reggaester

  • Contributor
  • Posts: 28
  • Country: pl
hi Peter
It's working now  ;D I use step down converter, no smoke and hot.
But now I can heat beeps from my rd43 - no vin match. Also aux input doesen't work.
Can you solve this problems?
 

Offline morcibacsi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: hu
Nice job ;) It beeps because the correct VIN number needs to be sent. There are two options here. The first is to set a known VIN number in the radio, and set it in the config.h file. For this you need to connect the radio to a real BSI with a CAN bus and use a diagnostic software to configure it. The other option is to write a little sketch which reads out the currently set VIN number with a CAN bus message, and set that VIN inside the config file. For this, the needed methods can be found in the following file: CanRadioRd4DiagStructs.h For enabling the AUX the answer is the same. I might be able to help you with a sketch to read the VIN number, however setting the AUX is a bit more complicated, and would take a lot of work to implement it. So I won't work on it in the near future.
 

Offline reggaester

  • Contributor
  • Posts: 28
  • Country: pl
thx for reply  :) Peter I I don't know anything about programming, can you help me? I don't have access to bsi so I have to use the second option
 

Offline morcibacsi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: hu
I'll create a sketch to read the VIN in the second half of next week.
 

Offline reggaester

  • Contributor
  • Posts: 28
  • Country: pl
thank you very much, I will wait :)
 

Offline reggaester

  • Contributor
  • Posts: 28
  • Country: pl
little update: I dealt with beeping. I just installed rd43 into my friend's car and using pp2000 I typed vin on the radio. Then in config.h I entered the same vin number. After this beeping stopped :)
however, I noticed several problems:
- information messages, e.g. opening doors or not fastening belts, appear only once, when they reset the program, they return, but also only once.
- the fuel range meter shows 22 km all the time and does not change, even if I reset the button on the control handle.
- sometimes the trip computer shows 0, but when I do reset esp starts to show the correct results
- when I open the door, the air conditioning panel goes into diagnostics, i.e. the servo motors can be heard. It doesn't happen without a bridge
 

Offline morcibacsi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: hu
What kind of car do you have? (model, and year)

however, I noticed several problems:
- information messages, e.g. opening doors or not fastening belts, appear only once, when they reset the program, they return, but also only once.

In general this is how the information messages are displayed: They are saved in a queue in order (first-in first out). The elements of this queue are displayed for 6,5 seconds. When a message appears on the display it is removed from the queue. A new message is only inserted to the queue when it is different from the last message which was displayed. This is implemented this way because the BSI sends the last message which was displayed indefinitely, so this logic avoids of the last message being stuck on the display. There is some kind of priority amongst these messages. For example the door status is only displayed when there is no message shown. Ice alert message is only shown once per ignition has been engaged and when the temperature is between -3 and +3 celsius (and no other message is displayed). Seatbelt warning is displayed once for 6,5 seconds when the speed is above 10 km/h. If you fasten it, or the speed drops below 10 km/h then it will reset, so if you reach 10 km/h again the warning will be displayed again. You can test this by driving above 10km/h the message should appear. If you fasten it, and unfasten it it should be displayed again.

The door status is displayed for 6,5 seconds. If the door is still open after 6,5 seconds, then it should reappear for another period (if no other message popped up in the meanwhile).

Also if you press the ESC button on the radio while a message is shown, it will be hidden immediately.

- the fuel range meter shows 22 km all the time and does not change, even if I reset the button on the control handle.

It depends on what you set up inside the config.h file at the DISPLAY_MODE option.
If it is set to 1 then it should behave as the original display.
If it is set to 2 then it displays other stuff on the display based on my preferences (see attached picture).

1. External temperature / Internal temperature with diagnostic message (for 5 seconds when end of left stick pressed)
2. Internal temperature (with diagnostic message)
3. Fuel in liters / Fuel in percentage (for 5 seconds when end of left stick pressed)
4. Instantious fuel consumption
5. Current vehicle speed / Oil temperature (for 5 seconds when end of left stick pressed)
6. Km travelled since last trip reset (this could flicker and displays garbage when bluetooth serial is enabled, don't know why)
7. Average fuel consumption since last trip reset (this could flicker and displays garbage when bluetooth serial is enabled, don't know why)
8. Average vehicle speed since last trip reset (this could flicker and displays garbage when bluetooth serial is enabled, don't know why)
9. Rpm
10. Air direction (with diagnostic message)


- sometimes the trip computer shows 0, but when I do reset esp starts to show the correct results
On which page? The second page (with the number 1) is not perfect. Somebody reported that sometimes it displays garbage. But if he disables the USE_BLUETOOTH_SERIAL in the config.h by commenting it out like this: //#define USE_BLUETOOTH_SERIAL
then it displays the correct values.


- when I open the door, the air conditioning panel goes into diagnostics, i.e. the servo motors can be heard. It doesn't happen without a bridge

This is the intended behaviour to have support for the air directions and internal temperature (as these informations cannot be found in the regular messages, so I implemented reading of these from diagnostic mode). If you don't like this, or you don't have a display which supports this information an option can be implemented in config.h


I hope this clarifies the working mechanisms a little bit. If you still think that there is some error please post a video about it, to have a better understanding. Lately I don't have much time working on the project unfortunately, so contributions (and pull requests) are very welcome.

« Last Edit: March 18, 2020, 06:10:53 pm by morcibacsi »
 

Offline reggaester

  • Contributor
  • Posts: 28
  • Country: pl
Thank you for your responce  :)
What kind of car do you have? (model, and year)
Peugeot 307  2004

Here is video showing door status
https://youtu.be/4zkF_G70zns
here you can see that the open door message only shows once until the bridge is reset.
You can test this by driving above 10km/h the message should appear. If you fasten it, and unfasten it it should be displayed again.
unfortunately it only shows up once :(

This is the intended behaviour to have support for the air directions and internal temperature (as these informations cannot be found in the regular messages, so I implemented reading of these from diagnostic mode). If you don't like this, or you don't have a display which supports this information an option can be implemented in config.h
i have emf type a so I don't need this, how can i disable it in config.h?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf