Wednesday, August 20, 2014

Raspberry Pi for beginner - Part 2: hardware

Here is the second part where I share my experience with Raspberry Pi.

I received everything ! I order the Raspberry Pi on Amazon Saturday, and I received it the next day ! Pleasantly surprised!
About the case, it took less than a week (shipped from the UK).

Here is the pictures of everything.



You will notice something that I didn't mention in the first part. I bought a USB switch. It's not that expensive and I think it is more friendly user and less risk to break the connector than unplugging the cable every time.

I was really surprised by the size of the Raspberry Pi. It's really small.

I will not create a post to explain how to plug the Raspberry Pi, because it's really easy. However, my next post will be about the setup of the micro SD card and how to install the OS.

Tuesday, August 19, 2014

Install Java on System Z Linux S390 Suse 10

Installing Java on System Z Linux is easy if you know which file to download.

More information about my machine:
# cat /etc/*release*
SUSE Linux Enterprise Server 10 (s390x)
VERSION = 10
PATCHLEVEL = 4
LSB_VERSION="core-2.0-noarch:core-3.0-noarch:core-2.0-s390x:core-3.0-s390x"
If you look at the Oracle Website to download Java for S390 system, you won't find anything.
After a quick search on Google, I could find this IBM website with all the files. But:
Before you can download, you will need an IBM Registration ID

I guess if you are using System Z, then you have an account.
Cool, so I download Java 7: 64-bit System z
And select the following file:
tgz package (InstallAnywhere)
ibm-java-sdk-7.1-1.1-s390x-archive.bin  (123 MB)

Then on the machine:
# chmod +x ibm-java-sdk-7.1-1.1-s390x-archive.bin
# ./ibm-java-sdk-7.1-1.1-s390x-archive.bin

Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...

Launching installer...

Floating point exception

Ouch... it failed. I tried with the 32-bit version, but same result. And same result with the other file:
Installable package (InstallAnywhere)
ibm-java-s390x-sdk-7.1-1.1.bin (123 MB)

Ok, so let's try with Java 6: 32-bit System z
And select the following file:
tgz package (InstallAnywhere)
ibm-java-sdk-6.0-16.1-linux-s390.bin  (85 MB)

Then on the machine:
# chmod +x ibm-java-sdk-6.0-16.1-linux-s390.bin
# ./ibm-java-sdk-6.0-16.1-linux-s390.bin 

Choose Locale... 
Press  many times to skip the license agreement
DO YOU ACCEPT THE TERMS OF THIS LICENSE AGREEMENT? (Y/N): Y


Choose install folder:
 /opt/java/ibm-java-s390-60
 
Valid and wait for the installation to finish.
 
Installation Complete
---------------------

Congratulations. IBM 31-bit Linux SDK for Java v6 has been successfully
installed to:

  /opt/java/ibm-java-s390-60
Nice !
Now you can add Java to the path:
export JAVA_HOME=/opt/java/ibm-java-s390-60
export PATH=$JAVA_HOME/bin:$PATH

And finally:
java -version
java version "1.6.0"

Of course you can follow the same steps with Java 6 64-bit.
I'm wondering why Java 7 is not compatible. Maybe I'm missing a package? Maybe SUSE 10 is "old"?

Monday, August 11, 2014

Raspberry Pi - Amazon Japan error

Please be careful if you are using Amazon Japan and want to buy a Raspberry Pi !

Have a look at the following screenshot
Don't you see anything wrong?
Hint: memory card

The Raspberry Pi B+ is using a micro SD card !Don't do the mistake to buy a regular size SD card.
Only older models of the Raspberry Pi are using a regular size SD card.

I guess some customers were disappointed when they received their package.
Don't always trust Amazon suggestion ;)

I check on Amazon US and Amazon France, and the suggestions are different, so there is no problem.

Sunday, August 10, 2014

Raspberry Pi for beginner - Part 1: buy

Here I will talk about my project to setup a Raspberry pi.
I'm myself a beginner, and I hope these posts about my project will help other people.

My goal

  • use Raspberry Pi as a media center
  • control XBMC with my Android phone or Android tablet

 What is a Raspberry Pi?

The Raspberry Pi is an index card-sized single-board computer developed in the UK by the Raspberry Pi Foundation with the intention of promoting the teaching of basic computer science in schools. (Wikipedia)

What do I need?

  • raspberry Pi B+
  • power supply
  • micro SD card
  • case
  • wifi dongle
  • HDMI cable 
  • external hard drive

How to get everything?

  • raspberry Pi
After a quick search on the forum, many people recommend Amazon.  And yes, I could find one on Amazon Japan for 5400yen.
  • power supply
I don't need to buy one now, I will use my Nexus 5 USB cable. It delivers 5V, 1.2A, and that should be enough.
Please take the time to read this FAQ to know how much power you need.
  • micro SD card
For 1140yen, there is one on Amazon Japan. I choose 16GB, which is kind of big, because I will use a external hard drive. The price is not so high anymore, so why not. If you read this thread, someone said that "the Pi is always in non-UHS mode".
  • case
I saw some nice case here: http://shop.pimoroni.com/products/b-ninja-pibow
On Amazon Japan they cost 4600yen! Original price is 12.95GBP -> 2200yen.
I can get it ship for 6GBP. So total is 18.95GBP -> 3200yen.
  • wifi dongle
From Buffalo WLI-UC-GNM2. On Amazon as well for 922yen. I saw on the Web, a Japanese guy using this one for his Raspberry Pi.
For a complete list, have a look here.
  • HDMI cable
I already have a spare one.
  • external hard drive
I already have one LaCie 3TB with its own power supply.

Total

The total for all of that is around 10,600yen excluding the cost of an external hard drive, power supply and hdmi cable.

 In part 2, I will show the pictures once I receive everything !


Wednesday, August 6, 2014

Upgrading to Windows 8.1

On my Dell machine at work, I had no choice to use Windows 8. My plan was to remove Windows and use Ubuntu. And install Windows as a virtual machine. Thanks to Dell, it's not possible...
So I dual boot using grub.

Anyway, because Windows 8 was crashing once a week (especially when the computer was idle), I decided to try Windows 8.1.

The process to upgrade to Windows 8.1 is easy, but you should know that after all files are downloaded, you have 15min max before the computer restart!
Then it takes around 30 - 40min to install everything.

No problem during installation, Windows starts ... and I was not really satisfied...
First thing I noticed is that the language is in Japanese and I can't switch to English... Ok, I will set it to English again, as I did before. Oh surprise! There is no option to download the language pack... Fortunately I could find this thread on the Social Technet forum:
Language Pack not usable message in Windows 8.1

Here is what you should do (in case the link is broken):
Download the new 8.1 MUI:
EN-GB
32Bit: http://fg.v4.download.windowsupdate.com/d/msdownload/update/software/updt/2013/09/lp_43e709fc9932e26431ff87e163daaaeae15677eb.cab
64Bit: http://fg.v4.download.windowsupdate.com/d/msdownload/update/software/updt/2013/09/lp_55c5ff4da1d83ae6f4ebd1f8c020cb80ceda7da8.cab
EN-US
32Bit: http://fg.v4.download.windowsupdate.com/d/msdownload/update/software/updt/2013/09/lp_45b0cfb6b0bfd5984faa3cd64b7b8f2b2a72465e.cab
64Bit: http://fg.v4.download.windowsupdate.com/d/msdownload/update/software/updt/2013/09/lp_8fa033dd9ab61a528192eaa696088d582f112e68.cab
Rename the file to LP.mlc and double click it to install it.



I'm glad it worked!

Good, I can start working, let's connect to the VPN... boom error. I have to re-install OpenVPN.
Ok done. Now let's start VirtaulBox... boom error. I have to re-install VirtualBox.

After 90min, I could start working... (and I didn't fix grub yet...)
Not as smooth as I expected. After 2 days, my PC didn't crash. I hope it will continue to work correctly.

Tuesday, August 5, 2014

Cross-compile GDB for ARM (ARMEL & ARMHF)

Let's say you have:
Machine A: x86, cross-compile for armhf
Machine B: armhf

On Machine A, you create a program. Then you copy the program to Machine B.
On Machine B, you execute the program and boom fatal error, a core is generated.

The question is: on which machine should I use GDB to read the core file?
Answer: Machine A! But you need to install GDB for ARMHF!

Here are the steps (on Machine A):

Download GDB
wget http://ftp.gnu.org/gnu/gdb/gdb-7.8.tar.gz
Extract
gunzip gdb-7.8.tar.gz
tar -xf gdb-7.8.tar
Go to the folder
cd gdb-7.8/
Build GDB 
#ARMHF
./configure --target=arm-linux-gnueabihf --prefix=/usr/arm-linux-gnueabihf CXX="arm-linux-gnueabi-g++"
#ARMEL
./configure --target=arm-linux-gnueabi --prefix=/usr/arm-linux-gnueabi CXX="arm-linux-gnueabi-g++"
make
make install
And that's it.
From Machine B, copy the core file in Machine A, and run this command:
/usr/arm-linux-gnueabihf/arm-linux-gnueabihf-gdb myProgram core

And that's it.


Note: I'm not sure if you really need to specify CXX when building GDB.

Saturday, August 2, 2014

Steps to develop Android applications

So I think the way to setup everything and to be able to develop and run an app are not friendly user at all.

Just last week, I met a guy who is interested in Android. He downloaded the ADT plugin with eclipse. Everything looks good, he created a new application based on the "blank activity". Then he hit run and boom error... How to demotive new people to start coding app for Android...
I think I had a similar problem with a "fullscreen activity".


Anyway, here are the list of steps that I should remember when changing VM:

- if it's a 64-bit VM, don't forget that Android architecture is ARM 32-bits, so you should install 32-bits libraries!
sudo apt-get install libc6:i386 libstdc++6:i386
sudo apt-get install lib32z1

- you will need Java:
sudo apt-get install openjdk-7-jdk

- Setting up a Device for Development
http://developer.android.com/tools/device.html
sudo vi /etc/udev/rules.d/51-android.rules
#Samsung 
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666", GROUP="plugdev"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1104", MODE="0666", GROUP="plugdev"

sudo chmod a+r /etc/udev/rules.d/51-android.rules

For VirtualBox:
- install the Guest Additions
- add a shared folder so it's easy to copy from file between host and guest
- add your user to the group vboxsf to be able to access the share folder:
sudo usermod -a -G vboxsf alex
- in the VB settings of the VM, go to USB and add your device! So the VM will capture the device.
- install GIT
sudo apt-get install git

You can install Eclipse IDE with built-in ADT
http://developer.android.com/sdk/index.html
And go to: Window-> Preferences -> Android -> DDMS -> ADB Connection Timeout (ms)
And set it to 10000 (if you leave it to 5000, you  may see some timeout)

Friday, August 1, 2014

Debian hangs at “Select and Install Software”

Recently, I wanted to use Debian 5.0.3 Lenny (for work).

The first step was to find the ISO.
I couldn't find it on the Debian website. Fortunately I could find it on these both sites: http://www.debiantutorials.com/download-debian-iso/
 http://cdimage.debian.org/mirror/cdimage/archive/5.0.3/i386/iso-cd/

After downloading the file debian-503-i386-netinst.iso (~150Mo), I'm ready to create a VM using VirtualBox.

The installation is easy but it freezes at the screen "Select and Install Software".

The way to solve this is the following:
  • start a new installation 
  • just before 'Select and install software.' I could see a popup about a warning. Press alt+F2 
  • press enter to activate the console 
  • run the command to place you into the system you are installing
    chroot /target
  • run the command to install the keyring
    aptitude install debian-archive-keyring
  • run the command
    aptitude update
  • run the 3 following commands
    gpg --keyserver pgp.mit.edu --recv-keys 6070D3A1
    gpg --armor --export 6070D3A1 | apt-key add -
    apt-get update
    
  • press alt+F1 to go back to the installer 
  • continue the installation as normal to the end 

And that's it !


Here is a quick link in case you want to cross compile:
http://wiki.micromint.com/index.php/Debian_ARM_Cross-compile

source: http://forums.debian.net/viewtopic.php?t=12259