Mg4 architecture

I'm wondering if anyone has information on what protocol the MG4 is using for the communication between the camera and the rest of the car(CAN/CAN-FD something "worse")
I suspect it will be CANbus. I've got a generic EV repo that I'm playing with, although it's C++ so not my language but interesting never the less, and it's all CANbus
 
It's not too tricky to access the wiring for the rear camera if you want to probe the signal wire, you need to remove the large piece of trim that's on the tailgate on the camera is on the 3 pin connector in the middle.

If you do find the protocol, I'd be interested to know. It could even be analogue composite video!
 
It's not too tricky to access the wiring for the rear camera if you want to probe the signal wire, you need to remove the large piece of trim that's on the tailgate on the camera is on the 3 pin connector in the middle.

If you do find the protocol, I'd be interested to know. It could even be analogue composite video!
Oh sorry I meant for the front drive assistance camera. I want to add openpilot support.
 
Oh sorry I meant for the front drive assistance camera. I want to add openpilot support.
I'm guessing the camera would be handled in the device list then dealt with in the can handler. But this is way out of my comfort zone and I'm just playing and trying to learn as I go as it's not something I've delved into too deep yet
 

Attachments

  • Screenshot 2023-04-21 at 14.14.02.png
    Screenshot 2023-04-21 at 14.14.02.png
    305.6 KB · Views: 204
  • Screenshot 2023-04-21 at 14.14.44.png
    Screenshot 2023-04-21 at 14.14.44.png
    373 KB · Views: 209
Oh sorry I meant for the front drive assistance camera. I want to add openpilot support.
Ah, the front camera is a little more tricky to access, there are 2 trim panels to remove, they are essentially 2 halves of a single panel.

The front camera has far more pins, it looks like a 20-30 sized pin connector, and I remember the camera being marked 'Bosch' but I couldn't see a model name anywhere, so I have no idea on the pinout..

It also does get quite warm which leads me to believe is could be doing some video processing, or something pretty clever under the hood.
 
Ah, the front camera is a little more tricky to access, there are 2 trim panels to remove, they are essentially 2 halves of a single panel.

The front camera has far more pins, it looks like a 20-30 sized pin connector, and I remember the camera being marked 'Bosch' but I couldn't see a model name anywhere, so I have no idea on the pinout..

It also does get quite warm which leads me to believe is could be doing some video processing, or something pretty clever under the hood.
It's standard that the camera module also does processing and sends commands to the car. Openpilot community seems to have some nice connector images and we know the connector part numbers, just need to figure out the wiring and how the networking works.
 

Attachments

  • image.png
    image.png
    559.6 KB · Views: 168
  • image.png
    image.png
    1.1 MB · Views: 139
  • image.png
    image.png
    897.1 KB · Views: 223
It's standard that the camera module also does processing and sends commands to the car. Openpilot community seems to have some nice connector images and we know the connector part numbers, just need to figure out the wiring and how the networking works.
You might be able to find the answer in the project wiki on github Home
 
Yup, that's where the photos are from. However comma devs are unlikely to see an MG4 given that they are based in San diego
Just had a quick check through the PR's and there are dev review requests from Australia, Belgium, Germany and a couple of Koreans so you might get lucky on Discord
 
For integration with Openpilot I assume it needs image data right?
You wont get that on CAN, it'll be pre-processed object & lane data being output on that.
Unless you plan on modifying Openpilot interface?

With a Bosch camera I would expect CAN FD and a minimal set of object & lane data.
 
Last edited:
For integration with Openpilot I assume it needs image data right?
You wont get that on CAN, it'll be pre-processed object & lane data being output on that.
Unless you plan on modifying Openpilot interface?
Nope, what we do is get our own image data then compute the desired path. We just need CAN connectivity so we know what packets we need to spoof to get the power steering to listen to us.
 
Ah right so you're connecting a separate camera for it and looking for the control messages on CAN? These also more than likely wont come direct from the Bosch camera, there will be an ADAS ECU that produces these. Will Openpilot work with just these signals or will it need a full dbc for it?
 
Ah right so you're connecting a separate camera for it and looking for the control messages on CAN? These also wont come direct from the Bosch camera, there will be an ADAS ECU that produces these. Will Openpilot work with just these signals or will it need a full dbc for it?
Generally the processing system is integrated with the camera on 95% of cars(I've seen an old Audi as an exception). So yeah we expect the ADAS ECU to be at the top camera. For the DBC we generally reverse engineer it though we've had it randomly appear on our desks for some brands.

Like this one just came out of nowhere for example, but we have a lot of DBCs. opendbc/vw_golf_mk4.dbc at master · commaai/opendbc
 
Oh yeah! Hopefully this link works MG4 wiring. We are quite confident that the car is running two CAN-FD channels to the camera though we haven't gotten to the point where we would be reading the data yet. Page 102 looks quite useful.
 
For integration with Openpilot I assume it needs image data right?
You wont get that on CAN, it'll be pre-processed object & lane data being output on that.
Unless you plan on modifying Openpilot interface?

With a Bosch camera I would expect CAN FD and a minimal set of object & lane data.
I hope this is helpful, not stating the obvious. Openpilot is the software used by the Commai 3X (hardware). The hardware is $1250 +$200 for a harness. You stick the kit on the windscreen, centrally. You then bypass the front camera using the new hardware and that feeds the CAN connection under the driver side.

I want it - but the MG4 is not supported. I am rubbish at technology - I plugged an ODBC2 connector in to view the CAN feed the other day and the windows stopped working. Gave me a heart attack!

Anyone willing to try and implement Comma Ai 3x and openpilot seems to need to be pretty proficient with Python, Ubuntu and wiring diagrams. I have set up the PC version on a VirtualBox - but I have not managed to run the demo video. There are very few "how to" videos or how to port cars onto openpilot to follow - a Youtuber may find this topic a good one.

It looks an excellent system I want it but I am a follower not a leader - :(
 

Are you enjoying your MG4?

  • Yes

    Votes: 518 79.2%
  • I'm in the middle

    Votes: 89 13.6%
  • No

    Votes: 47 7.2%
Support us by becoming a Premium Member

Latest MG EVs video

MG3 Hybrid+ & Cyberster Configurator News + hot topics from the MG EVs forums
Subscribe to our YouTube channel
Back
Top Bottom