Official website

Monday, February 9, 2015

JubitOS for Banana Pi

JubitOS (Jubito Operating System) is a Lubuntu based distribution for Banana Pi and is available for download. It is an out of the box compilation and it contains all the ingredients for a home automation server/hub. A native system that comes with all the dependencies required, plus some extra features that could be useful, like festival speech synthesis system and cmu_us_slt_arctic female voice package. The image is approximately 3.7GB, so, a 4GB SD card and higher is recommended.

Release Notes
JubitOS for Banana Pi (Linux kernel 3.4.103; 2015-02-09)
Default username: jubito (Caution: The user have administrative privileges)
Default password: jubitopi
  • jubito
  • mono-complete
  • festival
  • cmu_us_slt_arctic-0.95-release


Check this post for installation and extra tweaks.
To update Jubito to the latest version, download and replace extracted files to /usr/share/jubito. You can keep your configuration files AppConfig.xml, .htaccess, .scheduler, etc.


Monday, February 2, 2015

Setting up Banana Pi/Lubuntu, running and tweaking

In this post I will describe some things I did to the Banana Pi/Lubuntu in order to match my requirements for a smooth operational Jubito server, as well, fixes on some issues I've been faced.

I'll bypass the installation process on SD card because it's pretty easy.

Step 1:
Resize and expand the partition.
I'm using a 16GB SD card so when I flash the image, which is approximately 3.7GB I end up with an unmanaged partition. To make it available I did the steps that follow...
(*) Do this only right after flashing the image on the SD-Card, so if anything goes wrong you do not lose any data.

sudo fdisk /dev/mmcblk0
  • Press ‘p’ to print the partition table
  • Press 'd' to delete a partition
  • Enter '2' to choose the second partition
  • Press 'n' to create a new partition
  • Enter 'p' to select primary as partition type
  • Partition number: enter to accept 2 as default partition number
  • First sector: enter to accept default
  • Last sector: enter to accept default
  • Press 'w' to write the new partition table
Reboot to force the kernel to recognize the new partition table.

sudo reboot

After the system has come back up you still have to resize the partition.

sudo resize2fs /dev/mmcblk0p2

[ Source: http://gleenders.blogspot.gr/2014/08/banana-pi-resizing-sd-card-root.html ]

Step 2:
Use sudo apt-get update && sudo apt-get upgrade or Menu->System Tools->Software Updater to download the latest patches and updates that fix issues, like Firefox crash.

Step 3:
Change the default username (I), password (II), hostname (III) [ Source: http://banoffeepiserver.com with minor changes ]

(I) Many Linux images have a default username and password. The default username and password for the Raspbian image are 'pi' and 'bananapi' (in many of the Banana Pi Linux distributions, the default username is bananapi). It's best to change these login details so that no one else can log into your Pi.

You need to configure your Pi to boot to a command line - the following procedure won't work if you're logged into a desktop session. Once you've booted to a command line, you need to change the shell session to the root user. This is necessary because you can't modify a user account while you're logged in as that user.

exec sudo -s

Now all commands are executed as the root user. Change to a different directory than /home/bananapi:

cd /

Use the usermod command to change username of the default account.

usermod -l <newname> -d /home/<newname> -m <oldname>

When you reboot, you'll need to log in using the new username. Optionally you can change the group name.

groupmod -n <newgroup> <oldgroup>

Instructions above may damage or cause dis-behaviors. For your convenience, I suggest you to make same actions or create a new user from a controlled environment. That can be easily managed from User Settings under Menu->System Tools->Users and Groups.


(II) One of the most important things to change is the password.  Using the default password is a monumental security risk.  The default password for most Banana Pi Linux distributions is simply bananapi. Change it using the passwd command:

passwd
Changing password for john.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:


You will be prompted to enter your current password, followed by your new password twice.

(III) The hostname is the name of your server as it appears on your local network.  You may need to change the hostname if you have more than one Banana Pi on your network. You'll need to change it in two places:

/etc/hostname
/etc/hosts


The hostname is set in /etc/hostname.  This file only contains the hostname. Open it as root, and change the name.  I've change it from 'lemaker' to 'jubito'.
In /etc/hosts, there's a list of IP addresses and their host names. This file contains a table mapping IP addresses to host names.  Open it with this command:

sudo leafpad /etc/hosts

Look for an entry with IP address 127.0.1.1 lemaker, and change the host name as required.
Reboot your Banana Pi, and you should see that its host name has changed.

Step 4:
I've tried the Banana Pi in various monitors and I noticed that screen resolution doesn't fit automatically. I decided to set it up manually, by disabling the EDID auto-detection. To do so, edit the uEnv.txt file located in a small partition and mounted in Desktop and remove the EDID like this:

disp.screen0_output_mode=EDID:1280x720p50
to
disp.screen0_output_mode=1280x1024p60 (example for a non wide 15" monitor)


Step 5:
Auto login feature is necessary, if you're using Banana Pi as a standalone server with no peripherals (monitor, keyboard, mouse). When its rebooted or reset we need to restore Jubito and x11vnc server (described at Step 6) at startup without user interference. I tried the "Don't ask for password on login" from System Tools->Users and Groups->User Settings without luck. The workaround came with a lightdm hack.

Edit or create a file -if not exists /etc/lightdm/lightdm.conf and add the following content:

[SeatDefaults]
autologin-user=<YOUR USER>
autologin-user-timeout=0
user-session=ubuntu
greeter-session=unity-greeter


Step 6:
Remote desktop using the lightweight x11vnc server.

Install
sudo apt-get install x11vnc

Set password protection

mkdir ~/.x11vnc
x11vnc -storepasswd <YOUR PASSWORD> ~/.x11vnc/passwd

Create a shell script in any directory, for example in /home/<YOUR USER> and call it start-vnc.sh. This will used as x11vnc launcher.
Run leafpad leafpad ~/start-vnc.sh and paste the code below.

#!/bin/sh
x11vnc -forever -display :0 -rfbauth ~/.x11vnc/passwd


Now save and close the file.

Finally add it to LXSession configuration under Autostart tab.
Go to Menu->Preferences->Default applications for LXSession and add the line below...

lxterminal -e bash /home/<YOUR USER>/start-vnc.sh


or do the same by edit the local ~/.config/lxsession/<profile>/autostart file.
At next reboot the x11vnc server will be run.

Step 7:
Since there’s currently no build of the Dropbox sync client that runs on ARM devices and at this time I don't want to spend my time seeking for a solution, I'm going to use  the ownCloud alternative for syncing security breach videos.

Create an account to blaucloud.de and get the free plan that gives 2GB of space and then install the ownCloud client:

sudo apt-get install owncloud-client


Open the program and set your preferences. It's very easy.

I chose this service, because it does its job well. I get set up my own independent cloud-space instance on basis of ownCloud within a few minutes. They are also providing an android app that makes it more comprehensive solution, much like Dropbox.

Step 8:
With most Linux distributions special configuration for USB devices like Arduino are mostly needed, to workaround or fix common issues, when run as a normal non-root user.

First thing is to apply udev rules. To proceed you need to know vendor ID and device ID. Open a terminal and type lsusb to locate your Arduino and keep values in mind (i.e. 2341:0001).


Now create a file /etc/udev/rules.d/99-arduino.rules and paste the lines below where idProduct and idVendor values from the previous step:

SUBSYSTEMS=="usb", ATTRS{idProduct}=="2341", ATTRS{idVendor}=="0001", SYMLINK+="ttyACM%n", MODE="0666", GROUP="dialout"
SUBSYSTEMS=="tty", ATTRS{idProduct}=="2341", ATTRS{idVendor}=="0001", SYMLINK+="ttyACM%n", MODE="0666", GROUP="dialout"


Next you'll need to reload udev's rules so that they are properly applied.  You can restart your machine, or run a command like the following:

sudo reload udev

If the command above fails, try instead running:

sudo udevadm control --reload-rules
sudo udevadm trigger



You can also add yourself to the dialout group (which requires re-login to enable) with...

sudo usermod -a -G dialout $USER

In addition, change the owner of the port.

sudo chown <user>:<group> <file>
e.g.: sudo chown john:john /dev/ttyACM0

Another effective way that worked for me in the past was to change the access permissions.

sudo chmod a+rw /dev/ttyACM0

To take effect in each reboot, you have to edit /etc/rc.local and add the line that works for you (except dialout). Don't forget to follow by exit 0.


I document all the steps I've tried. Probably, not all of them are needed. Try it with your own configuration to ensure what suits you.
That's all for now. I hope to find some of these useful for your setup.
More close to a JubitOS image (?)

Wednesday, January 28, 2015

Testing Jubito in multiple environments

Since the latest version of Jubito, based on jaNET Framework 0.2.5 [ rev. r550 ], was released, I spent some time, by doing tests in multiple environments. I focused on single board computers, such as Raspberry Pi and Banana Pi, both with Rasbian and Lubuntu flavors. To my surprise, the installation and migration was flawless! Actually, it was expected, but I didn't have the chance to give a try till I bought them.

So, the evolution came with a new Jubito Home Server, passing from my old netbook Dell mini 9, to a Raspberry Pi and finally to a Banana Pi.

Let's take a look at some pictures from various tests.

Dell mini 9 (Ubuntu)


Hosted on upper kitchen cabinets

Asus eee (Linux Lite)


Mac (OS X Yosemite)


Raspberry Pi (Raspbian)



Banana Pi (Lubuntu)


Migration process...


Banana Pi + Arduino Uno + Various modules
Stress tests, power consumption tests (*), cpu and memory load tests.
(*) Arduino needs external supply 9V. If not, then with some open tabs on Firefox or other load Banana turns off.


The outcome!
Playing with Banana Pi for three weeks, I believe is a good deal and I recommend it.
Current compilation is consisted with the Banana Pi as my Jubito Home Server and the Arduino, plus various sensor modules for environment control.
Now, it's time to become invisible and be placed in its natural location, the upper kitchen cabinets.


The release of the updated version comes with Mac OS X support, including TTS. In most cases, you probably have noticed that I used the command-line interface, because it's more straightforward to me and also it runs natively, with no extra dependencies that wouldn’t already be available on each platform. [ Download page ]

What's next?
Hopefully to find the time for myself to build and provide Raspbian and Lubuntu images with Jubito Server installed and ready to run out of the box [Update: http://jubitoblog.blogspot.gr/2015/02/jubitos-for-banana-pi.html].

There's more to come but in time.

Saturday, January 24, 2015

2014/15 Internet of Things Awards

Jubito had been nominated in "Technical Enabler: Application Enablement" category for the 4th Annual IoT Awards hosted by Postscapes.com.
Technical Enabler: Application Enablement
Well-designed technology may be indistinguishable from magic, but that belies all the hard work and creativity that went on under the hood. The Technical Enabler awards acknowledge the elements that make it easier for everyone, from garage hobbyists to tech giants, to develop new products and services for the Internet of Things.
It gets the first place in "People's Choice Winner" category. So, there is not much to say...

Thank you!

See Technical Enabler: Application Enablement winners

Tuesday, December 30, 2014

Leaving 2014...

As a token of my appreciation, you'll be entered into a drawing for a jReCo (Jubito Remote Control) once you...


What you'll get is an Arduino Nano, RF Receiver + Transmitter modules, soldered, with full support and software implementation as seen in this tutorial.

I select this project because it was my first flirt with Arduino and because everybody, or almost everybody start with controlling lights, which is a good starting point for home automation.

So, from back then, with a little bit of research, I ended up from this...


to that...


I hope to find it as amusing as I, and give you a boost of encouragement to start developing your own "things".

This "contest" will close at January 30th and the winner will be announced in this post and at the social networks.

I wish you a creative 2015, good luck!

Saturday, December 13, 2014

4th Annual Internet of Things Awards

UPDATE: Jubito is been selected! Vote for it!

Postscapes 4th Annual Internet of Things Awards - 2014/15. A showcase of the year’s best #IoT products and companies.


Everyone is invited to vote for their favorite IoT Award winners.

Nominate Jubito :)

Monday, December 8, 2014

The power of reflection

In this post we've explained a scenario that consisted by a number (3) of alternative responses. Someone might consider, what if I want to use the response or some other action, like evaluation, to another activity? Should I make duplicates or a number of responses for each one of them? The answer is no. This can be solved by creating the response or some action as a launcher. A launcher creates two instances. One that holds the action and the other the reflection. The reflection is indicated by asterisk symbol.

For example, if I create a new launcher 'demo_launcher' that holds 'Hello %user%' as action, then the system will create:

1. *demo_launcher: Hello %user%
2. demo_launcher: *demo_launcher

When 'demo_launcher' is called the response will look like this...

Hello john (where john the system login. Check Built-in functions and API for more info)

Now, from a different Instruction Set that returns for example the user status, *demo_launcher can be invoked like this..

get_user_stat: *demo_launcher. Your status is set to %whereami%.

which will return...
Hello john, your status is set to present.

I think it's a very straightforward methodology and will become a standard in the future versions.

Screenshots are from the development version which is not yet available. However the functionality remains.


Of course these actions can be applied to any system object, such the evaluator.


Chain reaction behind the scenes.


Launchers are extremely versatile. You can combine anything that supported from the framework in a single action.
So, the verdict is that if you want a complex Instruction Set it is wise first to create launcher components and then mixed in a single one.

You can review a complex AppConfig.xml configuration file.