CawiBox – Continued… and finished ???

A reminder of the previous episodes: Marek, a Polish student, spent a few months at Gide in 2014, during his two year Masters in “Optimization in Operations Research” (ORO) at the University of Nantes. His main assignment was to test the use of the Raspberry Pi as a CAPI CAWI server: a solution that could be useful in the field of face-to-face surveys when there is no Internet connection or it is not reliable enough (showrooms, etc.).

cawibox_cluster

Before leaving, Marek left us various comments and pictures that we had not taken the time to post and we have compiled them (in their original version!) at the end of this article. They cover specific technical points of interest, in varying degrees, to our most tech savvy readers, and they are then proof that in Gide, we love technology and innovation :-)
As a reminder, you can find the previous articles on CawiBox here (“vs Lighttpd Nginx vs Apache”) and here (“Cassandra Cluster (just for fun)”).

In the end, what is left of this CawiBox? The latest tests on some cumbersome surveys showed that the Raspberry Pi was a bit “light” to handle alone the tasks being asked to carry out (Web server, application server, storage server, Wifi access point, etc.), all in a small (85x56x21mm, 45g) autonomous box for €30 … In its basic version (and unless we mount a cluster Pi!), the Raspberry Pi does not therefore offer a satisfactory solution to be used under field conditions: – /

cassandra

But then … will the CawiBox ever happen? Hope is permissible because there are many alternatives to the Raspberry Pi today …

For starters, the Raspberry Pi, first of that name, recently had a little brother … small but sturdy! The Raspberry Pi 2 offers, in particular, a processor six times more powerful and twice as much memory as its predecessor. The shape is similar and the “Pi” community is still as energetic and productive: we will try to move on to some tests as soon as possible.

Furthermore, the “mini-PC” market has begun to flourish. More expensive (between € 100 and € 200) and a tad bulky, they are also more powerful and less oriented towards “hacking”. We recently acquired a Zotac ZBox PI320 Pico (thanks to the excellent site MiniMachines.net) and then the battle commenced.  First pitfall: these machines are designed to operate with specially packed versions (“Bing”) with Windows 8.1 and their BIOS does not allow to run (easily) another operating system such as Linux gggrrrrr … … but Gide has not given up ;-)

In the end, it is perhaps Intel that found the Grail: the Intel® Education Content Access Point. The beast integrates in the same box (190x190x30mm) a Wifi access point, an Ubuntu server (Linux, consequently), 2GB of RAM, 8GB of storage and a battery, all the components that are found in the CawiBox recipe! But, insofar as it is usual for the developing countries, the most complicated in the immediate future, will be to obtain a model: therefore, to be continued:-)

Intel Education Content Access Point

Marek’s forgotten articles:
1) Your own WiFi access point
Now WiFi networks are everywhere: at work, at school, at university and at home.
Increasingly, devices are able to connect to wireless networks. For some of these devices, to connect to a network is not an easy task: it is necessary to install the drivers and software that handle the connection and authentication.
Here, we go a step further. Our CawiBox uses WiFi, but not in “client” mode: it is a server that creates a Wi-Fi network that other devices can connect to.

cawibox_wifi
The set up of networks and authentication is handled by “hostapd” (http://en.wikipedia.org/wiki/Hostapd).
And the management of the DNS (“Domain Name System”) is managed with a light server “dnsmasq” (http://fr.wikipedia.org/wiki/Dnsmasq) like that, after connecting to our WiFi network “CawiBox” it is enough to just type “cawibox” in the browser and it works, no need to retain the IP address :-)

2) Survey management more easily over CawiBox
The purpose of the CawiBox is not just mobility and energy saving. It is also the comfort of the user: we develop the administration panel that will allow to install the surveys and retrieve the results by clicking a button … without typing commands in the Terminal ;-)
Our first version of the administration interface (yes, we agree, for the time being, not very pretty) is functional and has managed to face this problem.
To pull it off, we have developed a simple package manager, which allows to store the questionnaires in the archive and install them on CawiBox by selecting them in the administration panel.
To retrieve the results, our script generates an archive containing all the files created for the selected questionnaire. In addition, all this is done without writing a temporary file on the SD card: the flow is passed directly to the administration web browser!
F
ollow our blog for more news on the CawiBox project!

3) Update the time system without PSTN, without NTP
By dint of using computers and other electronic devices equipped with a date and time feature, we are used to being able to verify them at any time and we want to make sure that they remain current. Unfortunately, this is not always the case ;-)
All these electronic devices are equipped with a RTC (“Real Time Clock”) also called “Hardware Clock”. This is an electronic circuit which has its supply separated from other parts of the machine (but which from time to time, is integrated in the interior of the circuit), and its purpose is simply to keep the time when the machine is off .
Raspberry Pi has no integrated RTC circuit. Nous en avons branché un mais, finally, we decided to remove it and to use something more simple as a solution. Whenever our CawiBox starts, it does not know what time it is, but just getting into the admin panel, the time of the CawiBox will be updated using an asynchronous request with JavaScript and which will completely transparent to the user.

4) Test the autonomy of the external battery
One of the principles of the CawiBox is the mobility of the device. We decided to test it with an external battery of 12000mAh.
The test was simple: an iPad accesses our test page questionnaire and refreshed every 10 seconds. Then in our CawiBox, we launched a “bash” script that writes to a file the date and time of the start of the test and then it also wrote the end time every few seconds.

cawibox_battery
After, we left it work like that. The next day, we found it off, this is normal because it has discharged the battery. We calculated the time from the time and date of the start of the test and the end: the result was 0 days, 15 hours, 39 minutes and 49 seconds :)

5) Remove the USB device with a button
Initially, we wanted to allow the user to remove a USB stick from the administration panel.
In the end, we did it with a physical button because the function that removes the file system is not “thread safe” and our server runs in multi-threaded” mode for optimization reasons.
To test the concept, I made a small circuit on my breadboard”. Instead of a real button, I closed using the cables.
Everything was managed by a small driver in Python which I wrote and which runs in mode Unix system daemon“, as all systems services that are supposed to run continuously.

cawibox_button

Leave a Reply

Your email address will not be published. Required fields are marked *