Ordroid W Project – David and Boris

ODROID W WATCH

ODROID W WATCH

David Triger, Boris Vaintrub

OCTOBER 8, 2015
UNIVERSITY OF HAIFA
Presented to Dan Feldman

 

 

Contents

What is ODROID. 2

Accessories and Electronic scheme. 3

Hardware Specification &
Video Guide.
4

Installing OS on the odroid. 5

Get the kernel source. 6

Get
a compiler 7

On the
Odroid W (Native Compile)
. 7

Raspbian
and Pi Bang
.. 7

Cross
compiling from Linux
.. 8

Use the provided compiler. 8

Custom-built Linaro GCC.. 8

Perform
the compilation. 8

Transfer
the build. 10

Preparations. 11

Build
and run ODROID-GEAR Qt application on your odroid-w
.. 11

Build
and Run ODROID-GEAR Android application on your android device
.. 12

Android
Code.

ODROID
Code.

Soldering
and power guide.

 

 

 

What is ODROID

ODROID-W

ODROID-W is a miniature computing module which is fully
compatible with all software available for the Raspberry-Pi.

 

The W stands for:

   – Wearable device development

   – Widely applicable Internet of Things (IoT) development

   – Workable DIY electronics prototyping

The ODROID-W measures a very small 60 x 36 x 7mm (2.4 x 1.4
x 0.3”). New features and improvements over the original Raspberry Pi:

– Li+ rechargeable battery charger and fuel gauge for
portables, wearable and robots application

– Real Time Clock to keep accurate time without an Internet
connection by just adding a coin battery

– 12-bit precision ADC to measure the dynamic voltage
signals via two single-ended inputs

– DC/DC step-down converters for higher power efficiency

– DC/DC step-up converter for 5Volt rails (USB host and
HDMI) from a Li-Polymer battery

– USB Host port can be placed on top or bottom as preferred

– DIY friendly 0.1inch/2.54mm pitch IO connector (up to 32
GPIO ports) for handy prototyping

 

ODROID-W = RPI + RTC + ADC + UPS + Battery gauge with
significant Minimalism

 

 

 

List of accessories for the ODROID W

(Marked in red are the ones that we used for this project,
though the others might be just as necessary to complete the final watch)

 

 

Electronic Scheme

 

 

HARDWARE SPECIFICATION

Processor

Broadcom
BCM2835 ARM11 700Mhz

memory

Samsung
4Gbit (512MB) LPDDR2 SDRAM

PMIC

Ricoh
RC5T619 includes DCDCs, LDOs, ADCs, RTC, Battery charger and Fuel gauge

DCDC

TI
TPS61259 is 5Volt step-up DCDC for USB host and HDMI block

Video
Output

HDMI
type-D (Micro-HDMI)

USB

High-speed
USB 2.0 host

GPIO
connectors

RPi
compatible 13×2-pin header on the top side as well as bottom side for 2-way
stacking
20+6 pin header for additional GPIO/ADC/Power/USB connection
Total 32 GPIOs and 2 ADCs are available.

Camera
connector

15pin
MIPI-CSI2 (Pi Camera module compatible)

Memory
card slot

Micro-SD
(T-Flash)

Power

Micro-USB
socket for 5Volt input
Li-Polymer battery connector (Molex 53398-0271)
http://forum.odroid.com/viewtopic.php?f=104&t=6547

RTC
power

Backup
battery connector (Molex 53398-0271)

Dimensions

60
x 36 mm

Weight

8
gram

 

 

 

Smart watch guide video

https://youtu.be/JyL1to-9x_4

 

 

 

 

 

 

 

 

 

 

 

Installing OS on the odroid

1.       Download the correct image from http://www.odroid.in/mirror/dn.odroid.com/ODROID_W/OS_IMG/

2.       Insert the SD card into your SD card reader and check which
drive letter was assigned. You can easily see the drive letter (for example G:)
by looking in the left column of Windows Explorer. You can use the SD Card slot
(if you have one) or a cheap SD adaptor in a USB port.

3.       Download the Win32DiskImager utility from the Sourceforge
Project page http://sourceforge.net/projects/win32diskimager/
 (it is also a zip file); you can run this from a USB drive.

4.       Extract the executable from the zip file and run the
Win32DiskImager utility; you may need to run the utility as administrator.

5.       Select the image file you extracted above.

6.       Select the drive letter of the SD card in the device box. Be
careful to select the correct drive; if you get the wrong one you can destroy
your data on the computer’s hard disk! If you are using an SD card slot in your
computer and can’t see the drive in the Win32DiskImager window, try using a
cheap SD adaptor in a USB port.

7.       Click Write and wait for the write to complete.

8.       Exit the imager and eject the SD card.

 

 

 

 

 

Compiling the kernel

 


The kernel source should be
downloaded from the 
Odroidw-3.12.y
branch of Linux section on GitHub of hardkernel

Create our working directory. (for example, /home/$USER/linux)

mkdir -p /home/$USER/linux

cd /home/$USER/linux

you can download the source directly using Git. for the 3.12
branch:

git init

git clone –depth 1
git://github.com/hardkernel/linux.git

And for the other stable code branch, change the numbers in the following
to suit:

git init

git fetch
git://github.com/hardkernel/linux.git
odroidw-3.12.y:refs/remotes/origin/odroidw-3.12.y

git checkout odroidw-3.12.y

Or you can download a tarball from the same website:


Next, you will need to get a version of GCC in order to build
the kernel.

Raspbian and Pi Bang

 

apt-get update

apt-get -y

dist-upgrade apt-get -y install
gcc make bc screen ncurses-dev


Please note that when cross-compiling, your compiler may not
target the correct ARM processor by default. This will at best reduce
performance, or worse, compile for a much newer processor resulting in illegal
instructions in your code. The pre-built compiler or a custom-built compiler
are recommended because of this. (For example, the latest GCC Linaro binary
targets armv7-a by default, whereas the Raspberry Pi requires armv6kz). It is
possible to add extra compiler options to the HOSTCFLAGS line in Makefile. The
correct flags are shown on the software page – note that you may also need to
add -marm if your compiler produces Thumb code by default.

 

Use the provided compiler

Download the pre-built
bmc2708 compiler from the 
Raspberry
Pi tools section on GitHub.

git clone git://github.com/raspberrypi/tools.git
–depth 1

Or you can download a tarball
from the website using this 
link.

Custom-built Linaro GCC

See Linaro GCC
Compilation.

Ubuntu

apt-get install gcc-arm-linux-gnueabi
make ncurses-dev


Firstly, ensure your build directory is clean:

make mrproper

Next, in all cases, you will want to get a working kernel
configuration to start from. You can get the one running on the Odroid W by
typing the following (on the Odroid W):

zcat /proc/config.gz >
.config

Then copy .config into your build directory.

Alternatively, the default configuration is available in the
downloaded kernel source in arch/arm/configs/odroidw_defconfig. Just copy this
to .config in the build directory.

From this point on, if you are cross-compiling, set an
environment variable CCPREFIX that points to the prefix of your compiler binary
as each compiler will be named slightly differently.

export CCPREFIX=/path/to/your/compiler/binary/prefix-of-binary-

If you are building on the Odroid W, remove ARCH=arm
CROSS_COMPILE=${CCPREFIX} from each command.

Ensure that your configuration file is up-to-date:

make ARCH=arm
CROSS_COMPILE=${CCPREFIX} oldconfig

If any configuration options have been added, you will be asked
what set each option to. If you don’t know the answer, just press enter to
accept the default.

Optionally, if you want to make changes to the configuration,
run this next:

make ARCH=arm
CROSS_COMPILE=${CCPREFIX} menuconfig

Now you are ready to build: (On the Odroid W, type ‘screen’ to
open a virtual screen. If you use it you can disconnect from the Odroid W and
compile overnight…)

make ARCH=arm
CROSS_COMPILE=${CCPREFIX}

If you are on a multi-core system, you can make the build faster
by appending -j<N> where <N> is the number of cores on your system
plus one (that is, -j3 for two cores).

Find something else to get on with while the compilation takes
place. On an average PC with the default configuration, this should take about
15 minutes.

The modules will be build with the following command.

make ARCH=arm
CROSS_COMPILE=${CCPREFIX} modules 

The fully built kernel will be arch/arm/boot/zImage. Copy your
new kernel file(kernel.img) into the Odroid W boot partition, though preferably
as a new file (such as kernel_new.img) just in case it doesn’t work. If you’re
building on the Odroid W, just copy the file to /boot. If you use a different
filename, edit config.txt change the kernel line:

kernel=kernel_new.img

#kernel=kernel.img

Now you need to transfer the modules. Set an environment
variable that points to a temporary module path.

export MODULES_TEMP=~/modules

In the build directory, run the following command:

make ARCH=arm
CROSS_COMPILE=${CCPREFIX} INSTALL_MOD_PATH=${MODULES_TEMP} modules_install

The contents of this directory, a single

lib

directory, should then be copied into the Odroid W root
directory, merging or overwriting

/lib

NOTE: If you have rebuilt the new kernel with exactly the same
version as the one that’s running, you’ll need to remove the old modules first.
Ideally this should be done offline by mounting the uSD card on another system.

NOTE: The lib directory will have symlinks back to the kernel sources
(lib/modules/<kernel-version>/source and
lib/modules/<kernel-version>/build). If you have limited space on the uSD
card and don’t intend to compile modules on the Odroid W itself, you will
probably want to remove those links before you transfer the lib directory. The
size difference can be many hundreds of MB.

Your Odroid W should now be ready to boot the new kernel.

Making of the smart watch

Preparations

§  Odroid W

§  ODROID-W Docking Board (Optional)

§  Li-Polymer Battery pack (Or USB power source, explained later)

§  Bluetooth module

§  Buttons (or USB splitter with mouse & keyboard)

§  Your android device

§  HDMI micro Cable + compatible display

 

Build and run ODROID-GEAR Qt application on
your odroid-w.

Qt
pakage installation.

sudo apt-get install qt4-dev-tools

Get
The ODROID-GEAR Qt source.

git clone https://github.com/hardkernel/ODROID-GEAR

Compiling

cd ODROID-GEAR/Qt_odroidgear
qmake -project

Add
following line in the Qt_odroidgear.pro

QT    += network

Make
it!

qmake
make

Build and Run ODROID-GEAR Android application
on your android device.

How to set up an Android development environment on your
Desktop PC

Java
jdk pakage installation.

sudo apt-get install openjdk-7-jdk

Download Android Studio with the Android SDK. http://developer.android.com/sdk/installing/studio.html

Get
odroid gear android source code.

git clone https://github.com/hardkernel/ODROID-GEAR

Run
Android studio and import Android_odroidgear project in the ODROID-GEAR repo.
Finally, after connected android device, perform “Run app” of IDE menu or
“Shift + F10”

 


 

Android code

The android app (https://github.com/hardkernel/ODROID-GEAR/tree/master/Android_odroidgear 
– it`s suggested that you use android studio, but it`s adaptable to eclipse too)
starts an activity which monitors received calls and messages. When either is
received, the appropriate info is sent to the odroid via wifi or Bluetooth (a
string is sent to the buffer, with letters indicating the data):

Receiver.java

 

 


 

The format of the buffer

SMS Message

n [Address (sender phone number)] e m [SMS content]

Receiver.java (cont.)

For Phone state change (like calls):

n [Incoming Number] e s [STATE]  

 // where state is one of (i,r,o) indicating   IDLE,RINGING,OFFHOOK

ODROID Code

opiwatch.cpp

 


 

We can see how the buffer is treated and which functions are
called according to the buffer received from the android device.

It is important that both the android device and the odroid
are connected to the same network.

Taken from the Receiver.java, here is the address that the
android transmits to:

It is of course modifiable, and it only needs to be
recompiled on the android. You can check the ip address of the odroid with ifconfig
command.

 

With that functionality in hand, you can make any android
application listen and react to any event and send an appropriate message to
the Odroid. On the side of the Odroid, you can change how it reacts to the
buffer it receives, which also gives you control over it.

Reverse messaging (controlling android from odroid) is
possible after appropriate software is written for both of them.

 

Important notes:

Not all the screens work with odroid`s HDMI!

Tested to not to be working:

Samsung desktop display (BX4250)  – screen is flickering

The displays available in university classes which have HDMI
input – not responding at all

Working:

LG TV screen

One of the computer screens in the lab that we`ve been
working at (Jerusalem)

(Probably the odroid original display is going to work too)

 

If the odroid restarts often or is flickering, check that
you supply appropriate voltage. USB from a PC or laptop is usually not
enough. It`s rumored to be working on 3.3V-5V (with 5V not burning anything as
far as we tested), and a regular phone wall charger will suffice.

Soldering and power guide

 

This is a picture of a ready and working odroid – with two
additions:

1.      
USB solder

2.      
Power
input (we used USB on it`s end)

 

The direction of the USB (the order of the pins) can be seen
in the video provided in the early pages

You need the USB to connect a multi-hub with a mouse, wifi
stick, and a keyboard. (optional: Bluetooth module)

 

That`s how it looks in it`s final form

1.      
USB multi hub

2.      
Power cable
(USB)

3.      
Micro HDMI

4.      
Micro SD with
the OS

After that you`re ready to go, there should be no special
setup for any of the modules connected to the USB, maybe just the Bluetooth
one.

 

 

 

Be the first to comment

Leave a Reply

Accessibility
Close Close