Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Blog In A Box

Blog In A Box for WordPress comes as two parts:

WordPress Plugin

The plugin may be found in the companion repository and it is installed as per a normal WordPress plugin.

CLI Utility Manual Installation

This repository contains the CLI tools, which should be installed in the following location (default, but can be changed):


sudo access must be given to the www-data user so that PHP can call these tools. To do this:

sudo visudo

And add this line:

www-data ALL=(pi:pi) NOPASSWD: /opt/bloginabox/biab

The WordPress plugin will then have access to the /opt/bloginabox/biab CLI tool, and from here can trigger and receive data from hardware devices.

Note: this is done automatically when using Blog In A Box Installer.

CLI Utility

The web server can interface with devices through a single executable:


This can also be called from the command line or via any external tool.

The executable loads up a series of device handlers that listen for commands and perform actions. For example:

./biab camera-take-photo

This triggers the camera module to take a picture and can optionally trigger the SenseHAT to display an image.

Developing a device handler

Device handlers are added in the devices directory, and should be loaded in devices/index.js.

Each device should export a single entry function that accepts an EventEmitter. The device handler can listen to events on this emitter:

module.exports = function( emitter ) {
	emitter.on( 'do-something', function( args ) {
		console.log( 'Received do-something command with ' + args );
	} );

This will be triggered with:

./biab do-something some-data

The listener can perform whatever functions it needs to achieve the desired effect. If the handler should return data to the caller then it can finish with:

this.emit( 'result', 'data-to-be-returned' );

The utility is run as the pi user, and has access to all devices that this user can access.


To debug problems edit biab and set and change the debug lines:


When you want to disable the debug mode then set it back to:


While enable a log of all actions will be output to biab.log:

biab:main Command: "sensehat-capture" with data ""
biab:sensehat:capture Capturing data: /usr/bin/python /opt/bloginabox/devices/sensehat/
biab:sensehat:capture Data captured - temp=25.04471492767334 humidity=52.390140533447266 pressure=1019.79345703125 tp=25.089582443237305 th=24.999847412109375

This may be helpful in figuring out where a problem is.


We welcome contributions in any form, and you can help reporting, testing, and detailing bugs.


The Blog In A Box theme is licensed under GNU General Public License v2 (or later).


Blog In A Box CLI








No releases published


No packages published