hcitool lescan Timeout

As you might have noticed the “hcitool lescan” command doesn’t have a timeout argument. This limitation makes the Bluetooth Low Energy scan last forever until a CTRL+C breaks the execution.

To be able to scan for Bluetooth Low Energy devices in range for a given period of time and store the output of the scan in a file I’ve created the following script (lescan.sh):

#!/bin/sh
hciconfig hci0 down
hciconfig hci0 up
hcitool lescan > $2 &
pid=$!
sleep $1
kill -INT $pid
wait $pid

Continue reading “hcitool lescan Timeout”

Installing Your Own Package into OpenWRT By Using ‘menuconfig’

Once you finish successfully building the OpenWRT image following this tutorial you’ll be able to add your own custom packages to the OpenWRT image using the menuconfig tool.

Let’s start by cloning two example Git Repositories I’ve made for this article into the openwrt/package/utils directory

$ cd openwrt/package/utils
$ git clone http://github.com/fpfaffendorf/helloworld-c.git
$ git clone http://github.com/fpfaffendorf/helloworld-python.git

Continue reading “Installing Your Own Package into OpenWRT By Using ‘menuconfig’”

Short Prompt Ubuntu

Set “>” value to PS1 variable to short the prompt,

PS1=">"

http://superuser.com/questions/186743/how-do-i-only-display-the-base-dir-in-my-ubuntu-terminal

Building OpenWRT for Raspberry Pi

In this step by step tutorial I’ll explain how to make the OpenWRT for Raspberry Pi.

In my case I used Oracle VM VirtualBox to virtualize an Ubuntu 14.04 64 bits Operative System. According to OpenWRT Debian Operative Systems are recommended to build the OpenWRT image.

1. Let’s start by installing all necessary tools,

$ sudo apt-get update
$ sudo apt-get install git-core subversion mercurial build-essential libssl-dev libncurses5-dev unzip gawk zlib1g-dev

Continue reading “Building OpenWRT for Raspberry Pi”