Creating an IoT thermostat (part III)

Improving our Yocto based distribution

Intro

Previously we made ourselves a Linux distribution ourselves for our target embedded system. We included basic Qt5 support which allows us to create a fast and responsive C++ frontend. This time we will further develop our embedded system and prepare it for usage.

Adding QtQuick – QML support

In the previous article we succeeded in created a QtWidget based application. However, with QtQuick there is a new UI framework available which has its own set of benefits. You may already have noticed that QtCreator comes with lots of examples and you may have even tried some of them. However, if you (like me) created your Yocto based OS using the bitbake qt5-basic-image command you will find that some programs may not work when yo run them on your embedded device:

root@raspberryyocto:~# ./clocks
./clocks: error while loading shared libraries: libQt5Quick.so.5: cannot open shared object file: No such file or directory
root@raspberryyocto:~#

Basically we didn’t include support for QtQuick when we compiled our OS. So if you’re into using QtQuick go back through your Yocto working folder and bitbake the qt5-image:

geoffrey@geoffrey-Dell-XPS-L502X:/media/geoffrey/Data/yocto-pi/rpi/build$ bitbake qt5-image
Loading cache: 100% |############################################| Time: 0:00:00
Loaded 2660 entries from dependency cache.
Parsing recipes: 100% |##########################################| Time: 0:00:01
Parsing of 1972 .bb files complete (1964 cached, 8 parsed). 2668 targets, 353 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION = "1.32.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "raspberrypi"
DISTRO = "poky"
DISTRO_VERSION = "2.2.1"
TUNE_FEATURES = "arm armv6 vfp arm1176jzfs callconvention-hard"
TARGET_FPU = "hard"
meta
meta-poky = "morty:a3fa5ce87619e81d7acfa43340dd18d8f2b2d7dc"
meta-oe
meta-multimedia
meta-networking
meta-python = "morty:1efa5d623bc64659b57389e50be2568b1355d5f7"
meta-qt5 = "morty:9aa870eecf6dc7a87678393bd55b97e21033ab48"
meta-raspberrypi = "master:e1f69daa805cb02ddd123ae2d4d48035cb5b41d0"
meta-rpi = "morty:03841471ccaed549a2a14a896c13f71af76cf482"

Initialising tasks: 100% |#######################################| Time: 0:00:08
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 3619 tasks of which 3538 didn't need to be rerun and all succeeded.
geoffrey@geoffrey-Dell-XPS-L502X:/media/geoffrey/Data/yocto-pi/rpi/build$

Notice how fast compiling the image goes this time compared to when we build the qt5-basic-image. The reason for this faster build time is because the qt5-image inherits the qt5-basic-image and Yocto just needed to recompile some of the components that were not yet compiled. Also note that you don’t need a new SDK and you shouldn’t need to re-configure QtCreator.

With your SD card already formatted you only need to copy the compiled files to your SD card:

geoffrey@geoffrey-Dell-XPS-L502X:/media/geoffrey/Data/yocto-pi/rpi/build$ cd ../meta-rpi/scripts/
geoffrey@geoffrey-Dell-XPS-L502X:/media/geoffrey/Data/yocto-pi/rpi/meta-rpi/scripts$ sudo umount /dev/mmcblk0p1
geoffrey@geoffrey-Dell-XPS-L502X:/media/geoffrey/Data/yocto-pi/rpi/meta-rpi/scripts$ sudo umount /dev/mmcblk0p2
geoffrey@geoffrey-Dell-XPS-L502X:/media/geoffrey/Data/yocto-pi/rpi/meta-rpi/scripts$ export MACHINE=raspberrypi
geoffrey@geoffrey-Dell-XPS-L502X:/media/geoffrey/Data/yocto-pi/rpi/meta-rpi/scripts$ export OETMP=/media/geoffrey/Data/yocto-pi/rpi/build/tmp
geoffrey@geoffrey-Dell-XPS-L502X:/media/geoffrey/Data/yocto-pi/rpi/meta-rpi/scripts$ ./copy_rootfs.sh mmcblk0 qt5 raspberryyocto

OETMP: /media/geoffrey/Data/yocto-pi/rpi/build/tmp
IMAGE: qt5
HOSTNAME: raspberryyocto

File found: /media/geoffrey/Data/yocto-pi/rpi/build/tmp/deploy/images/raspberrypi/qt5-image-raspberrypi.tar.xz

Block device not found: /dev/mmcblk02, trying p2

Formatting /dev/mmcblk0p2 as ext4
[sudo] wachtwoord voor geoffrey:
/dev/mmcblk0p2 bevat een ext4-bestandssysteem met label 'ROOT'
laatst aangekoppeld op / op Sun Feb 19 22:07:51 2017
Toch doorgaan? (j,n) j
Mounting /dev/mmcblk0p2
Extracting qt5-image-raspberrypi.tar.xz to /media/card
Writing raspberryyocto to /etc/hostname
Unmounting /dev/mmcblk0p2
Done
geoffrey@geoffrey-Dell-XPS-L502X:/media/geoffrey/Data/yocto-pi/rpi/meta-rpi/scripts$

With that done we need to have a QtQuick test application. If you haven’t yet tried on of the QtCreator’s QtQuick examples do so now. Get back to your embedded device, insert the SD card and boot. Once booted, retrieve the device’s IP address and copy over any QtQuick test application. I’ve used the clocks application. Once you have the application compiled and copied over to the raspberry pi, ssh into your pi and start the application (or launch it from within QtCreator if you’ve had it still openened). You should see more or less something like this:

qtquick-demo-clocks-small

If you happen to run into “out of memory” errors:

root@raspberryyocto:~# ./clocks
QML debugging is enabled. Only use this in a safe environment.
Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
JIT is disabled for QML. Property bindings and animations will be very slow. Visit https://wiki.qt.io/V4 to learn about possible solutions for your platform.
glGetError 0x505
QSGTextureAtlas: texture atlas allocation failed, out of memory

… then you should tweak the CPU/GPU memory allocation settings. This settings is loaded at boot and it is also saved in a config file on your boot partition. To adjust the config file we first need to mount the boot partition, and next we can edit the file using the vi editor:

root@raspberryyocto:~# mkdir /mnt/fat
root@raspberryyocto:~# mount /dev/mmcblk0p1 /mnt/fat
root@raspberryyocto:~# vi /mnt/fat/config.txt

Add gpu_mem=256 to this file and reboot your pi. Try again running the clocks application, things should go now as intended:

root@raspberryyocto:~# ./clocks
QML debugging is enabled. Only use this in a safe environment.
Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
JIT is disabled for QML. Property bindings and animations will be very slow. Visit https://wiki.qt.io/V4 to learn about possible solutions for your platform.

Setting the timezone

To show the current time we will rely on NTP. RaspberryPi does not come with a RTC see I don’t see any other option. NTP is already added via Yocto, we only have to set the correct timezone:

root@yoctopi:~# ls -l /etc/localtime
lrwxrwxrwx 1 root root 27 Apr 10 18:36 /etc/localtime -> /usr/share/zoneinfo/EST5EDT
root@yoctopi:~# rm /etc/localtime
root@yoctopi:~# ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime
root@yoctopi:~# date
Sun Apr 16 12:30:40 CEST 2017

Adding a touch screen

The RaspberryPi community has a very decent 7″ touch screen. There is not much to say about, I got one, followed the instructions to hook it op and basically started testing some my applications straight away!

2033-01

Side note: I used the same housing as show above. This one has the display upside down, the rotate the display through software we must again edit the config file on the boot partition:

root@raspberryyocto:~# mkdir /mnt/fat
root@raspberryyocto:~# mount /dev/mmcblk0p1 /mnt/fat
root@raspberryyocto:~# vi /mnt/fat/config.txt

and add:

display_rotate=2

Restart to apply your changes.

Adding a HTU21D I²C temperature sensor

The HTU21D is a decent temperature and humidity sensor which perfectly suits our needs. To hook it up to our Raspberry Pi 2:

htu21d-block-s

Before we can use the I2C bus we must again edit the Pi’s config file:

root@raspberryyocto:~# mkdir /mnt/fat
root@raspberryyocto:~# mount /dev/mmcblk0p1 /mnt/fat
root@raspberryyocto:~# vi /mnt/fat/config.txt

and add:

dtparam=i2c_arm=on

Restart to apply your changes.
After the system has booted into Linux again we will first check if the i2c_bcm2708 module has been loaded:

root@yoctopi:~# lsmod
Module                  Size  Used by
ipv6                  350447  28
i2c_dev                 6115  2
evdev                  11396  1
joydev                  8960  0
bcm2835_gpiomem         3036  0
i2c_bcm2708             4834  0
bcm2835_wdt             3225  0
rpi_ft5406              4612  0
uio_pdrv_genirq         3164  0
rpi_backlight           2064  0
uio                     8128  1 uio_pdrv_genirq

Now we must add the i2c device by doing:

root@yoctopi:~# touch /etc/modules
root@yoctopi:~# echo 'i2c-dev' >> /etc/modules

Reboot again. When all went good we can now use the ic2detect tool to see if the Pi is able to communicate with our temperature sensor:

root@yoctopi:~# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

With everything setup and good to go I can now start developing my application. Stay tuned for more!

Advertisements

Samsung Galaxy S3 Mini CyanogenMod 12.1 (Android 5.1)

Sporting Android 4.1 and dual ARM Cortex A9 cpu’s the Samsung Galaxy S3 Mini (GT-I8190) is no longer competitive with any mid-range smartphones currently found in stores (read more). However, because of its wide community the smartphone has become a interesting target for creating custom ROM’s. In this guide I’ll go through some commands which will help you upgrading the S3 mini from stock Android 4.1 to Android Lollipop 5.1!

Notice that for performing this modification I’ll be using and SD-card and my laptop with Ubuntu 16.4 operating system installed. Before we get along make sure to visit the NovaFusion.pl website, head over to the download page and download following files:

If the site offers you the choice between Recovery and Oden take the Recovery option. It means we’re going to perform the flash through the recovery menu which is build inside the device. The Odin option is used for flashing the ROM through the Odin utility for Samsung smartphones. Caynogenmod 12.1 is the custom ROM we’re going to install and features Android Lollipop 5.1. TWRP Recovery is an enhanced software tool which is more feature rich than the S3 Mini’s default recovery tool. We need it to flash to custom ROM. Also head over to the opengapps.org website and download the latest Google Apps application suite compiled for your platform. To be sure you have the correct version select following checkboxes before hitting the download button: “ARM Platform”, “Android 5.1”, “stock variant”. This stock variant of Google Apps (often referred to as Gapps) includes a whole list of Google applications: Play Store, Chrome browser, Calculator, Drive, Docs, Keep, Fitness, Keyboard, Maps, YouTube, … See the complete list here. You can also use following link which will take you directly start downloading Gapps for you Samsung S3 Mini: Gapps for Samsung S3 Mini.

Now grab your SD-card, head over to your computers download folder and copy the Gapps and Cyanogenmod zipfiles onto your SD-card. After copying has been completed install the SD-card into your S3 Mini. Next we’re going to boot or reboot the smartphone into “download” mode (sometimes also referred to as “Odin” mode). You can this by holding Power + Volume Down + Menu buttons at the same time when powering up your smartphone. You can also reboot into download mode when your phone is on by installing Google’s ADB debug tool (sudo apt-get install android-tools-adb android-tools-fastboot) and issuing following command: adb reboot download. Note that must have USB debugging enabled and you must be connected to your device.

All-Galaxy-S3-Download-Mode-580x362

booting Samsung Galaxy S3 Mini into “download/Odin” mode

The download mode is specific to Samsung smartphones, but it is similar to the Fastboot mode found on many different smartphones with unlocked bootloader.

Next we’ll use the Heimdall tool to flash the TWRP recovery tool into our smartphone’s memory. On Ubuntu you can install it by issuing following command: sudo apt-get install heimdall. On your computer head over to you download folder and unzip the twrp’s zipfile. Inside the unzipped folder you’ll find a “recovery.img” image file which we’ll flash. Open a command terminal from this location and issue following command:

sudo heimdall flash –Kernel2 recovery.img –no-reboot

We’ll get following outcome:

Heimdall v1.4.0

Copyright (c) 2010-2013, Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
Claiming interface...
Setting up interface...

Initialising protocol...
Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Uploading Kernel2
100%
Kernel2 upload successful

Ending session...
Releasing device interface...

This command flashes the TWRP’s binary image “recovery.img” into the “Kernel2” recovery partition. On your smartphone a blue bar will appear that will show the progress. If for some reason this “Kernel2” partition is not available on your S3 Mini you can discover the target partition by yourself by issuing following command:

sudo heimdall print-pit –verbose

It will result in following outcome (the target partition is marked in blue and can be found because it is the partition holding the recovery.img Flash filename):

Heimdall v1.4.0

Copyright (c) 2010-2013, Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
 Manufacturer: "SAMSUNG"
 Product: "SAMSUNG USB DRIVER"
 Serial No: " "

length: 18
 device class: 2
 S/N: 3
 VID:PID: 04E8:685D
 bcdDevice: 0100
 iMan:iProd:iSer: 1:2:3
 nb confs: 1

interface[0].altsetting[0]: num endpoints = 1
 Class.SubClass.Protocol: 02.02.01
 endpoint[0].address: 83
 max packet size: 0010
 polling interval: 09

interface[1].altsetting[0]: num endpoints = 2
 Class.SubClass.Protocol: 0A.00.00
 endpoint[0].address: 81
 max packet size: 0200
 polling interval: 00
 endpoint[1].address: 02
 max packet size: 0200
 polling interval: 00
Claiming interface...
Setting up interface...

Initialising protocol...
Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Entry Count: 25
Unknown 1: 1598902083
Unknown 2: 844251476
Unknown 3: 28519
Unknown 4: 25708
Unknown 5: 28261
Unknown 6: 0
Unknown 7: 0
Unknown 8: 0


--- Entry #0 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 1
Attributes: 2 (STL Read-Only)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 0
Partition Block Count: 256
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: MBR,GPT
Flash Filename: 
FOTA Filename:


--- Entry #1 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 2
Attributes: 2 (STL Read-Only)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 256
Partition Block Count: 768
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: MasterTOC
Flash Filename: STE_boot.bin
FOTA Filename:


--- Entry #2 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 70
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 1024
Partition Block Count: 2048
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: PIT
Flash Filename: goldenxx.pit
FOTA Filename:


--- Entry #3 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 71
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 6144
Partition Block Count: 2048
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: MD5HDR
Flash Filename: md5.img
FOTA Filename:


--- Entry #4 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 3
Attributes: 2 (STL Read-Only)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 8192
Partition Block Count: 1024
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: STEboot1
Flash Filename: STE_boot1.img
FOTA Filename:


--- Entry #5 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 4
Attributes: 2 (STL Read-Only)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 9216
Partition Block Count: 1024
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: STEboot2
Flash Filename: STE_boot2.img
FOTA Filename:


--- Entry #6 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 5
Attributes: 2 (STL Read-Only)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 10240
Partition Block Count: 1024
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: Dnt
Flash Filename: dnt.ssw
FOTA Filename:


--- Entry #7 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 6
Attributes: 2 (STL Read-Only)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 11264
Partition Block Count: 1024
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: reserved
Flash Filename: 
FOTA Filename:


--- Entry #8 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 7
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 16384
Partition Block Count: 2048
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: CSPSAFS
Flash Filename: cspsa.img
FOTA Filename:


--- Entry #9 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 8
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 18432
Partition Block Count: 2048
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: CSPSAFS2
Flash Filename: cspsa2.img
FOTA Filename:


--- Entry #10 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 9
Attributes: 5 (Read/Write)
Update Attributes: 5 (FOTA)
Partition Block Size/Offset: 20480
Partition Block Count: 32768
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: EFS
Flash Filename: EFS.img
FOTA Filename:


--- Entry #11 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 10
Attributes: 5 (Read/Write)
Update Attributes: 5 (FOTA)
Partition Block Size/Offset: 53248
Partition Block Count: 32768
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: ModemFS
Flash Filename: modemfs.img
FOTA Filename:


--- Entry #12 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 11
Attributes: 5 (Read/Write)
Update Attributes: 5 (FOTA)
Partition Block Size/Offset: 86016
Partition Block Count: 32768
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: ModemFS2
Flash Filename: modemfs2.img
FOTA Filename:


--- Entry #13 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 12
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 118784
Partition Block Count: 102400
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: Fota
Flash Filename: ssgtest.img
FOTA Filename:


--- Entry #14 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 13
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 380928
Partition Block Count: 128
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: IPL Modem
Flash Filename: ipl.bin
FOTA Filename:


--- Entry #15 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 14
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 385024
Partition Block Count: 28672
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: Modem
Flash Filename: modem.bin
FOTA Filename:


--- Entry #16 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 15
Attributes: 2 (STL Read-Only)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 417792
Partition Block Count: 4096
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: Loke4
Flash Filename: normal.bin
FOTA Filename:


--- Entry #17 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 16
Attributes: 2 (STL Read-Only)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 421888
Partition Block Count: 4096
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: 2ndLoke4
Flash Filename: normal2.bin
FOTA Filename:


--- Entry #18 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 17
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 425984
Partition Block Count: 32768
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: PARAM
Flash Filename: param.lfs
FOTA Filename:


--- Entry #19 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 18
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 458752
Partition Block Count: 32768
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: Kernel
Flash Filename: boot.img
FOTA Filename:


--- Entry #20 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 19
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 491520
Partition Block Count: 32768
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: Kernel2
Flash Filename: recovery.img
FOTA Filename:


--- Entry #21 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 20
Attributes: 5 (Read/Write)
Update Attributes: 5 (FOTA)
Partition Block Size/Offset: 524288
Partition Block Count: 2457600
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: SYSTEM
Flash Filename: system.img
FOTA Filename:


--- Entry #22 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 21
Attributes: 5 (Read/Write)
Update Attributes: 5 (FOTA)
Partition Block Size/Offset: 2981888
Partition Block Count: 1720320
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: CACHEFS
Flash Filename: cache.img
FOTA Filename:


--- Entry #23 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 22
Attributes: 5 (Read/Write)
Update Attributes: 5 (FOTA)
Partition Block Size/Offset: 4702208
Partition Block Count: 655360
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: HIDDEN
Flash Filename: hidden.img
FOTA Filename:


--- Entry #24 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 23
Attributes: 5 (Read/Write)
Update Attributes: 5 (FOTA)
Partition Block Size/Offset: 5357568
Partition Block Count: 0
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: DATAFS
Flash Filename: userdata.img
FOTA Filename: remained

Ending session...
Rebooting device...
Releasing device interface...

Sometimes you might bump into issues where the command line returns an error like “ERROR: Failed to receive handshake response. Result: -7“. To resolve this issue simply repeat the command or reboot your device into download mode once again.

When flashing has completed we should reboot the phone into recovery mode. You can do this by powering up your S3 Mini and holding the power + Volume Up + Menu buttons at the same time.

enter_recovery_mode_on_Galaxy_S3

booting Samsung Galaxy S3 Mini into “recovery” mode

Note that you should make sure to reboot into recovery directly after flashing TWRP. If for some reason your smartphone would have booted into normal mode again instead of recovery, the boot subsystem might have a protection system which restores the default recovery image into the recovery partition in place of our custom TWRP recovery image.

Once TWRP recovery is loaded you’ll be presented with following user interface:

1419274212077

TWRP recovery graphical interface

Before actually flashing Cyanogemod on your device it is best to make a backup. You can do this though the Backup button. Once this had completed you should perform a factory reset. This will wipe data, cache and dalvik cache. It can be done by using the Wipe button, next chose Factory Reset. To install Cyanogemod hit the Install button and select the cmXXX.zip file from you external storage device (SD-card). This process might take a while. Once this has completed redo the same process but this time install the gapps zip file that we also copied to the SD-card. Once installation has finished, return to the main menu and select Reboot, then System. The device will now boot into CyanogenMod 12.1 (Lollipop). The first boot into CM12 might take an addition large amount of time as some software still needs be installed automatically in the background. Before actually entering the Android main screen the Google’s setup wizard will also ask you for your google account and so on. Once you’ve completed the wizard the Android main menu will arise and you can go on using Android Lollipop on your Samsung Galaxy S3 Mini!

Screenshot_2015-03-25-18-04-36-338x600

CyanogenMod 12.1 for Samsung Galaxy S3 Mini

Java 8 benchmarking on ARM and x86

In a previous test I saw already that Java 8 might bring some big improvements for ARM devices compared with previous Java versions. Now with newer versions available for both Java 7 and 8 I found it useful to redo these test and check if the same performance gain applies for x86 machines. Here are the results:

Afbeelding

x86

On ARM devices we can see that the newer builds for both Java 7 (OpenJDK) and 8 (Oracle) do not bring more performance compared to previous Java builds. On the other hand it confirms once again that Java 8 has some nice performance tweaks on board and lets hope these tweaks also find their way in the release build.

For x86 (32-bit) however there is no difference in performance when using Java 8. However, code-wise, Java 8 off course brings some new features, but that’s not the focus of these tests.

Some movement

I won’t quit the blog, it’s a nice and easy to use portal and it might someday contain usefull information (working on that!!). However as I’m no longer student in Porto (which was tremendously fun!!) I see no longer the need keep the Erasmusitis in Porto blog name and so that’s why I decided to change the blog into the current on, No Fab Lab, which is exactly what I am: not a fab lab. I will however continue to mess around with small electronics, embedded devices and programming, so stay tuned for more.

Oh, and life is not so bad back at home, I love Belgium too, not only Portugal 😉