Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Let the hacking begin... (Model S parts on the bench)

This site may earn commission on affiliate links.
Hi, wk057, let me call you technical genius.
I'm from Shanghai, China, sorry for my poor English, I'm using google translate online to write this post, may be I used some inappropriate words...sorry, don't care about it.
I bought the blue X with AP1.0, but I want the os user interface to change the color from blue to white. I have asked many after-sales service staffs, they all said that it can't be changed. But I noticed that when they help the car owner to replace 20 inch wheel with 22 inch whell, they can change the pic of wheel showed on the screen, so I believe that the color can also be changed! This question confused me for a long time.
Someone in this forum recommended you, can you help me to remote access my car and change the programming codes to change the color of the car? I'm willing to pay some remuneration for you.
Pm me
 
Imo. writing to tmpfs is a much better solution than disabling, logs are often useful. You can even write the logs to persistent memory if you wish on (controlled) reboot, and it would still be far better than canstantly writing to the flash.
You're probably only interested in those logs which remain after a reboot in those cases where they can't be written anymore. I understand why Tesla chose this solution. But it's always a tradeoff. Are there a lot of actual cases where the eMMC is dying on the Tesla MCUs?
 
Search fro some of the posts by @rooter … his experience indicates yes.
I can add something like this to FreedomEV, in that way it's easy to enable/disable that feature, because in certain cases Tesla Service might want to be able to look at logs beyond reboots. In the enabled case, I can also prune the logfiles more often so they keep a small RAM footprint (we don't want to waste too much RAM in tmpfs for these lenghty logfiles). Sounds like a good new feature to me :)
 
It's an interesting discussion.

The advantage to write it to eMMC is that it will be saved upon reboot. Now, a mechanism to copy it to eMMC upon reboot can accommodate for that unless for those times that the system cannot properly shutdown any more. Or when serious problems are suspected, the tmpfs mechanism disabled.

Luckily the rsyslogd is configured to not fsync() upon every message added to /var/log/syslog (but not for the other logfiles), as the system doesn't perform much other I/O, and /var/log/syslog is flooded with status messages from various Tesla applications, one could assume multiple write flushes per second by the ext3 filesystem.

To make things worse, ext3 has a journal, and it's enabled; you can check with:
tune2fs -l /dev/mmcblk0p3
Journaling on such a small and relatively fast partition does not make a lot of sense anyway.

This means that prior to writing to the eMMC, the kernel will indicate it's going to do so by writing to the on-eMMC journal first, and removing it from the journal afterwards (2 extra write operations).

To worsen things further, the filesystem is mounted with 'barrier=1'. This means each filesystem flush to of log entries to /var/log/syslog will lead to (I quote from the link below):
1.The log blocks are written to the journal.
2. A barrier operation is performed.
3. The commit record is written.
4. Another barrier is executed.
5. Metadata writes begin at some later point.
Barriers and journaling filesystems [LWN.net]

The other filesystem mount option is 'commit=20', which means that the maximum time for a write flush to happen is 20s (where the default is 5s). However, it only has a noticeable effect on read/write intensive systems (which this isn't really). Sadly this does not mean that writes will only happen every 20s, just that you are assured that it will happen within 20s.

When measuring with: iostat /dev/mmcblk0p3 10
one can see that while the car is idling; there are between 0.1 and 1 transactions per second (one can presume about 5 writes every 10s on average) that does not sound that awful. But when tmpfs is used, this is effectively 0. Assuming 24/7 operation for 30 years, this translates to almost a billion erase cycles, more than one could presume 'safe'. I would like to keep our Model X for 20 years...

Much has also to do with the specific quality and specification of the eMMC (amount of erase cycles for each block), less writes on eMMC are always better for the lifespan. If anecdotical evidence supports that eMMC is often corrupted since cars from 2012; I strongly recommend to disable logging to eMMC (and consider disabling the journal with tune2fs).

I'll go for it and implement it in the FreedomEV project (both for IC and CID). I'll call the feature 'StorageKnight' :) These are knights who say 'Ni!' to french peasants who sing with a french accent: 'We want to write to eMMC! We want to write to eMMC!' ;-)

And then I need to put it into another movie of course :-D
 
A friend of mine is moving and clearing out his shop of unneeded stuff. One of the items he gave me as an MCU1 unit. I think he got it from a salvage car. But we don't know the disposition of the unit. What's the easiest way to give it some power to see if it works? What do these sell for working or not working?

There's also a single, small black wire coming out of the side. It's just a bare wire, no connector or anything. What is that for?

Thanks.
 
Thanks, I do not have a harness.

So give it 12v and it should power up with nothing else connected?

You can power it up with 12v and ground on the correct pins, no idea what the black wire out the side is, maybe a ground loop? All the tesla black wires I’ve found have been ground.

do you have pics? Feel free to share privately if that works better, but they are very easy to power on with a pc power supply and a few wires.