Intel Galileo 2 FTDI cable serial connection tutorial on Mac OS X

First of all, you will need

  • Intel Galileo 2 (Linux installed)
  • FTDI  TTL-232R cable

Step 1.

Install FTDI VCP driver from here

Step 2.

Reboot your computer

Step 3.

Connect FTDI Cable to your computer

Step 4.


ls /dev/tty.*

You should now see


Step 5.

screen /dev/tty.usbserial-XXXXXXXX 115200 -L


Step 6.

If you see blank, press Enter twice.

Then you will see the login request.

Step 7.

Login as root

Step 8.

You are now connected to Intel Galileo 2.



With Mac OS 10.9 (Mavericks) and later, Apple has built their own version of the FTDI VCP driver into the operating system (AN134). However, there seems to be some conflict between drivers from and the ones inherent to Apple. Luckily, there is a solution to this problem, and it comes from FTDI directly.

If you have that issues, solution is referred to this site:



Fukui Dinosaur museum 福井県恐竜博物館

Fukui Dinosaur museum is one of the three biggest dinosaur museums in the world along with Royal Tyrrell museum and Zigong museum. In the early 1900s, people did not believe that dinosaur existed in Japan until 1986. A high school girl found a tooth in Fukui which had been identified as a dinosaur tooth later. After the discovery, more research had begun  and more discoveries had been found. Seven new species has been discovered, including Fukuiraptor, Fukuisaurus, Fukuititan, and Fukuivenator. The museum was built in 2000. Its shape looks like an egg. However, it was designed as it required a huge space to display dinosaurs fossils. To make the space look better, they did not want to have any pillars near the dinosaurs. The main hall is divided in two sections, one is most for carnivore, and the other is for herbivore.


In the main hall, there are three floors. The basement is main entry, a simple hall way displaying fossils.


On the first floor, the T-rex is brought to life! This vivid t-rex is showing its fury. It is said that dinosaur lays eggs from the excretory organ. IMG_7757.JPG

The bones are used to estimate the dinosaur’s age. It touches like tree. IMG_7758.JPG

Hadrosauridae has crest on its skull. It was used for making sound.


Tarbosaurus’ eyes are not facing in the front unlike Tyrannosaurus Rex.


Tyrannosaurus Rex!! Its skull is the most complicated part of all exhibited dinosaurs.


Fukuiraptor. It is said that the color of dinosaur is hard to define. We can only predict it.




How do we know it is a dinosaur?  Dinosaur was evolved from Archosauria. A dinosaur’s skull has a large opening in the front of eye socket. Dinosaur can stand with their legs straight. Their tooth has its own socket. People misunderstand dinosaur. Pterosaur, Ichthyosaur, MosasauridaePelycosauria are not dinosaur! Is all dinosaur cold-blooded? No! Some are ware-blooded.


A view from second floor. It is just amazing to see so many huge dinosaur walking around! It reminded me “Night at museum”. The T-Rex was chasing Ben Stiller.


Taking photos of these 30m dinosaur is so difficult!


A series pf elongate dorsal neural spines form a “sail”, which might have been used for thermoregulation or visual identity.


One of my favorite! Albertaceratops is so cute, isn’t?


This dinosaur museum is located 4 hours by train from Osaka. I recommend to stay a night before visiting the museum. In the next morning, go to take the earlier train from Fukui station to Katsuyama station. It takes almost an hour. Once arriving the station, you will need to take a bus from station! It is a long way trip. However, the dinosaur won’t let you down!! It totally worths it! By the way, you can buy a ticket combo from Fukui station, which includes the tickets of train, museum, and bus, around 2000 Yen.


IBM Bluemix MobileFirst Services Starter for Cordova Tutorial 教學

Create an account on
Search the template: MobileFirst Services Starter, and create it.
螢幕快照 2016-06-04 11.22.21

After that, download the source code from

Before installing Cordova, you will require node.js which is downloaded from

If you do not have Cordova installed, then type

npm install -g cordova

Update Cordova

sudo npm update -g cordova

Go to the directory of source code, add cordova platform

cordova platform add android
cordova platform add ios

Install the IBM Bluemix plugin
cordova plugin add ibm-mfp-core

Go to /project-dir/www/js/index.js, paste your route & GUID
route: https://your-proj-name/
GUID: can be found in the first line of Cloud Foundry’s log in the panel

route: ""
GUID: ""

Open xcodeproj in /project-dir/platform/ios/
If it prompts to update latest swift version, cancel it.
Go to build settings tab and edit Objective-C Bridging Header
Find Runpath search Path, and add

Build Cordova
cordova build
Then run
cordova run android

Run iOS platform on Xcode

Cloud Foundry

Install CF CLI from

Install Bluemix CLI from

If this error occurs

panic: Config error: open config.json: permission denied


sudo chmod -R 777 ~/.cf

If this error occurs

panic: no supported languages found []string{“zh_TW.UTF-8”}

go to ~/.cf/config.json

set “Local” : “zh-Hant”

Download your project source code

螢幕快照 2016-06-04 12.11.58

go to /proj-dir , type

bluemix login -a

push your project

cf your-project-name

Now you are ready to build your own project.

ASO 阿蘇 Helicopter Tour in カドリー・ドミニオン

I always like to go to countryside to see the beauty of the Earth. I dreamed to appreciate it while flying in sky as a bird. At this time, as soon as I heard there was a helicopter tour around ASO mountain I couldn’t hide the excitement. All I wanted to do was take the ride and experience the splendid nature in sky.

First, the helicopter tour is located in Cuddly Dominion. Map
This is a zoo with over 2 hundreds bears as Showanshinzan Kumabokujo in Hokkaido. Tourists can feed bears with toast, bear food, and chicken (Only for brown bears).

Brown Bears pleasing for food
Japanese black bears

This slideshow requires JavaScript.

This slideshow requires JavaScript.


mini tour: 2 minutes. Adult ¥2900, Child ¥2500

米塚 tour: 4 minutes. Includes mountain. Adult ¥4800, Child ¥4500

volcano tour: 7 minutes. Includes volcano. Adult ¥7500, Child ¥7000

super tour: 10 minutes. Includes mountains, grassland, volcano. Adult ¥12500, Child ¥11500


jQuery DataTables plugin with PHP and MS SQL

I hereby provided the code for server-side processing for PHP and MS SQL.

The environment I used was PHP 5.5 and MS SQL 2008

Since PHP 5.5 no longer supports mssql extension, hence, I used sqlsrv extension instead on Window.

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Easy set variables
/* Array of database columns which should be read and sent back to DataTables. Use a space where
* you want to insert a non-database field (for example a counter or static image)
// add your columns here!!!
$aColumns = array( 'columnName1', 'columnName2' );
/* MSSQL Database infomation */
$host = 'localhost';
$connectionInfo = array("Database"=>"yourdb", "UID"=>"yourUser", "PWD"=>"yourPassword", "CharacterSet"=>"UTF-8");
$conn = sqlsrv_connect($host,$connectionInfo);
 //echo "Connection Established";
 echo "Connection could not be Established";
 die ( 'Can not connect to server' );
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "id";
/* DB table to use */
$sTable = "Your Table";
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If you just want to use the basic configuration for DataTables with PHP server-side, there is
* no need to edit below this line
* Local functions
function fatal_error ( $sErrorMessage = '' )
header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' );
die( $sErrorMessage );
/* Ordering */
$sOrder = "";
if ( isset( $_POST['order'] ) )
 $sOrder = "ORDER BY ";
 if ( $_POST['columns'][0]['orderable'] == "true" )
 $sOrder .= "".$aColumns[ intval( $_POST['order'][0]['column'] ) ]." ".
 ($_POST['order'][0]['dir']==='asc' ? 'asc' : 'desc');
/* escape function */
function mssql_escape($data) {
return $data;
$unpacked = unpack('H*hex', $data);
return '0x' . $unpacked['hex'];
/* Filtering */
$sWhere = "";
if ( isset($_POST['search']['value']) && $_POST['search']['value'] != "" ) {
$sWhere = "WHERE (";
for ( $i=0 ; $i<count($aColumns) ; $i++ ) {
$sWhere .= $aColumns[$i]." LIKE '%".addslashes( $_POST['search']['value'] )."%' OR ";
$sWhere = substr_replace( $sWhere, "", -3 );
$sWhere .= ')';
/* Individual column filtering */
for ( $i=0 ; $i<count($aColumns) ; $i++ ) {
if ( isset($_POST['columns'][$i]) && $_POST['columns'][$i]['searchable'] == "true" && $_POST['columns'][$i]['search']['value'] != '' ) {
if ( $sWhere == "" ) {
$sWhere = "WHERE ";
} else {
$sWhere .= " AND ";
$sWhere .= $aColumns[$i]." LIKE '%".addslashes($_POST['columns'][$i]['search']['value'])."%' ";
/* Paging */
$top = (isset($_POST['start']))?((int)$_POST['start']):0 ;
$limit = (isset($_POST['length']))?((int)$_POST['length'] ):5;
$sQuery = "SELECT TOP $limit ".implode(",",$aColumns)."
FROM $sTable
$sWhere ".(($sWhere=="")?" WHERE ":" AND ")." $sIndexColumn NOT IN
SELECT TOP $top $sIndexColumn FROM
$sTable $sOrder
$rResult = sqlsrv_query($conn, $sQuery);
if($rResult === false){
/* Data set length after filtering */
$sQueryCnt = "SELECT * FROM $sTable $sWhere";
$rResultCnt = sqlsrv_query($conn, $sQueryCnt );
$iFilteredTotal = sqlsrv_num_rows( $rResultCnt );
/* Total data set length */
$sQuery = "
FROM $sTable
$rResultTotal = sqlsrv_query($conn, $sQuery );
$aResultTotal = sqlsrv_fetch_array($rResultTotal, SQLSRV_FETCH_NUMERIC);

$iTotal = $aResultTotal[0];
/* Output */
$output = array(
"draw" => intval($_POST['draw']),
"recordsTotal" => $iTotal,
"recordsFiltered" => $iFilteredTotal,
"data" => array()
while ( $aRow = sqlsrv_fetch_array( $rResult, SQLSRV_FETCH_ASSOC) )
 $row = array();
 for ( $i=0 ; $i<count($aColumns) ; $i++ )
 /* General output */
 $row[$aColumns[$i]] = $aRow[ $aColumns[$i] ];
 $output['data'][] = $row;
echo json_encode( $output );


Intel Galileo 2 with USB WiFi Dongle (RT3070)

The WiFi dongle I am using here is Edimax EW-7711UMn

Here I will talk about how to use it on Intel Galileo 2


Install Linux on Intel Galileo 2

Establish communication through terminal

Step 1.

This USB Wifi dongle is supported by Intel Galileo 2, so we don’t need to install driver.

Just plugin it on the board.

$ iwconfig

Find the dongle identifier as “wlp0s20f3u1”

螢幕快照 2015-10-11 21.00.31

The example here is based on WPA WiFi Router

killall wpa_supplicant
ifconfig wlp0s20f3u1 up
wpa_passphrase "YOUR ESSID" "YOUR PASSWORD" > /tmp/wpa.conf 
wpa_supplicant -BDwext -i YOURWIFIIDENTIFIER -c/tmp/wpa.conf

Then you will see “Successfully initialized wpa_supplicant”

If it appears “ifconfig: SIOCSIFFLAGS: Operation not possible due to RF-kill”, when you are entering “ifconfig wlp0s20f3u1 up”.

rfkill unblock all

You can scan to search nearby SSID


Make a file “” in /etc as below code

# udhcpc script edited by Tim Riker <>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1

[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"

case "$1" in
    /sbin/ifconfig $interface

    /sbin/ifconfig $interface $ip $BROADCAST $NETMASK

    if [ -n "$router" ] ; then
      echo "deleting routers"
      while route del default gw dev $interface ; do

      for i in $router ; do
        route add default gw $i dev $interface

   echo -n > $RESOLV_CONF
    [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
    for i in $dns ; do
     echo adding dns $i
      echo nameserver $i >> $RESOLV_CONF
exit 0

Then run

udhcpc -i YOURWIFIIDENTIFIER -p /var/run/ -S -s /etc/

You will see like this

螢幕快照 2015-10-11 21.15.59

It works now!!

Intel Galileo 2 Linux installation

This tutorial is about how to running Linux on Intel Galileo 2 without FTDI to USB Converter.

In the end, we will be able to develop APP on Intel XDK

Instead of FTDI converter, we use wired connection to a DHCP enabled router.


  • Intel Galileo 2
  • micro USB to USB converter
  • micro SD card (above 2 GB)
  • RJ45 ethernet cable

Step 1.

prepare micro SD card

download the latest image file from and extract it

format your memory card as MS-DOT (FAT) format

using shell command to unmount the card

diskutil unmountDisk disk3s

replace “disk3s” from your own disk Identifier which you can find in Disk

using shell command to install the image file

sudo dd bs=8m of=/dev/disk3s

replace “disk3s” as before

This may take serval minutes.

Step 2.

insert the micro SD on Galileo 2

connect the ethernet cable and the usb cable to your DHCP router and your computer respectively.

power it up.

Open Arduino APP on your computer
using the below code to detect your network status

 void setup() {
 //It’ll not continue until you send an ‘a’ through the serial monitor
 //Display ifconfig result to serial monitor
 system("ifconfig > /dev/ttyGS0");
 void loop() {

Upload it, and open Serial Monitor in Arduino APP.

send a string “a”

螢幕快照 2015-10-11 13.38.28

You can find your IP Address as

Step 3.

use the below shell script in Terminal

 ssh root@ 

It will ask you “Are you sure you want to continue connecting (yes/no)? yes”
Then you can use this script to check your IoT develop kit version

  cat /etc/version 

Step 4.

Install Intel XDK on your computer

create a template using OnBoardLED

螢幕快照 2015-10-11 13.49.31

At the drop down list – select a device.

add manual connection

Address as the IP address you got

and the user name is root

Press the button Install/Build (The second button near the drop down list)

and press the button run (The fourth button from left)

You will be able to see the LED on board blinking