All posts by tomasz

Favorite i3 coding change – 9 L (2.4 US gal) fuel tank

One of the things I love about our i3 is the ability to code it. BMW built in tons of options that can be changed to fine tune this state of the art machine to your liking. We, software engineers, love tinkering with stuff.

One of the things I hate about our i3 is how BMW decided to code it for north american market. It is common knowledge by now that several decisions has been made to please CARB and earn zero emission credits. It is suspected (although nobody confirmed ) that to fully comply with CARBs requirements BMW needed to make sure that the car’s gasoline range is lower than it’s range when it’s powered by electricity alone. To accomplish that they lowered tank’s capacity (from 2.4 US gal to 1.9 US gal). We, software engineers, hate when accountants win.

We, engineers, on the other hand, instead of complaining, try to design and develop solution. First question was ‘how did they lower the capacity’?  Natural answer would be ‘different tank’, but further examination revealed that both EU and NA built i3s share exactly the same part number for fuel tank. So maybe they have inserted something in the tank to lower the capacity? But parts diagrams show zero differences, no bigger fuel pump, no additional plastic fillers.

Hey, how about software solution? What if the engine was being turned off despite some fuel still being in the tank?

Few minutes spent on browsing coding options reveal that there are two options with very, very suggestive names:

Screen Shot 2015-01-16 at 8.53.31 PM

The options that need to be changed are:

3005 Tank, 58

TNK_LITER_RECHTS -> mcv_rex_liter_kl_rechts (from mcv_rex_liter_kl_rechts_us)

TNK_OHM_RECHTS -> mcv_rex_ohm_kl_rechts (from mcv_rex_ohm_kl_rechts_us)

After quick coding, the display started showing about 20 more miles of available range:

befor_after

 Later not so quick trip to burn all fuel that was left in the tank and here is the result:

IMG_4392

 

This change is by far my most favorite one, topping easily ability to turn on hold mode.

 

Growing ZFS pool

recently one of the drives in my storage pool died. Considering that I already was running out of free space:

#zfs list storage
NAME USED AVAIL REFER MOUNTPOINT
storage 3.21T 820G 236K /storage

I decided to not only replace the failed 1.5TB drive but get two 4TB drives and upgrade whole vdev. Imagine my surprise that despite my memory telling me that it should grow on it’s own. It didn’t.

Some searching later I found out that replacing drives is only part of the solution.
First you have to Continue reading Growing ZFS pool

Os X Preferences stopped working? There is a fix for that!

Recently I’ve noticed that my Preferences started behaving strangely. Only main panes would open, but no secondary windows would work. For example I could open network preferences and delete all interfaces, but clicking plus button to add new did not work. Which quickly left me with no network on my machine :-)

Some googling later and it seems to be an issue carried over from times when my machine had Leopard installed and some preferences were saved on the disk and carried over. Here is the fix:

defaults delete NSGlobalDomain NSUseLeopardWindowValues
defaults delete com.apple.Safari NSUseLeopardWindowValues
defaults delete -g AppleUseCoreUI
killall SystemUIServer

Zend Studio running out of memory? There’s a fix for that!

Recently while working in Zend Studio I had couple of crashes that I finally traced down to it running out of memory. After searching around I found that you can bump up it’s default settings by editing it’s .ini file.

The file is located in /Applications/Zend Studio.app/Contents/MacOS


# cat ZendStudio.ini
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-showlocation
-name
Zend Studio
-vmargs
-Xms512M
-Xmx1536M
-XX:MaxPermSize=256m
-DGIT_SSL_NO_VERIFY=true
-Dsvnkit.http.sslProtocols=SSLv3
-Djava.awt.headless=true
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Xdock:icon=../Resources/mac.icns

The settings that you need to bump are Xms and Xmx (in case above they are already bumped up.

My Zend Studie has not crashed since. Happy coding!