Graphical interface for OSMO-NITB GSM Network –, node.js, shell scripts

I created a simple GUI for the OSMO-NITB software using the USRP1, a software defined radio (SDR) card.  This SDR along with OSMO-NITB allows users to create a GSM network: connecting cellphones, phone calls and text messages.

The OSMO-NITB runs through the terminal but I created a simple interface to turn on the 3 sections of Osmocom software needed to run the GSM network.

For more information on installing OSMO-NITB:



Prerequisites: Ubuntu 12.04.05

Computer used: Dell Mini


1. Install node.js

Ubuntu 12.04.05 does not have the latestapt-get repo for node.js.  So I did the following:

apt-get install python-software-properties
apt-add-repository ppa:chris-lea/node.js
apt-get update

This installs the Chris Lea Repo which has the right node.js repo.

Using Launchpad repo by Chris Lea just run following commandsnode.js install

apt-get install nodejs

Check node.js version

node -v



npm install

Above command should install npm.Check npm version

npm -v



If for some reason, if you see npm is not installed, you may try running:

apt-get install npm


above from

Latest node.js & npm installation on Ubuntu 12.04


2. Setup


First let’s create a package.json manifest file that describes our project. I recommend you place it in a dedicated empty directory (I’ll call mine Osmo-Gui).

  "name": "Osmo-Gui",
  "version": "0.0.1",
  "description": "my first GUI app",
  "dependencies": {}

Now, in order to easily populate the dependencies with the things we need, we’ll use npm install --save:

npm install --save express@4.10.2

Now that express is installed we can create an index.js file that will setup our application.


npm install --save


3. Make SH bash scripts

write bash (.sh) scripts which will run the appropriate command to start Osmocom software.

– these scripts are also available in github:
dit .cfg files to for your particular Osmocom installation


For my particular installation the commands needed are:

$ sudo osmo-trx
$ sudo osmobts-trx -c /home/xdell0/gsm/osmo-bts_OSMOSITE.cfg
$ sudo osmo-nitb -c /home/xdell0/gsm/open-bsc-OSMOSITE.cfg


The bash scripts are:

#!/usr/bin/env bash
gnome-terminal -e "bash -c \"osmo-trx; exec bash\""

#!/usr/bin/env bash
gnome-terminal -e "bash -c \"sudo osmo-nitb -c /home/xdell0/gsm/open-bsc-OSMOSITE.cfg
; exec bash\""

#!/usr/bin/env bash
gnome-terminal -e "bash -c \"sudo osmobts-trx -c /home/xdell0/gsm/osmo-bts_OSMOSITE.cfg; exec bash\""


4. Make .sh scripts executable 

You must make sh executable script.

$ sudo chmod 700 location/of/


5. Edit Index.html and index .js file

Express automatically sets up a index.html and index.js file. Both files need to be changed for your specific needs.  For the index.html I used a table and radio buttons to execute the bash scripts.


see code:



var app = require('express')();
var http = require('http').Server(app);
var io = require('')(http);
//run shell script
var sys = require('sys')
var exec = require('child_process').exec;

app.get('/', function(req, res){

io.on('connection', function(socket){

    socket.on('Cmessage', function(msg){
    io.emit('Cmessage', msg);
    console.log('message: ' + msg);
//Mesage shell script
	function puts(error, stdout, stderr) {sys.puts(stdout)}
    exec("./", puts);

    socket.on('TurnOnTRX', function(msg){
    io.emit('TurnOnTRX', msg);
    console.log('TRX: ON');
//TRX shell script
	function puts(error, stdout, stderr) {sys.puts(stdout)}
    exec("./", puts);

    socket.on('TurnOnBTS', function(msg){
    io.emit('TurnOnBTS', msg);
    console.log("BTS is On");
//BTS shell script
    function puts(error, stdout, stderr) {sys.puts(stdout)}
    exec("./", puts)

    socket.on('TurnOnBSC', function(msg){
    io.emit('TurnOnBSC', msg);
    console.log('BSC: ON');
//BSC shell script
  function puts(error, stdout, stderr) {sys.puts(stdout)}
    exec("./", puts);

http.listen(3000, function(){
  console.log('listening on *:3000');


 6. Run index.js 

From the terminal, and within the directory run index.js.


7. Open Browser and go to localhost:3000

Now you should see the web GUI and can turn on each step of the Osmocom process.