PSAVanCanBridge icon indicating copy to clipboard operation
PSAVanCanBridge copied to clipboard

Feature 3 - Connects2 like display control

Open karolp1993 opened this issue 4 years ago • 7 comments

I created a simple code to control display from radio stalk - like in connects2 adapters. For people which are using original display with aftermarket car audio. It was necessary do add another DISPLAY_MODE option, because button on the left stalk switches modes of the display. Radio stalk works as below:

  • seek up & seek down simultaneosly - MENU button (enters to the menu of the display)
  • seek down - UP Arrow
  • seek up - DOWN Arrow
  • volume up - RIGHT Arrow
  • volume down - LEFT Arrow
  • source - OK button
  • volume up & volume down simultaneosly - ESC button (escapes the menu)
  • left stalk button - MODE button

I'm testing that code since month and I didn't notice any wrong behavior.

karolp1993 avatar Jun 07 '20 12:06 karolp1993

Unfortunately, I've noticed an issue with that code. I tested it mostly with code from my commit: https://github.com/morcibacsi/PSAVanCanBridge/commit/22402d4baadd8e26cc81610f44b7d6f4319b9686

Yesterday, I merged above functionality with current version of code, and tested at home. Everything worked fine. In a car, when I try to set up a display, random buttons are pressing without touching a remote stalk. I don't know for now where the problem is, because in older revision of software everything worked fine.

karolp1993 avatar Jun 08 '20 07:06 karolp1993

Hmm... that is really strange. There were some larger modifications but those should create these kind of errors. However @DenGorobets mentioned something similar in this comment. Unfortunately the issue does not exists on my side. However I think you have one thing in common: you both have an aftermarket head-unit (I have an RD45 installed). Maybe it has something to do with that.

Edit: Anyways I am going to merge your pull request as soon as I have some free time to do it, and going to test it. (I try to find some time to also test without a headunit)

morcibacsi avatar Jun 08 '20 09:06 morcibacsi

Only thing which connects headunit to the car is connects2 module. I will try to disconnect it and will see if that helps.

karolp1993 avatar Jun 08 '20 09:06 karolp1993

Okay, I checked how display works with connects2 disconnected and no result :C Looks like connects2 has nothing common with that issue. When I was in a car, I flashed earlier version of FW and issue was not appear. Here are videos:

  • "old" version with android headunit connected: https://www.youtube.com/watch?v=Ep6rJ7tatg4
  • current version with connects2 disconnected: https://www.youtube.com/watch?v=ateWcOdtXKI

@morcibacsi Is it possible the new TSS463 library makes a problem?

karolp1993 avatar Jun 08 '20 19:06 karolp1993

Well... these are the hardest things to find. Can you send me a snapshot of the libraries and the source code with the faulty behaviour? Or if you send me the commit ids (both for the tss463 and the van-can bridge) I try to reproduce the issue.

Edit: A VAN-bus capture with the faulty behaviour would be also nice.

morcibacsi avatar Jun 08 '20 19:06 morcibacsi

@karolp1993 I think I have a theory what went wrong with the TSS463 update. That library contained pretty large delays while writing the registers of the IC. There were millisecond based delays instead of microseconds by mistake. Maybe that messed up other stuff as now the processor doesn't go idle for that long time as before. I wouldn't revert that code as this is how it should be (based on its datasheet).

Anyways, I put together a test environment on my desk with a BSI a COM2000 and the display. I downloaded your code and tried the 9101e383 commit with the latest TSS463 lib. The radio stalk controls the display but it jumps twice quite a bit. I could fix that by decreasing the delay in the buttonReset method to 10 and sending all the button codes (including the zeros) three times. That way it got much better (however sometimes still jumps twice). So you should experiment with that to get the best achievable result.

Or if you would like I can also merge your changes to the master with the required changes.

Also I think a feature switch would be required in the config.h file as now the zero button code is sent every time the VanRemoteHandler runs. When a factory head unit is installed this causes additional unnecessary CAN traffic. (I can implement this after merging to master)

Edit: A strange discovery: Pressing the SRC button can generate a VAN message with a CRC error when the wheel is in a certain position on the remote.

CRC ERROR: 0E 9C 4C 02 81 2E 00

morcibacsi avatar Jun 09 '20 17:06 morcibacsi

Okay, I will make changes in my code and commit again. About switching items twice - in my opinion (maybe this is wrong observation) it looks like depends on radio stalk. Some of buttons can be dirty a bit (like remote control from TV) and debouncing is appear. And I have to make second adapter for using to tests in home ;)

karolp1993 avatar Jun 09 '20 19:06 karolp1993