Skip to main content

Posts

Why Open-Source Software works

Many people, specially outside the technology industry are surprised that something like open-source software could exist, specially at the scale and sophistication it quite obviously does. Many vendors of proprietary - i.e. closed-source software, have long tried to discredit open-source as either suspicious and subversive "Commie-stuff" or as hobbyist toys and playthings, not fit for serious applications. Looking at the development of human knowledge and culture throughout history, it should not be surprising that open-source software would exist and be thriving in the long run. On the contrary, closed-source software, like any idea or innovation that is kept secret essentially dies with its inventor, cannot influence new ideas and ongoing innovation and essentially becomes an evolutionary dead-end. In the short-lived word of technology, this can happen within decades rather than centuries, as historically no tech company has managed to stay dominant for more than a few d...

Lernstick

When looking for a platform to learn Linux and Python programming, Raspberry Pi would be on top of most peoples mind today. The success of the Raspberry Pi brand has created an active and novice friendly community, where help and advice is easy to find. However, just using a Raspberry Pi as a low-end desktop computer is surprisingly complex and setting up a room for a programming workshop requires a few crates of additional equipment (keyboards, mice, monitors etc.). It seems that the strength of Raspberry Pi platform is in low-cost, low-power embedded and physical computing applications, like robotics, control and measurements systems. Despite the enthusiasm for Raspberry Pi, it may not be the best choice for organizing a programming class/workshop, specially if the school already has plenty of PC hardware available. The Lernstick is a Debian live-image based distribution which can be booted off a DVD or USB stick. It is being developed by the School for Teacher Education...

Raspberry Pi Temperature Data Recorder - Part III: Visualization

<- Part II: Data Collection Once we have accumulated some data in the RRD database, we can start generating some plots with the RRDTools built-in graph function. The graph above shows the values of the DS18B20 temperature sensors over 3 unseasonably warm days in January. Because of the short cables, the sensors are not optimally placed. E.g. the inside temp sensor is relatively close to the radiator, the outside one is on the ledge, just outside the window and still behind a partially closed shutter in a narrow alley between 2 old poorly isolated buildings. According to the weather report, the current outside temperature is about 3-4 C less than what the sensor shows. From the chart, we can see that the heater feed temperature seems to fluctuate a bit, maybe a sign of  hysteresis  in the burner controller. The heater temperature is also lowered a bit for about 6h during each night, but this seems not to have any noticeable effect on the room temperature. There are smal...

Raspberry Pi Temperature Data Recorder - Part II: Data Collection

<- Part I: Hardware In the previous part of this tutorial , we looked at how to connect a few DS18B20 digital temperature sensors to a Raspberry Pi and read their values. The next part of the problem is periodically collect and record these measurements and store them for graphing and further analysis. It is always possible to store measurement data in a general purpose database e.g. SQLite or MySQL  and then plot the data for example with the Google charts API . For this project however, we are going to use RRDTool , which is a special purpose database optimized for recording, aggregating and graphing time-series data. It is particularly popular for network and system monitoring applications and for example at the base of smokeping  which we used in an earlier example . However this time, we need to configure and setup our own database from scratch. Some of the reasons why RRDTool is particularly nice for this type of application: Fixed-size, fixed-interval...

Raspberry Pi Temperature data recorder - Part I: Hardware

The Raspberry Pi seems ideal for all kinds of "physical computing" applications, as it is small, cheap, low-powered and yet more powerful and feature rich than a traditional micro-controller. One way to showcase such applications in an educational context could be to control science experiments which require long term measurements and data collection. One of the easiest measurement sensors to connect to a Raspberry Pi is the DS18B20  digital thermometer,. It can be read out via a multi-device 1-wire bus that is directly supported by a driver in the Linux kernel. Several sensors can be connected in parallel to the same data-wire and read out individually over the bus interface by their hard-coded IDs. All we need to connect one or more DS18B20 sensors to a Raspberry Pi, is to connect the VCC pin to 3.3V, GND to GND and data to GPIO4 on the Raspberry Pi GPIO header as well as connect a 4.7k Ohm resistor between the VCC and data lines of the sensor. The sensor is available...

Wi-Pi : 802.11 Networking for Raspberry Pi (EW-7811Un)

One of the most conspicuously absent standard interfaces on the Raspberry Pi is built-in support for 802.11 WiFi wireless LAN networking. A low-cost, low-power way to remedy this is for example the Edimax EW-781Un USB WiFi adapter which plugs easily into one of the USB ports on the Raspberry Pi and is supported out of the box by the current Raspbian distribution. It seems to be very popular for use with Raspberry Pi and is available for about $10 in many places where Raspberry Pi are sold. WiFi Client Connecting to an existing WiFi network is trivial, once we know the SSID and access password for the network we are trying to connect to. After plugging in the adapter, it should be automatically recognized by the linux kernel - the output of lsusb should contain an entry like this: Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS] In order to connect to a typical home wifi network, we only need to add the f...

Raspberry Pi Internet Access Monitor

If your Internet access is down and you are not watching, is it really down? For most people the answer is most likely - who cares! Since our Internet connection had recently been down a few times, when I did notice it and I was getting curious about how frequently this was happening. Besides, it might be interesting to get a long term record on the stability and "quality" of our ISP and maybe even compare it with the results from users of competing ISPs. What does it mean for Internet access to be working? Is it enough to check that the link between our home router and the ISPs access router is up and working (a DOCSIS cable plant in my case). Or should we include end-end application layer scenarios like the ability to get my email or my files from some place "in the cloud"? But what exactly represents the "the cloud" or "the Internet"? In reality they are massively large distributed systems at a global scale, consisting of millions o...

Back to Broadcast

About 3 years ago, I speculated in this post , that "user curated content" would become the next logical step to the "user generated content" wave unleashed by the interactivity of web 2.0. By and large I have been wrong. What has happened instead is an accelerating professionalization of online content creation and a return towards the traditional broadcast model with a pronounced split between few creators who produce stuff and the many consumers who consume it. True, there are still myriads of users engaged in some form of content creation, but increasingly only few creators matter. True the cost of creating and distributing digital content has been lowered to much below a level representing a serious barrier to entry, but more so than ever it takes a serious level of luck, perseverance and highly professionalized marketing to stand out from the crowd. Maybe it is a sign of maturing for any new medium that a period of frantic and chaotic experimentation is ...

The limits of Virtuality

The management edict to ban telecommuting a Yahoo has stirred up quite a controversy. It seems a bit ironic for an Internet company to admit that telecommuting isn't working for them. Kind of like an oil company saying that the industrial revolution was all a big mistake and we should go back to animal & slave power. But on second thought maybe things are not as black and white. I have spent quite a few years working on systems to make communication and collaboration easier and more frictionless, often collaborating with people 6-12 timezones away. And my social network is equally spread-out across the world. One should think that I should have figured out remote interaction by now. The reality is that despite high-speed networks, cloud-based collaboration tools and high-quality video-conferencing, remote collaboration still is surprisingly hard and (co-)location still matters. Without any obvious reason, the workers of the post-industrial knowledge economy, seem to phys...

Look Ma, no Wires! Raspberry Pi Bluetooth tethering

Bluetooth is a relatively low-powered short-range wireless technology, which can among others provide a networking connection between devices and is widely supported in portable devices like laptops and mobile phones.  Low power and ubiquitous support should in principle make Bluetooth an ideal solution for tethering. Nothing beats the simplicity, robustness and performance of a simple Ethernet cable for a tethered network connection - as long as both devices support it. For the upcoming Raspberry Pi model A or certain ultra-portable devices without Ethernet port, Bluetooth might be serious option. Wi-fi would probably be the most obvious choice of wireless networking technology. However using the ad-hoc wi-fi hotspot option for tethering on my Android phone turns it into a pocket heater and drains the battery in no time  - while not so much when using Bluetooth tethering instead. Besides wi-fi networking is very well documented, while there is very little documentation...

Raspberry Pi tethering

 After some initial experiments  with using a Raspberry Pi as a home server, I wanted to try out some configurations  useful to the intended purpose of the Raspberry Pi: promote computer technology literacy among students. At least some of the initial feedback from trying to deploy Raspberry Pis in a classroom settings seems to indicate that getting the necessary hardware to operate the Pis is non-obvious. Setting up a room full of Pi based workstations requires HDMI or composite connected TVs or monitors, USB mice and keyboards, micro-USB power supplies and ethernet connectivity routed to each workstation. The cost and logistical complexity of doing that seems to defeat the initial low-cost advantage of the Raspberry Pi. Furthermore, many schools might already have fully equipped computer facilities with incompatible equipment (e.g. SVGA monitors, standard on any not-so-new PC), which could be used, but just not "messed with" for low-level programming and syst...

Automated Dependency Injection

In the tradition of modular and object oriented programming, we have long learned to design software by hierarchical decomposition - divide and conquer engineering, where each module/object has a clear function/responsibility. Complex functionality is achieved by delegating some sub-functionality to other modules/objects. In the above example, module A achieves its functionality with the help of B, C and so one. When these functions become stateful, abstract data types or objects, "wiring" up this dependency tree to enable the access to the right instances of data at each level can become non-trivial in large projects. The dependencies can be hidden and encapsulated hierarchically such that if an application needs an "A", creating "A" in turn triggers the creation of the appropriate "B", "C", "D" and "E", hiding all the complexity of the decomposition from the user of "A". However this static setu...