Lenovo S650 AOSP 4.4.2 (Kitkat) + common issues I've had installing it

Lenovo S650 is a great phone and I think it's newer brother, S660, is even better. There are only 2 real drawbacks:

  • it has no built in compass (which is really really bad)
  • it has very special software, VibeUI on it.

The VibeUI. It can very well be kitkat (yes, they do have official kitkat update now), but you wouldn't know that unless you look at the software version, because they have modified everything. Even settings menu is custom, I hate that. Another issue is that fishy antivirus thingy that keeps bugging me. It could run in background, but instead it's always on status bar. I hate that. I tried to escape it in any way, but there is no support, seems like everyone loves the VibeUI.

Last night I found out there is an AOSP kitkat version that actually works. So i've written a small article how I installed it on my S650, because this custom firmware is published on russian site and while i can somehow read it, i believe there are people that cannot.

First, here's a link to the forum topic that has various firmwares: http://4pda.ru/forum/index.php?showtopic=567114

IMEI backup

It's very possible that you will loose your mobile connectivity because of invalid IMEI error after flashing any firmware. You have to write down both IMEI numbers of your phone just to be safe. You have been warned. Do this first and save the numbers.

Custom recovery

You will need TWRP recovery for your phone. I got it from here: http://lenovo-forums.ru/topic/3499-lenovo-s650-%D1%80%D0%B0%D1%81%D1%88%... (or here)

I had ROW version installed already because my phone was ROW.


I chose "Google_AOSP by Zver999666", because it was latest that had all features i wanted. It's posted here: http://4pda.ru/forum/index.php?showtopic=567114&st=1380#entry35813841

There are 3 downloads: ROW version, CN version and Root that works on both. You have two options to choose from: ROW ROM or CN ROM, but you have to flash version that your current system has. I tried to run ROW, but I got stuck on a boot loop with coloured dots flying around, never finishing the boot.


So what i did is, i changed TWRP from ROW to CN by flashing a new one and I also flashed filesystem fix rp_5.5+0.5gb-cn.zip, originally posted here, but the link didn't work so i got it from here: http://lenovo-forums.ru/index.php?app=forums&module=forums&section=attac... .

It  also comes with an instruction: you flash TWRP CN version (2.7), reboot and then flash the format.zip that has been automatically created in root of sdcard.

Then i flashed the rp_5.5+0.5gb-cn.zip mentioned earlier and it was all good now.

Flashing CN version

So yeah, I flashed the CN version, then Root pack and it just worked.

Invalid IMEI

This one has been bugging me from the very first night I got the phone and flashed it. I think i accidentally formatted the wrong partitions or something, but i had to fix IMEI. Apparently it was erased so I had to fix it somehow. IMEI1 is written on the back of the phone, I calculated another IMEI using online calculator (cannot recall which one), because you cannot just provide a random one. I used those 2 IMEI numbers and software called imei_mtk6515 (I know we have MTK6582, but it indeed works) from https://github.com/luckasfb/Fly_IQ255_Firmware_Build/tree/master/tools/i...

You have to run it like this: imei.exe <15digit_IMEI_1> <15digit_IMEI_2> MP0B_001
I have linux, but the exe file still works even for me, so apparently it doesn't matter if you have windows or linux.

This command generates nvram file MP0B_001, that you have to put in /data/nvram/md/NVRAM/NVD_IMEI/ . To accomplish this, i used software called "ES File explorer" that has "Root browser" option which allows copying the MP0B_001 and putting it in location provided above.

One more thing: It didn't work for me at first, but i figured out i have to set permissions for the file, 660 (rw rw -).

Reboot the phone and you should have coverage now.


EXIF rename

Atjaunoju sen pazaudētās bildes, bet tā arī nebiju sašķirojis. Uzmontēju mazu koda gabalu, kas tās vismaz sakārto pa mapītēm.


for file in atguutaas_bildes/*jpg
    # get date from exif
    dst=$(exif -t 0x9003 -m $file | sed 's/ /-/g' | sed 's/://g')
    dst_date=$(echo $dst | cut -d "-" -f 1)
    dst_time=$(echo $dst | cut -d "-" -f 2)


    # test for empty date
    if [ -z "$dst" ] 
        newname=$(basename $file)

    # create folder if doesn't exist
    if [ ! -d sorted/$dst_date ] 
        mkdir -p sorted/$dst_date

    # move pics
    mv $file sorted/$newname
    #echo sorted/$newname



Sweex LW150 firmware upgrade

Just like every other el-cheapo home wifi router i've had lately, this one (Sweex LW150) gave up too (of course only when warranty was over). Occasionally hanging up, quietly waiting for reset.  

I have TPlink lying around too, but it would be too fancy, having wifi router with a USB port. So I looked for firmware upgrades, but found none, even in sweex homepage. Googled firmware I was currently on (H1_V3.2.5e) and found, as it appears, an alternative device Tenda W268R.

Why would I even think of flashing different firmware in it? Lucky guess - I found this listing and assumed W268R is rebranded LW150. 

So yeah, i did flash it (not so much with fingers crossed, more with hope of getting new hardware) and it still works, just different Web-UI. Same settings, just like casual upgrade. Rebooted several times, reset to default config, reconfigured and will see how it acts during nightly data backup sessions.

TLDR: If you have Sweex LW150, you can upgrade it with firmware from Tenda W268R. Just look out for old firmware name, you gotta look out for correct prefix (H1_V3.xxx)


How to fix low mic volume issue on Cubot GT99

Cubot GT99 is cheap yet beautiful quad core android phone from yet another Chinese manufacturer. Of course there's no support or anything for it and user base is low.

I struggled with this issue where other party was unable to hear me because my mic level appeared to be really low. There is no setting to change it. First i thought that might be faulty hardware or something, but it works okay when in speaker mode so i wanted to figure it out.

Phone is based on MKT (MTK6589) chip so we'll use Mobileuncle MTK Tools to boost mic volume.

1. Download application from Play Store: Mobileuncle MTK Tools

2. Open application, navigate "Engineer Mode > Engineer Mode ( MTK )", then swipe to "Hardware Testing" tab and open "Audio > Normal Mode"

3. Watch carefully for "Type", change to "Mic".

4. Change values for Level 0 to 6 one by one and don't forget to press "Set" after each change.

Note: for even louder mic, you can set all values to 255

Level 0 - 112
Level 1 - 136
Level 2 - 160
Level 3 - 184
Level 4 - 208
Level 5 - 232 
Level 6 - 255

After you've saved (Set) last setting, you may exit the application and everything should work. If you are like me and you want to see other settings too, go ahead. Just don't fiddle with them much as you can easily "break your phone" by changing wrong setting. 

btw, here's the easiest way to root cubot gt99 in case you need it. works both on windows and linux - http://blog.geekbuying.com/index.php/2013/07/31/how-to-root-cubot-gt99-mtk6589-quad-core-smart-phone/

Piezīme: Šis ir vēl viens angļu valodas ieraksts samērā retai problēmai, kurai internetā neradu risinājumu un atrisināju pats.


Flash cl-osd into g-osd using usbasp S51 avr

I've had this g-osd for couple years already which lacked few features. There was very promising project coming up on rcgroups which stated that we'll be able to have better firmware for those el-cheapo OSD's.

CL-OSD project page

I have no experience with chip programming whatsoever so i thought this is going to be really complicated, keeping in mind that i have ubuntu linux computer.

So i bought this cheap programmer off ebay (more permananent link from dx instead) , called "USBASP USBISP Downloader Programmer for 51 AVR". Was really cheap, like 5$ shipped.

Use picture from project site (see G-OSD pic) as a reference to solder of wires in place. Test which is correct wire and solder down connector pins.

Download subversion if you don't have any
# sudo apt-get install subversion

Download latest cl-osd code:
# svn checkout http://cl-osd.googlecode.com/svn/trunk/

Install avrdude on ubuntu, like this
# sudo apt-get install avrdude

Then change into cl-osd directory
cd trunk

Note: if you plan changing anything, this is the source. Otherwise (and i suggest doing that for the first time, just change directory that contains pre-compiled binaries.
# cd G-OSD

Connect the programmer (and the OSD device), programm chip like this:
# sudo avrdude -p m88 -c usbasp -U flash:w:cl-osd.hex -U eeprom:w:cl-osd.eep

This didn't work out for me because of some errors, so i forced the flash:
# sudo avrdude -p m88 -c usbasp -U flash:w:cl-osd.hex -U eeprom:w:cl-osd.eep -F

Then some upload progress happened and less than minute later i was ready to hook it up to video link again. And it works!


How to root Pipo M9 using Ubuntu Linux


Note: updated version of this article available on my other website, dedicated to pipo m9 device only: http://www.pipo-m9.info/


Was unable to get the windows driver working properly, so i gave Ubuntu 13.04 a shot at rooting Pipo M9 device.
We're running all commands as root, so start with "sudo su". Your prompt should start with "#" now. 

1. Download usual windows rooting archive from http://www.mediafire.com/download/dzx599tkq0rdehl/RK3188_ROOT_Tool.zip (zip password is "geekbuying.com".

2. Get adb. I didn't have one, so i installed it like this:
# add-apt-repository ppa:nilarimogard/webupd8
# apt-get update
# apt-get install android-tools-adb android-tools-fastboot

3. Make sure your computer can see device. Turn on "USB Debugging", connect usb cable and see dmesg output.
# dmesg
Should return something like this:
[45441.193934] usb 2-1.3: new high-speed USB device number 12 using ehci-pci
[45441.286976] usb 2-1.3: New USB device found, idVendor=2207, idProduct=0010
[45441.286983] usb 2-1.3: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[45441.286987] usb 2-1.3: Product: M9
[45441.286991] usb 2-1.3: Manufacturer: rockchip
[45441.286994] usb 2-1.3: SerialNumber: KI8VAVXFUD

4. Get the udev rolling
# sudo gedit /etc/udev/rules.d/99-android.rules
paste this text: SUBSYSTEMS=="usb", ATTRS{idVendor}=="2207", ATTRS{idProduct}=="0010", MODE="0660", OWNER="root"

# service udev restart
# udevadm control --reload-rules
# echo "0x2207" > ~/.android/adb_usb.ini

5. Hopefully adb can see device now (fingerscrossed)
# adb kill-server
# adb devices 
Should return this:
List of devices attached 

6. Explore the RK3188_ROOT_Tool zip you downloaded and extracted earlier, move into directory
#  cd /home/janis/Downloads/RK3188-root
Pay attention to TPSparkyRoot.bat file, you should open it in text editor and execute it line by line (following the directions in echo parts of code). 
After you run the commands listed in bat file, your device should be succesfully rooted and your tabled should have new icon (SuperSu app) on home screen.

Ierakstu izdomāju uzbakstīt angliski, jo man neizdevās atrast risinājumu šai problēmai. Iespējams kādam citam noder. 


Dārznieks, lol

Notikumi tā sakrita, ka iegādājāmies pāris jaunus telpaugus, jo iepriekšējie bija beiguši savu dzīvi (gadās). Apņēmības pilns, nolēmu tos šoreiz neaizmirst uz pus-gadu podiņos, paņēmu no plaukta arduino, iespraudu puķu podā pāris spailes un sāku veikt mērījumus (pretestību).

Teorētiski viss vienkārši - mitrums = maza pretestība; sausāks = lielāka. Nodomāju ka jāsāk ar empīrisko datu ielasīšanu, jānoliek to visu stacinoāri. Lai padarīto to visu mobīlāku, iegādājos TPLINK (MR3420 v1.2) bezvadu rūteri ar USB portu, arduno pievienošanai. Pirms iegādes noteikti jāizpēta, lai rūterim derētu openwrt vai ddwrt firmware. 

#include "DHT.h"
#define DHTPIN 3
#define DHTTYPE DHT22
const int PROBE = A0-A4;
int powerPin = 2;
void setup() {
  pinMode(powerPin, OUTPUT);
void loop() {
  digitalWrite(powerPin, HIGH);
  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  // check if returns are valid, if they are NaN (not a number) then something went wrong!
  if (isnan(t) || isnan(h)) {
  } else {
  digitalWrite(powerPin, LOW);

Procesā piepirku klāt arī vienu mazu sensoru temperatūras un gaisa mitruma līmeņa mērīšanai. Interesants modulis, DHT22. Ja mērījumus veic nepārtaukti, notiek neliels, bet pastāvīgs elektrolīzes process. Lai to novērstu, ķēdē ievietoju tranzistoru un no atsevišķas datu izejas to ieslēdzu pirms datu ieguves tikai noteiktos intervālos.

Papildus labojums - ja seriālo portu never katru reizi ciet (Serial.end()), tad savienojums pēc kāda laika taimautojas un attiecīgi datus vairs nesūta.

Pirmie grafošanas mēģinājumi tika veikti uz rūtera, bet sarežģītākām kalkulācijām negribēju to pakļaut, tādēļ meklēju veidu kā datus sūtīt prom, glabāt internetā. Sākotnēji neizdevās atrast risinājumu, kurš ar visvienkāršāko GET pieprasījumu ļautu man tos saglabāt, tādēļ izveidoju savu, http://data.iists.it/ , kurš dara tieši to. Pāris dienas vēlāk, Gints bija atradis tādu cosm.com , kurš ļauj saglabāt datus un attēlo tos smukos grafikos. Nedaudz pa sarežģītu un datu iesūtīšana arī sarežģītāka kā es to gribētu. Tā nu uztaisīju ka tiek sūtīts uz abiem.

Novērojums tāds ka vēl aizvien sistēma mēdz nesūtīt, tas saistīts tieši ar rūteri, ar to ka tas ieslēgts Wifi klienta režīmā un mēdz nepieslēgties pa jaunu pie centrālā rūtera kad tas tiek pārstartēts vai kas tamlīdzīgs. Iespējams, jāievieš lokāls datu buferis rūterī, gadījumos kad nav interneta savienojuma. No tiem datiem kas ir arī šķiet, ka nepieciešama vēl viena pretestība, precīzāka intervāla attēlojumam.

Tālākie plāni ir ievērot konkrētus intervālus un kad mērījums sasniedz konkrētu robežu, ieslēgt notikumu, piemēram:

  • sūtīt e-pastu (aplaisti mani ;( )
  • ieslēgt mazu akvārija pumpi un pašam sevi apliet 



Bilžu kopija

Ziemā piedalījos Valmieras domes rīkotajā hackfestā, par dalību saņēmu nelielu dāvanu karti 30 Ls vērtībā. Izlēmu, ka pats foršākais pirkums būs ārējais cietais disks (sata3) - piemaksājot tikai pāris latus (sešus?) saņēmu novietni aptuveni tūkstots megapriekiem. Tas ir praktiski bez maksas, jo i-veikals bija 1a.lv, kurā daudz kam ir ļoti draudzīgas cenas.

Tā nu īstenoju savu sen loloto plānu - bilžu backupu. Te nu jāsaka, ka tieši par bildēm es stresoju ļoti daudz. Visus sadzīvē uzņemos attēlus mūsu ģimene (pat kaķis) glabā uz tīkla diska, ja tam kaut kas notiek, tad ir nereāli stulbi - tik daudz notikumu, attēlu un vēstures. Ja kādam tas nešķiet svarīgi - padomājiet vēlreiz. Pats par sevi, tīkla disks jau ir viens ārējais disks kurš piesprausts pie Raspberry pi, tagad piespraudu otru un reizi diennaktī tiek spoguļota attēlu direktorija uz otru fizisko disku. Kā saka - sirds uzreiz atgūst mieru. Nākošais līmenis laikam būs novietot otro disku citā telpā, piemēram laukos pie tēva DSL līnijas. 

Biju domājis piemest klāt vēl dažas nenozīmīgas lietas, bet sanāca tāds palags, ka nolēmu tās izdalīt atsevišķos ierakstos.


Google+ ieraksti

Vairākkārt īdēju Feisbukā par nejēdzīgajiem ziņu izkārtojumiem un pretīgo profila izskatu. Sakarā ar to visu pārcēlos uz Google+, FB sūdam atstājot tikai ļoti pastarpinātu uzmanību.

Tā kā esmu pārāk laisks lai šeit drukātu savus ļoti svarīgos dzīves notikumus, nolēmu importēt savus Google+ ierakstus. Sacīts darīts, gan Google diezgan labi dalās ar datiem, gan arī Drupal prot ēst visu ko tam dod - pusstundas laikā sabakstīju risinājumu kas periodiski ielasa G+ publiskos ierakstus un importē šeit.

Pieļauju domu ka kāds no tiem būs anglisks vai bezsakarīgs, jo importēts tiek tikai teksts, bez pielikumiem (attēli, saites, raksti), bet šķiet ka būs labi tā pat ar.

Drupal izmantotie moduļi:
- Feeds
- Feeds JSONPath Parser
- Feeds Tamper

Google API:
- https://developers.google.com/+/api/

Papildinājums: Nepatīk man tie angliskie un bezsakarīgie ieraksti bez attēliem, pirmo lapu tomēr atgriezu iepriekšējā izskatā (vizuāli). Ieviesu skatu ar fitru, neattēlot G+ ierakstus, tie paliks zem atsevišķās sadaļas.


Parallax - just because we can

Skaidrs ka parallax (un tas ko katrs ar to saprot) jau kādu laiku ir "THE THING". Diemžēl man vēlmienu rauj liela daļa no tām lapām. Pirmais nepatīkamais šoks bija positivus lapa, likās ka viss bremzē un nevar saprast kas ir klikšķināms un kas nav. Labi ka izvēlne uzmontēta pašā augšā, vismaz tam krāšnajam brīnumam varēja tikt cauri ar pāris klikšķiem. Ja godīgi, es nespēju atrast to glītuma piesitienu konkrētajā saitā (un dažos citus parallax karognesējos). Viss ko tur redzu ir "just because we can".

Paralax problēma ir tāda ka tur viss ir ļoti krāšņš un tas kustas man tieši sejā. Parasti vietnes tiek apmeklētas tieši dēļ informācijas, ja man jāmeklē īpašo veidu kā katras vietnes autors izdomājis to navigēt, tad tā ir reāla problēma. Tādā gadījumā navigācijai ir jābūt izceltai vēl vairāk un tai jāvibrē izteiktāk par pārējo kustīgo sūdu.

Paralax ir kruti un man tas patīk kamēr tas netraucē uztvert informācijas blokus pēc kuriem es esmu ieradies.