Playing with LPC2103 (oldish ARM micro something) and I needed to create binutils for that. Downloaded latest binutils from gnu page.

The config file for compilation of binutils is a bit peculiar since new Xcode is more strict with the code … so. You should start the thing with:

 CFLAGS=’-g -O2 -Wno-error=deprecated-declarations -Wno-error=unused-const-variable -Wno-error=unused-function’ ../configure —prefix=/usr/local/gcc-arm-none-eabi-4_8-2014q2 —target=arm-elf

Mind you that —prefix is path to the installation directory.

node.js with express and handlebars template engine

Follow this procedure:

express <name>

cd <name>

edit package.json and replace “jade”: “~1.3.0” with “express3-handlebars”: “*”

npm install

edit app.js and add

      var exphbs = require(‘express3-handlebars’);

       app.engine(‘handlebars’, exphbs());

create views/index.handlebars e.g.

<h1>{{ title }}</h1>

start the app with: npm start

It automatically starts server on localhost:3000 and gets title variable set up inroutes/index.js (with title: ‘Express’)

Raspberry pi and GSM phone

So I wanted to test if I can make Raspberry pi work with mobile phone. Yeah, I know it is easy since you can use Linux and after that it’s kids play.


I first tried to use Neo Freerunner but the device is powered through the same USB port that is used for communication and since it pulls way too much current R-Pi just went down.

Luckily I still have a Nokia or two in the house and also some USB cables to connect them to the computer.

So I was doing tests with Nokia N70 and here are some pointers and finding:

Calling voice or data

Install wvdial to be super easy (so apt-get install wvdial).

Then I used following things:

[Dialer Defaults]

Init1 = ATZ

Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

Modem Type = USB Modem

Baud = 460800

New PPPD = yes

Modem = /dev/ttyACM0 // use the proper device

ISDN = 0

Phone = <phone number>;

Password = “nothing”

Username = “login”

Be aware of semicolon (;) in the line of phone number. It is there if you want to make voice phone call. For the data call omit it (so no semicolon for data call).

Pay attention to proper device to use in line Modem.

This is for the calling part. Let’s go to SMS now:

To send SMS use following commands:

AT+CMGF=1 (you should get OK as a reply)

AT+CMGS=“<phone number>”

<write SMS message and finish it with <CTRL>+Z

Receiving SMS on the N70 doesn’t work. How do I know?

The command to receive SMS is AT+CNMI, but I get ERROR messages, so be careful if you are buying mobile just for that cause. You can use following syntax:



<all the messages listed>

AT+CMGR=<index of message>


Bluetooth ad hoc network for Raspberry Pi

or any Debian (Linux) device for that matter.

OK, seriously. What I wanted to achieve was create an ad hoc network over Bluetooth with dhcp server running on the Raspberry pi, so I can ssh to the device.

Why Bluetooth? Well I can find 2 reasons out of my head:

1. Bluetooth dongle is way cheaper than Wifi one

2. Just because

So how to do it:

1. You need to install some stuff in Debian. Not sure if you really need everything, but just to be sure (and I plan to add data transfer also):

apt-get install blues-tools bluetooth bluez-utils bluez-compat isc-dhcp-server bridge-utils

2. edit /etc/default/bluetooth and write:



PAND_OPTIONS=’—listen —role NAP —master -p -u /etc/bluetooth/pan/dev-up -o /etc/bluetooth/pan/dev-down —persist’



3. create a directory /etc/bluetooth/pan and create two files there. First one is dev-up:


sleep 5

/usr/sbin/dhcpd -cf /etc/dhcp/dhcpd.conf

and second is dev-down:


fdown bnep0

sleep 2

/etc/init.d/dhcp stop

4. chmod +x both of them (so chmod +x dev-up and chmod +x dev-down)

5. edit /etc/dhcp/dhcpd.conf and write:


log-facility local7;

ddns-update-style interim;

option domain-name “blue”;

option subnet-mask;

 subnet netmask {

  interface bnep0;


  option domain-name-servers;

  option broadcast-address;

  option routers;


6. edit /etc/init.d/bluetooth and add what is bold:

        if test “$HIDD_ENABLED” = 1 ||

                test “$PAND_ENABLED” = 1 || test “$DUND_ENABLED” = 1; then

                log_progress_msg “compatibily daemons not started, see bluez-compat package”

                pand $PAND_OPTIONS

7. edit /etc/default/isc-dhcp-server and add bnep0 interface to get:


8. edit /etc/network/interfaces and add:

auto bnep0

iface bnep0 inet static





        mode ad-hoc

9. edit /etc/rc.local and add following lines to make device visible with pin 0000:

hciconfig hci0 up

bluetooth-agent 0000 &

hciconfig hci0 piscan