Saturday, December 13, 2014

Social Architecture

Human civilization has reached unbelievable power. We process petabytes of information, our eyes reach the furthest corners of the universe, while our minds dissect the finest structure of matter and energy. We are incredible species, but we really don't know how to live side by side on this planet and cooperate efficiently.

Some long time ago, our ancestors figured the concept of money. It's an artificial value used to exchange everything else with. Many of our needs can be achieved by having enough money, and we work hard to get them. Then we group into corporations - these giant money-hungry monsters with resources and power. They produce spaceship parts, they grow our food, they even teach our kids. The problem here is that they don't care about result quality, environmental concerns, and morality of their actions (think mercenaries) as long as they get the most money of it.

On the other hand, we are supposed to consume more and more for the economy to develop. Being a target of aggressive advertising and manipulation, today's adult needs a big house, 2 cars, a mobile phone, a tablet, a laptop, and 120 fashion ties in his wardrobe. If you provide these commodities to everyone, you'd realize it requires more resources than our Earth has.

In essence, money divide us. We can't efficiently work together, because money is the strongest link we have. We have organized ourselves in an unsustainable, inefficient way of life. Both present and future pose many challenges to this system:

Robotization. Modern factories are mostly self-operated. More and more human activities become outdated with the development of robotics and expert systems. Self-driving cars, for example, already on the roads, hence all the taxi/truck industry is on a timer. Eventually, humans will only be needed to operate the robots and serve each other. There will be a shortage of jobs on the market and an ever-increasing demand. Money will concentrate in the golden 1% of the society, which controls the robots and other people, thus making the rest to be slaves.

Natural resources. Our industrial revolution was made possible by the abundance of fossil fuels. We've advanced a lot, but still haven't figured out how to live in a sustainable way: fossils are limited, and the amount of energy needed to dig them goes closer to the energy it produces. We need a focused effort to develop alternative energy sources and migrate our infrastructure to be independent of the fossils. I don't see this happening at the moment, either from the governments initiatives or the corporations.

Government. We may have a vote on who is in charge, but since the government is a part of our socio-economical system, it becomes corrupted by money. Big corporations are actively (even openly) lobbying their interests, supporting candidates, and pushing their interests by any means possible. At the end of the day, the government becomes a middle-man between consumers and corporations, the goals shift, and the status quo prevails.

Beautiful Earth. Why should a corporation care about the global warming? Or that weird species of birds that can be found only in New Zealand? Or about preserving the rain forests in South America? But it's not the corporations fault, nor of its people, it's how our system works. This planet will not be able to bear with us for much longer. We pollute air, throw radioactive wastes into water, killing the living ecosystem that was established long before us.

War. War never ends. We fight for resources, for influence, sometimes just because we produce too many weapons. For some groups, war is a profitable activity, and igniting a conflict becomes their natural goal.

Health care. Imagine a cure that is accessible all over the world, costs nothing, and is able to treat all known illnesses. If such a cure is ever found, there are two possible scenarios: 1) it becomes destroyed with all the evidence, because it is not profitable; or 2) it's starts being sold to selected people only with sky-rocketed price. Health corporations are not interested in healing you quickly and efficiently (it may be a side goal, or it may be not), they are interested to suck more and more of you while you are sick. Their best interest is to charge you a ton of money, keep you for long in the hospital, and prescribe you the pills that would never help, if not make it worse.

Education. Surprisingly, the best teachers that we remember from our school days are the ones we never liked while being there. They were harsh, unforgiving, and caring only about you getting important skills and knowledge. Private education institutes are doing the opposite: they want you to like being there, they advertise heavily, and they try to convince you that the money were worth spent. Actually teaching you becomes a side effect. As a result, we get generations of worth-less over-confident individuals, who do not contribute much into our society.

Unstable economy. The flow of money does not exactly self-regulates. The free market is controlled by the laws of supply and demand. There is a lot of intermediate entities between producers and consumers. It's venture capital firms, mutual funds, stocks, global importers and local retailers, to say the least. On one hand, they naturally occur in the system of free market. On the other hand, their only job is to eventually connect consumers with producers. Naturally, they become parasiting on the system, resulting in the most powerful and rich people being them, who controls the money flow.

Better organization 

An alternative organization model is described in the Zeitgeist movies. Basically, we need to change the established value system in order to live more efficiently. We need to throw away money, strip ourselves of power, and integrate all layers of the society in a centralized manner.

Venus project is a good example. It's a self-sustainable city with no private sector, where everything belongs to the citizens. It is controlled by a computer program, which can be developed and maintained in a collaborative way. The program can efficiently distribute resources and energy, schedule manufacturing and farming throughout the whole city.

The biggest challenge is to change the motivation of people: instead of working for money, they need to work for contributing into the society, or because they simply like doing something. With todays technology, we can have most non-interesting and monotonic jobs being completely automated. Surprisingly, small communities organized in a similar manner can already be found all over the world. People are happy there, because they see apparent positive effect from their activity instead of just a pile of money as a measure of their contribution.

The change is difficult for a single person, but not so much for the whole society, because it can be achieved in an iterative manner. A group of people may unite, behaving in the "old" world of free market as a single entity. More people may join the club, build facilities, expand the farms, thus eventually unwrapping into a city. Cities may connect with each other and be sustainable without a direct intervention from the outside world (think: global warming or a world war). Of course, the ultimate benefit of this organization would only come when the whole world converts.

One can find a similarity to communism with all the possible negative associations. As an idea, communism didn't fail in XXth century. It's the implementation that failed, and this should be expected from the first rough attempt to change the social organization. The technologies weren't ready yet, and forcing people into the new system caused a lot of backslash. All in all, USSR was a world-scale experiment, which had it's moments of great glory, even though it broke eventually.

Concluding, I may have not convinced you to drop all your belongings and move into the nearest community village... But I hope my words raised your interest in the alternative socio-economical systems. I hope you'll start wondering about the laws around you that were invisible just because we are so used to them from the birth. Perhaps, you'll start seeing bad things of our world to be a little less inevitable. You may see the light of actually fixing our society at some point.

Update-1. Found this wonderful post highly correlating with my position. Must read, if only you can get through the blue background ;)

Sunday, October 5, 2014

Circles of the Home Automation hell


Just a week ago I knew nothing about IoT. All the buzz was meant (I thought) for someone else, but that changed when I bought a house. Suddenly, a strange desire was born in my mind: to connect entities (doors, rooms, speakers, etc) inside my house, to monitor and control them as a system. Thus, I started looking into Home Automation, and with each new iteration I was diving deeper and deeper into the hell of technological diversity.


0. Complete Solutions

There is a lot of companies (like this one nearby) offering to install their proprietary home automation system for a big sum of money on the case by case basis. That wasn't acceptable for me, because I wanted to know what my options were, and expand gradually.


1. Isolated subsystems

Some companies specialize only in a specific domain. For example, Lutron is known for its lights and dimmers, which come with remotes. Phillips Hue makes the best LED lights, also remotely controlled. Nest is a decent (and awesome looking!) learning thermostat. Going wider, Vera allows you to buy components that you need and attach them to the system dynamically. Naturally, I started asking myself why these things can't be organized together, what language to they talk to each other?


2. Wireless Protocols

It turned out, there is a lot of diversity in wireless means of communications. You thought that WiFi and Bluetooth are enough for everyone? Welcome to the real hell:

ZigBee - perhaps, the oldest protocol (outside of X10, which we'll skip). It's looking decent on paper: support for mesh networking, low power consumption, huge group of supporters. It is ISO certified, and you can find numerous open source libraries and protocol implementations. However, the devil hid in the details, again. There are two incompatible kinds of hardware: Series 1 and Series 2. There are different profiles of communication, and you can't easily mix and match those. Finally, I tried to look for something specific, like a temperature/humidity sensor, and it came short of options for the real "Buy" button to appear. It appears that Zigbee has some fundamental issues (maybe those I mentioned) that pushed the alternative developments.

Z-wave - the most available (in terms of hardware) protocol, which also claims to be very smart in design (mesh networking and such). It is really straightforward to find actual devices, but unfortunately difficult to program them: the API is opened only after buying the SDK and signing an NDA. Open-source implementations exist but seem to be rough and incomplete.

EnOcean - the european-origin protocol with the main focus on self-powered devices. There is not much out there to read about it, but the limited range of compatible devices is available from a single manufacturer. The promise of battery-less components seemed very appealing, but it got compensated by the price of those.

Other things I didn't research include Insteon, Bluetooth Smart, WiFi (for IoT), ClearConnect (used by Lutron), and Thread (used by Nest). The last one seems exceptionally promising, but no public information is available yet about it.

At this point, I realized that if I'm gonna control my devices, they had to use the same protocol. Alternatively, I found a market of cross-protocol universal hubs, such as Wink, Revolv, Staples Connect, and SmartThings. While they do allow using devices from different networks, I found only Wink providing an actual API, which I doubt works flawlessly. If you don't intend to be in full control, this may be your last stop (for good).

Another problem, adherent to most solutions, is the requirement of Internet access. While I do appreciate a mobile app to access my home system, I believe it should not involve a cloud server. The cloud is a privacy hole and yet another point of potential failure. My system should be as much self-contained as possible.

Thus, I wanted to go deeper... The hub, I imagined, could be a headless Raspberry Pi with a RF module (like XBee) that I'd program myself in Rust. Fortunately, Pi supports modules for all major RF protocols. The hub would host a website for online access and schedule my house in a 24/7 mode. The only problem was locking into a single protocol (and its API), because I didn't want to hook up and dig into multiple protocols at once.


3. Micro-controllers

I noticed that sensors without RF modules are very abundant and cheap. What if I connect them to my own network physically, by having a micro-controller and a RF module attached by hands? That perspective made me look into simple computing cores:

Arduino - the most known family of boards, featuring dominantly the AVR family of controllers. Sadly, LLVM (and hence Rust) does not support this platform as a target, and the cheapest ARM core (Arduino Due) is more expensive than Pi. If not for these factors, I'd go with Arduino in a heart beat, for it's rich documentation and wide community support.

STM32 family - the most open-source friendly ARM chips out there. Rust has a Zinc project of running on bare metal, that was developed for this chip. Prices start as low as 8$, and there are extension boards available.

Tiva C launchpad kit from Texas Instruments - the most impressive ARMs in terms of website navigation and availability of standard extensions. Bare boards start at 13$ and seem very solid, thus being my current choice.

Freescale Freedom Boards - the most diverse family of ARM chips. I found it difficult to navigate their website and to figure out what exactly I need there. Can't see any extension boards in particular, but I'm sure there are some. Prices start at about 16$, though these boards include some LEDs and switches for demonstration purposes by default.



As a starting point, I decided to order one of the low-end ARM chips, and try to get anything programmed to it in Rust. That will take me a while... I may end up contributing some code into Zinc, or even shifting to robotics after-wise, because that's where MCUs really shine. At the same time, I'm going to buy a Nest thermostat with a couple of Nest CO detectors for my family to enjoy while I'm tinkering with low-level stuff. If I ever reach the point where I could control my HVAC and other things remotely by my own program, I'll be happy to replace Nest with something dummier, or just hack it to get the root access to HW.

If thought about home automation, have some solutions installed, or are building your own hub in the garage - please share, as I'll be happy to learn from your experience. If you didn't care about IoT and my article made you interested - you are welcome ;)

Friday, August 15, 2014


Vision. I often heard this term, read about it, though I knew what this is. I thought, when there is a person in charge, who is a highly skilled engineer, he can see what others can not just because of his engineering capabilities and the fact he goes thinking deeply about the problems (not only existing ones, he is also in a constant search for the new ones). Apparently, it's not that simple.

It turned out, vision is not a consequence of engineering skills but something very different. It's an extraordinary ability to see the future, a hypothetical future of a product evolution. By seeing this, a revisionary can drive product development in leaps, thus making it a revolutionary progression.

It is important to realize this is not "just" about development time (or, the availability of shortcuts). Evaluation is all around us. We evaluate everything we are doing in order to learn from it and adapt. Others evaluate our work in order to figure out if they want to invest in it. Thus, being able to leap forward gives you an instant advantage in terms of evaluation outcome, which transforms the benefit of having a vision from quantity (of time) to quality.

I faced the vision problem when tried to design a large system, in collaboration within a team. I realized (for the first time) that it's not the engineering skills that we lack, but rather a clear vision over where we are going. It doesn't even matter if you are an architect, lead developer, or the god himself. If you got the vision, you'll be heard.

Aside from being mysterious, vision is still a human skill. I wonder if it can be trained, like any other human skill we have. What kind of activity would that be? I don't believe that by just thinking and brainstorming we get any better in visioning in general, we merely dig harder at a specific problem instead. There must be something more generic. Perhaps, playing the music?..