yashsingh1/xdaforums huggingface dataset:
[Android Head-Units] ulysse31_revient:
[MENTION=9949288]ErikE87[/MENTION]

Did you have updates from your seller ? how is it going ?

Cheers,

--

Ulysse31
[Android Head-Units] ErikE87:
Wow that is great news!! Do you have a quick tutorial or something how to create the 'CID faker'?

I contacted the seller and he still lets me do useless stuff. I did send him the can logs but I think he doesn't really get the problem. I am trying to explain the problem again and again... But your findings will proof this really is the solution!? So I will keep trying!

Thanks for you great work!!
[Android Head-Units] ulysse31_revient:
Hi Erik,

Well, I just wanted to get my Android HU to working ^^' no thanks needed :p

The "tutorial" depends if you know arduino programming or not.

Like said before, the cable to the CID has 4 wires : 2 for the power (thick), and 2 for the CAN bus (thinner, I saw cars were they are white and green, mines are orange/green for one, and full green for the other).

Via CAN bus, the screen send regularly "status" messages (message ID 0x33a) and a "network" message (message ID 0x4f3), both have different data values:

- 0x33a status messages data values are from my guess for telling "booting/powering up", "booted/ready" and "powering down".

- 0x4f3 network messages data values are for "screen closed", "screen opening", "screen opened", "screen closing"

You need an arduino, coupled with a MCP2515 module (can controller), that sends this data regularly on the can bus network (more in depth, I use a MCP2515 modules with a TJA1050 transceiver, equipped with a 8Mhz quartz => you can use other mcp2515 modules that has different transceivers and quartz frequencies, but it will change a bit the coding for CAN initialisation).

I connect the board to the old screen can bus pins, and the board is powered using one usb port of the android HU : the advantage of this is that it boots when android is booted (car ignition), and it powers off when android goes off.

Here is a video I made with it :

https://youtu.be/j5JWucXKTGA

I'm gonna etch a real PCB from this prototype, in order to have something cleaner and a bit smaller.

I also need to see if I can reduce the number of can messages send : for now, I send 7 CAN packets seperated by 100ms, and I repeat this each 2 seconds, the 7 CAN packets are composed of 2 0x33a, 4 0x4f3 and 1 0x33a again. I need to define what is the maximum timing between blocks before CCC starts thinking screen is not here anymore, and also determine if I can reduce the number of packet ( the less I need to inject on the network, the safer it is ^^').

I'm also thinking on adding other features (like maybe a GSM module ...). but I'll leave that for later on ^^'

Send this video link to the seller (you can even send this thread if needed).

Tell me how it goes on your side.

Cheers,

--

Ulysse31
[Android Head-Units] ErikE87:
Cool video! Will thank you anyway because this is something I really need to make the android HU complete! I know a little bit about arduino/raspberry pi but don't want to f*ck it up and send wrong signals to the canbus in my BMW ;)

To get things started for me i need the following right?:

-Arduino micro (or nano?)

-MCP2515 module

-TJA1050 transceiver

-PCB board.

Can you also share your code maybe?

I did send the video to the seller.. now wait for his response! A MCU upgrade would eventually still be the better solution of course.
[Android Head-Units] ulysse31_revient:
Hi,

I use a pro micro clone (5V/16Mhz) (arduino compatible board, but very small, design was made by sparkfun). The MCP2515 module is a little piece of PCB containing a MCP2515 with a TJA1050 included (cheap module available on aliexpress). Those MCP2515 modules are 5V compliant, you can use any arduino board, if at least it's 5V on its pins.

On the video, the PCB board is a prototype board : you just solder/wire boards/components together, it is a quick way to get a test version.

For the code, and for the same reason you said before : I don't want to see people coming at me saying that my code blew up their car ^^'

I need first to try to reduce to the minimum the amount of packets sent, and also to do several tests on how it behaves in day-to-day conditions (the data values may be used for several other things on the car, I don't want it to interfere for example with the automatic light switching, or other stuff).

And even after that, if I share code, I'll put a BIG DISCLAIMER WARNING PEOPLE TO USE IT AT THEIR OWN RISK.

I suppose that you can understand that if I blew my car, well, that's my car right ^^' but clearly I don't want people coming to me telling me they had troubles with their car "because of me".

And yes, clearly, A FAR BETTER SOLUTION would be to get this implemented on the MCU, but I suppose that they also need to test similar things before (CAN message quantity needed, packet data usage vs car behaviour).

Cheers,

EDIT : I did not find any info for now on internet arround the 0x33a and 0x4f3 messages content on BMW CCC cars, so for now I just make guesses and assumptions. If some good soul visit this page, and knows something about it, or have found a link or document about it. IT WOULD REALLY HELP ^^ AND I WOULD BE REALLY THANKFUL.

--

Ulysse31
[Android Head-Units] koutsouk:
If you connect both screens in parallel with the can logger maybe connected lets say for 10 minutes you will be able to see the pattern of the can signals , if the logger also logs timing for the signals that logs.

Just a thought !
[Android Head-Units] ulysse31_revient:
Hi koutsouk,

And yes ^^' already done that, but the CAN data logs made by the android have no timestamps ... CAN bus network activity varies, it has moments of lot of activity, and others more calm, so I cannot accurately "estimate" time depending in how much packet there was between 2 packets.

So I've "estimated" doing a "global" calculation like : received XXXXX packets in 8 minutes, which gives Y arround packets per seconds for id ZZZ

This assumes that packets are only sent periodically and does not take into account the values they have in the data field ... (there are a lot of different 0x33a packets or 0x4f3 packets with different data values, they seem to come "grouped" in the dump file, but need to be sure of that).

This "estimation" works, since I'm able to use the BMW interface on the android menu, but it is still a " really rough" estimation : we are talking about injecting data (that we are not sure about its meanings for now) to a car network ... the less we send, the more we are safe ^^'

I'm gonna build a serial arduino dumper that will do the same dumps that the Android HU does, but adding a timestamp to each lines ^^' it will be more precise and wont leave any doubts in terms of timings.

There is still the question about the exact meaning of the values ... resending them and have a screen working is great, but I really don't want it to interfere with other equipments.

To summarize : some study work still needs to be done ^^

Cheers all.

--

Ulysse31
[Android Head-Units] ulysse31_revient:
Hello all,

Just an update :

Code was made last week, it was relatively easy and quick, the part that took time was ordering and receiving the needed material to build the "final" pcb.

Just installed the device on my car, and put the android HU on the car finally. It seems to work as it should ^^'

If someone faces the same problem (idrive not working because of the disappearance of the geniune screen), he'll find the source code, and schematics for the pcb here :

https://github.com/ulysse31/CID_Faker

Project is open-source ^^

WARNING : I just installed it, it works, but no idea of what it will give in the long term. I AM NOT RESPONSIBLE FOR ANY DAMAGE THIS WOULD CAUSE TO YOUR CAR, YOURSELF OR ANY OTHER PERSON.

Cheers all.

--

Ulysse31
[Android Head-Units] tiagommn:
ulysse31_revient

"The Problem :

BMW with "flap screen" (motorized screens), sends there own status messages on the can bus network... "

Hello, you tryed code Mask module and put off the flap screen?
[Android Head-Units] spydev:
i coded my car with ncsexpert "mask flap nich active "

and works
[Android Head-Units] tiagommn:
Which android you have? When you have "mask flap aktiv" not work the idrive?

I see 6 core px6 1.6ghz 2g ram, 32g rom and snapdragon 625 2.0 ghz 2g ram, 32g rom
[Android Head-Units] ulysse31_revient:
Hello,

No, I did not, and here are the following why I didn't :

- To code your car, you need :

* NCISExpert/WinKFP

* the programming files program each modules of your car corresponding to your car model year AND options (CCC business/professional, rear camera and/or radar, auto-lights, seat options, etc ...).

* a specific cable (OBD *may* be used, but clearly UNRECOMMENDED since programming errors happens often, MOST cable preferred)

An OBD cable is easy to get and use, NCISExpert/WinKFP are easy to get also, BUT, getting the correct file set to your car, IS NOT : if you update a module, and that your file set is not the exact same as your car is using, you'll need to update all other modules, or they'll stop working.

- Doing modules updates via OBD cable takes forever (4h to 8h several hours to update a car), and is risky : a bad programming may get you a dead module ...

- Doing modules updates via MOST cable is clearly faster and more secure, but cables will cost you 200 box min ...

- I have read that putting this option on the module works for some, and NOT for others ...

I preferred using a little arduino (4$) and a TJA1050 module (2$) : no car programming needed, and 100% sure that everything works ^^

Cheers all,

--

Ulysse31
[Android Head-Units] ulysse31_revient:
Hello,

Happy to know that it worked fine for you on your car, by the way, could you tell us your car type, year and options ?

I personnally won't reprogram mine (already said why on other reply), I clearly prefer to be able to switch screen easily, without having to reprogram the modules on my car (risky).

Thanks for your share,

Regards,

--

Ulysse31
[Android Head-Units] tiagommn:
I have obd cable and icom/most, I do coding. I think it's only with ncs expert and icom/most only put "flap" nicht_aktiv and works well, but some cars with obd cable won't work, need icom/most to coding.
[Android Head-Units] bthight:
Hello Tiagommm,

can u give a little tutorial on how to do this?

Where do you get that Files?

I am driving an E87 LCI with CCC.

I have an original OBD Cabel from BMW.
[Android Head-Units] tiagommn:
You need icom, This model to code Mask, mulf or tcu modules need optical fiber.
[Android Head-Units] bthight:
[/COLOR]Okay, thank you [MENTION=6187856]tiagommn[/MENTION]

I bought 2 Pro Micros as in the Video, 3 Can modules and a set of jumper cables.#

everything via Prime for 35€

And another big thanks to [MENTION=9908479]ulysse31_revient[/MENTION]

[MENTION=9908479]ulysse31_revient[/MENTION] : Do i have to use the CAN BUS below the screen, or can I use (another?) CAN-Bus? I would like to put this Arduino under the idrive Conroller somewhere. So i won´t have to take everything apart again.

Which software did you use to initilize this Adruino?

I you want, I can do some further testing.

[MENTION=408485]work[/MENTION] I have access to PEAK-CAN USB Can dongles / Baby-LIN etc.

So if you like some other testing seen let me know.

For now I during the time my components are beeing shipped I somehow want to find a MCU-SW upgrade. Android Version 9 is available for PX6.

These bloody chinese... why can´t they make their code open source ?!
[Android Head-Units] ulysse31_revient:
Hi [MENTION=3137376]bthight[/MENTION],

I used the CAN bus under the screen for 2 reasons :

1 - The original screen removed leaves this can bus connector available, so no need to "peek" on another place to connect to the canbus network

2 - being close to the Android HU allows to use one of the Android usb port to power up the arduino : when the android powers up (car keyfob insertion) it power up also its usb ports, powering up at the same time the arduino, taking the car keyfob out turn off the Android, powering off the arduino at the same time, very convenient.

But you can technically connect the arduino with the mcp module anywhere where the can bus is available, eg : behind or under the CCC navigation controller for example.

For the "software" question : I programmed it using vscode (Visual Studio code) and platformIO lib, the source code I made is available on github (check the update on first post of this thread).

I think that of course, reprogramming is one "definitive" solution, but more costly. and if you want to put back the oem screen, you'll need to pay again ... so I'll stick on this arduino solution for now.

And yes, if the chinese MCU source code would be open-source, I could easily add my code to there code, and simply add an option on the android HU to "enable CID Faking" ... no arduino would be needed. => This would be the cleanest solution.
[Android Head-Units] bthight:
Edited, see next post.
[Android Head-Units] bthight:
I hope I don't annoy you.

INT is on Pin 2

SCK is on Pin 15

GND from CAN is on GND.

CS is on Pin 5?

SO is on Pin 14

SCK is on Pin 15

SI is on Pin 16

Is there a reason why GND is three times bridged?

What is LF80_T022?
[Android Head-Units] ulysse31_revient:
Hi,

You don't annoy me, but I'm at work ^^ : I have no time for now to check the source code nor the schematics on the github.

I'll give you an answer tonight.

Cheers,

LF80_T022 : this is on the "Standalone" version : if you read my message on the github README => this version is not finished / tested yet. the USB powered is the one that I'm using, no TO220 for power regulation since its the usb that powers the arduino and the MCP module.

Also, please keep in mind (as indicated on the readme on github) that the code is made for a MCP module with TJA transceiver, and a 8mhz quartz on that CAN module (the quartz frequency is important on the CAN lib initialization, be aware).

--

Ulysse31
[Android Head-Units] bthight:
Strange... I can Upload the Sketch.

but I cannot burn the Bootloader afterwards or i cannot upload the Sketch with the programmer.

My Pro Micro is correctly detected as a Arduino Leonardo.

avrdude: Version 6.3-20171130

Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM4

Using Programmer : avr109

Overriding Baud Rate : 57600

AVR Part : ATmega32U4

Chip Erase delay : 9000 us

PAGEL : PD7

BS2 : PA0

RESET disposition : dedicated

RETRY pulse : SCK

serial program mode : yes

parallel program mode : yes

Timeout : 200

StabDelay : 100

CmdexeDelay : 25

SyncLoops : 32

ByteDelay : 0

PollIndex : 3

PollValue : 0x53

Memory Detail :

Block Poll Page Polled

Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack

----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------

eeprom 65 20 4 0 no 1024 4 0 9000 9000 0x00 0x00

flash 65 6 128 0 yes 32768 128 256 4500 4500 0x00 0x00

lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00

hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00

efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00

lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00

calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00

signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : butterfly

Description : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .

Found programmer: Id = "CATERIN"; type = S

Software Version = 1.0; No Hardware Version given.

Programmer supports auto addr increment.

Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:

Device code: 0x44

avrdude: devcode selected: 0x44

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% -0.00s

avrdude: Device signature = 0x1e9587 (probably m32u4)

avrdude: reading input file "C:\Users\Bthight~1\AppData\Local\Temp\arduino_build_193579/sketch_jul18a.ino.hex"

avrdude: writing flash (6050 bytes):

Writing | ################################################## | 100% 0.46s

avrdude: 6050 bytes of flash written

avrdude: verifying flash memory against C:\Users\Bthight~1\AppData\Local\Temp\arduino_build_193579/sketch_jul18a.ino.hex:

avrdude: load data flash data from input file C:\Users\Bthight~1\AppData\Local\Temp\arduino_build_193579/sketch_jul18a.ino.hex:

avrdude: input file C:\Users\Bthight~1\AppData\Local\Temp\arduino_build_193579/sketch_jul18a.ino.hex contains 6050 bytes

avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...

avrdude: 6050 bytes of flash verified

avrdude done. Thank you.
[Android Head-Units] ulysse31_revient:
Hello,

CS is in PIN 5

for general pinout, you can check this image :

http://qqtrading.com.my/image/catalog/Products/Arduino/pro-micro/pro_micro_pinout_v1_0_blue.jpg

I've added a pdf file of the PCB view, in order to better see which pin is connected to which, it is available here :

https://github.com/ulysse31/CID_Faker/blob/master/Hardware/USB_Powered/pcb-usbpowered.pdf

Why do you say you "cannot upload" ? the output you sent show it has written to the arduino, and verified upload successfully ...

Cheers,

--

Ulysse31
[Android Head-Units] ulysse31_revient:
Also : You should be using PlatformIO lib (with vscode, or atom editor), opening the project with the plateformio.ini from there should avoid you any mistake with board type, etc ...
[Android Head-Units] bthight:
I´ve downloaded VS-Code. And added the PlatformIO IDE Extension to it.

What does VS-Code do that the Arduino IDE does not?

But how do I make the Pro Micro run that code?

How did you upload it to the pro Micro?

I have included the Libs in the Arduino IDE.

(The Arduino IDE) It says I uploaded the code correctly.

But what am I doing wrong?

It does not run the code.

Iam Tracing with PCAN-View. (100 kbit/S , 500 Kbit/s and 1Mbit/s) no trace.

I know many questions... sorry for that.

Iam from a construction department. I do soldering, testing all kinds of automtive things, but no programming.
[Android Head-Units] bthight:
I managed it to write the code to the Pro Micro in VS. The buttons are just super tiny and not easy to See.

But still - I see no CAN Trace, with any baudrate.
[Android Head-Units] ulysse31_revient:
Hi,

What MCP2515 module do you have ? is the transceiver a TJA1050 ? what is the frequency of the oscillator on it ? (it is marked on the quartz oscillator on the module)

Also, have you take into account that a can-bus line is basically 2 wires, but attached together with a 120 ohm resistor on both sides ? (this is important if you want to test it with a reader)

Q- Why I used platformIO and vscode ?

A- Because platformIO allows to move the code from one board to another easily, and it is compatible with much more boards than only arduinos, and vscode+platformio does not need java (java stinks), and platformio can be used with vscode, atom, emacs or vi/vim (no need to use graphic interface with those 2 lasts).

Q- how do I make the Pro Micro run that code?

A- upload it to the board with the correct board type setup, that is why I used vscode+platformIO also : it is really simple to use, I would recommend you to have a look to this video from a good youtuber :

https://www.youtube.com/watch?v=0poh_2rBq7E

He explains electronics very well.

Q- How did you upload it to the pro Micro?

A- with vscode+platformIO ...

Q- But what am I doing wrong?

A- Please, answer my questions about your mcp2515 module, and also check the video link.

I hope it helps,

Bests,

--

Ulysse31
[Android Head-Units] bthight:
Good evening [MENTION=274020]ulysse31[/MENTION]

Thank you again very much for your help.

Shame on me, I did not terminate it.

The CAN-Board is this https://www.amazon.de/gp/product/B01IV3ZSKO/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1

Description: "

XCSOURCE 3 Stück MCP2515 CAN Bus Modul TJA1050 Empfänger SPI für Arduino 51 MCU ARM Steuerung Entwicklung Board TE534"

Tomorrow I will check again when I am at work, there I have all the necessary equipment to test it.

Good Night!

Sincerely yours

Bthight
[Android Head-Units] ulysse31_revient:
Hi,

From the seller picture, it seems that the quartz is 8Mhz, so it's the same as me. you ma double check on physically on the one that you are using, it should indicate "8.000" on it.

So it leaves on the possible problems the following :

- "bad wiring"/"wrong pin" connection between arduino and MCP2515 module => please check connectivity, use the pdf file I recently uploaded on the github tree to see wiring, I'll generate a pdf of the schematics when I'll have the time (I work this saturday all day, so do not know exactly when).

- bad reader settings : if the reader you are using is not correctly set with the correct baud rate, it won't receive messages. => a simple quick test is to try out the reader with its settings on the car, in the pins left by the original screen, you should see hundreds of packets per seconds once key entered.

- bad cabling on the test-can-bus : like said before, a can bus is composed of 2 wires, attached together on each ends by a 120 ohm resistor => the reader you are using may have troubles reading without the resistors on the ends.

I coded myself a CAN-dumper, that uses the same arduino-micro and MCP2515 module, and same "schematics" : only the code varies, but it allowed me to try out and see the packets on my car and from my device I was testing, I'll add a "test" folder on the CID_Faker project, where I'll add inside the content of the CAN-Dumper code/project I made. (again, on the next days ...)

Regards,

--

Victor
[Android Head-Units] ulysse31_revient:
Hi,

From the seller picture, it seems that the quartz is 8Mhz, so it's the same as me. you may double check on physically on the one that you are using, it should indicate "8.000" on it.

So it leaves on the possible problems the following :

- "bad wiring"/"wrong pin" connection between arduino and MCP2515 module => please check connectivity, use the pdf file I recently uploaded on the github tree to see wiring, I'll generate a pdf of the schematics when I'll have the time (I work this saturday all day, so do not know exactly when).

- bad reader settings : if the reader you are using is not correctly set with the correct baud rate, it won't receive messages. => a simple quick test is to try out the reader with its settings on the car, in the pins left by the original screen, you should see hundreds of packets per seconds once car key inserted.

- bad cabling on the test-can-bus : like said before, a can bus is composed of 2 wires, attached together by one 120 ohm resistor on each ends => the reader you are using may have troubles reading without the resistors on the ends.

I coded myself a CAN-dumper, that uses the same arduino-micro and MCP2515 module, and same "schematics" : only the code varies, but it allowed me to try out and see the packets on my car and from my device I was testing, I'll add a "test" folder on the CID_Faker project, where I'll add inside the content of the CAN-Dumper code/project I made. (again, on the next days ...)

Regards,

--

Ulysse31
[Android Head-Units] bthight:
Hi Victor,

the CAN Module says 8MHz.

Iam going to test my other module. In case the first one ist broken. Or my soldering on the pro Micro is not 100% functional.

Thank you again.
[Android Head-Units] bthight:
It works!

I have seen no trace on my PCAN again somehow.

But it should have worked perfectly fine from beginning on.

Thank you Victor!
[Android Head-Units] ulysse31_revient:
Glad to know you finally made it ! ^^

It really makes me happy to know that my project helped someone.

Cheers,

--

Ulysse31
[Android Head-Units] idris95200:
Thanks for that very helpful