Implications of a machine economy

IOTA for novice programmers. Copy, adapt, combine – Part one: copy…

I’ve started to try and “do something”, and it has been a steep learning curve. Very steep. Consider it a tumble down the rabbit hole. I’ve been following an introduction course into Python (and Computer Science by proxy) and searched for a way to connect a sensor to the tangle. Here I describe my experience doing the latter.

My scope

I wanted to add sensor data to the Tangle. My longterm goal is to set up an air quality sensor network in my neighbourhood. I want to know how air pollution varies over the day, over the year, and the influence of temperature, humidity, and air pressure: in short the weather.

Choosing a sensor

Researching “easy” air quality sensors I’ve found out that these sensors are finicky. The first problem is that there is a wide variety of possible influencers of air quality (CO, SO2, NO2, groundlevel ozone, PM 2.5, PM 10, and a wide range of Volatile Organic Compounds (VOCs)).

I decided that adding sensor building itself is too big of a scope for now, because sensors are just step one. After that you need to send the sensor data to a connected node, via Bluetooth LE, LoRaWAN, SigFox or the likes.

An out of the box solution would be a better starting point.

RuuviTag – seemingly easy

“RuuviTag is a waterproof Bluetooth sensor capable of sending temperature, humidity, pressure and motion information directly to your mobile phone.”

RuuviTags seem very user friendly, and therefore a good starting place to get sensor data on the Tangle. Before ordering I checked the website for tutorials and found one that connected the RuuviTag to the Tangle via MAM. That ticked a lot of boxes, amongst which Tangle, MAM, and Easy.

How wrong can one be…

Interlude on learning and creativity

I like Kirby Fergusson’s (Everything is a remix) simple model for creativity: boiled down to its basics all creation and learning is copying, adapting, and combining. Learning starts by copying what already exist. When we get comfortable with the basics, we start to adapt what we copied before, because it doesn’t do what we want it to do. While adapting we become proficient enough to go to the next step: combining. We start taking bits of one idea, and combining them with another. It’s an intuitive way of learning that delivers fast results. Because it’s rewarding during the learning process, it is more inviting to learn than the old cramming knowledge in your head and trusting that it will be useful sometime in the future. Both will require learning the basic knowledge at some point, but the former model creates a framework of where the basic knowledge applies, and therefore assists in absorbing the information in an applicable way.

RuuviTags – deceptively hard

Upon the arrival of the RuuviTags I tried the IOTA tutorial, but it immediately struck me that it might be too hard to start with (installing custom hardware on the tag, installing a custom image on my Raspberry Pi, and then the “IOTA stuff” on top of that, all of which was unfamiliar for me.)

Having dipped my toe into Raspberry Pi, I decided to setup the weather station with the RuuviTag and a Raspberry Pi 3B+. It consisted of installing a custom Raspbian image and simply reading the data from the tag. Shouldn’t be too hard, so my first reward was coming up.

I’ll start with the ending. After two full days of trying, I finally read the last line on the setup guide that contained all the steps to build the ready made Raspian image yourself. (I followed it, because the ready made image didn’t work.) It said that the complete Raspbian image was compatible with the Raspberry Pi 3B, not the 3B+. #$%*@?!

How to waste two whole days

In those two days at some point I had a temperature reading display in my Grafana dashboard, so I managed to

  • setup the image on the Pi
  • configure the hotspot
  • install InfluxDB and made a database
  • install the Grafana dashboard
  • connect the InfluxDB database to Grafana
  • install RuuviCollector from GitHub to collect the data
  • add scripts to automatically start RuuviCollector upon start
  • and route ports on my router for easier use

But somehow after endless hours of fiddling I got it working and 5 minutes later messed it up. I was unable to figure out what I did that messed it up, because I didn’t even know how I got it working in the first place. (Mind you, the steps described above only generally describe the process. I’ll leave it to your imagination what all went wrong to fill two days of following a guide.)

A Pyrrhic victory1

In the end, I bought a Pi 3B (minus the +), which isn’t easy to get these days. A week later it arrived, and the setup of the Ruuvi image was easy as pi. 

As a first experience into the world of connecting sensors, I would not recommend this. Surely I’ve learned a lot, but I wouldn’t know how to reproduce it. A good summary would be: “It’s fucking hard”, and I would not call it encouraging.

Ict – easy experimental technology 

“Ict is software for the IOTA network nodes running on low-end devices, using the final design of the transaction structure, swarm logic and relying on (static) Economic Clustering instead of the Coordinator for doublespending protection.”

It is still very much in development, so it doesn’t seem like a suitable candidate for a first project. The truth however is that one simple guide 2 allowed me to set it up in just over an hour, and I’ve been playing with it for the past few weeks, even installing an IXI (IOTA plugin) for network visualization. 

With a little help from my friends

Here comes the cool part: my first attempt at installing IXI failed. It seemed easy, but I’m still very inexperienced in Linux command line and GitHub. I tried to install it a day after it was first released, so no guide was available yet. But with help from someone in the community I managed quite easily and set it up on another node I was running in 15 minutes.

Because people on Discord kept having the same questions as I had, I decided to copy my chat into a document for others to use, with some editing for clarity. This helped quite a few people set it up correctly, and as a result the ICT community had build a tool that visualized the topology of the swarm network. 

Excelsior

That last bit might sound like rocket science to the casual reader, but that’s the point I’m trying to make: I was a casual reader like that. The fact that I was able to join the Ict network with an easy to follow guide made all the difference. From then on, I became confident enough in my knowledge that I was able to share it, and actually help other with it.

The contrast between my two attempts couldn’t be bigger: one is a polished product with loads of tutorials, and the other an experiment that is rather unclearly defined and documented. At first glance the Ruuvi seems the more appropriate starting point for a novice; in reality it doesn’t matter what it looks like. It just has to work.

My take away for now

In order to mobilize a community of enthusiastic followers into active participants we need a sort of “Hello, world” for IOTA that is easy, useful, collaborative and preferably widely compatible with hardware. The last one is arguably the hardest and least important, because investing in a Raspberry Pi for instance is hardly an inconsiderable amount of money.

Easy does it

Easy in this regard means being able to copy and paste the right code in the right place, guided by a text that is comprehendible to the non-expert and novice. It should explain the function of the code, but steer away from the ins and outs and underlying considerations. The goal is a result, not comprehension.

Useful

Useful is meant in regards to purpose. Nothing deters comprehension like abstractness. By seeing a real world outcome, no matter how negligible, creativity is sparked. It motivates curiosity, because experiencing one thing working automatically triggers the belief an alternative option is feasible too. 

Collaborative

Collaborative means that people from various backgrounds are working on the same higher goal. This sense of purpose means a constant activity around the subject, and with that a constant availability of help for anyone stuck in the process. A desired, but unenforceable outcome would be community development, where the more proficient members throw together their knowledge and expertise in order to add functionality.

Compatible

The compatibility with hardware gets a mention because the world is full of hardware that has similar functionality, but is very incompatible. Even the + sign within a product line like the Raspberry Pi 3B might cause an incompatibility that could easily deter a novice. For a “Hello, world.”-like example that would be unacceptable, even if there were a community to assist the effort.

My suggestion for an IOTA “Hello, World.”

I think a Data Market tutorial would fit the bill. I’m unaware of the plans regarding the Data Market, but it is a big carrot for the community. If there was an ability to add you Ruuvi or Raspberry Pi Sense Hat, via MAM to the Data Market, you would create a ripple of adoption that could turn into a wave. 

How it could work

By having many novices understand the steps involved, and gaining confidence in their ability to “program”, there would not only be an uptick in aspiring programmers within the community; it would also attract outside programmers into the IOTA ecosystem. On top of that, the people who manage to implement this tutorial can show and tell how IOTA works in the real world. From this simple example they can incorporate to their story nuances like tamperproof sensors, larger dataset than the IOTA message can hold, or types of MAM channels.

Conclusion

Learning is best done by starting to copy, to gain a better understanding of the scope of what you are going to learn. It is also rewarding to see it working, even before understanding. In programming however there are many soft and hard hurdles that can easily make you trip. I am going to continue my journey in Wonderland, but wanted to share these insights for now. Learning is good, but a huge disadvantage is that you lose the perspective of yourself as a novice.

I hope to find a better way to help people understand using sensors in general and finding an acceptable way of connecting them to the Tangle, even for the less versed but well motivated.

About the author

Bas van Sambeek

Communications strategist, specialized in the positioning of high tech products. I help innovative start-ups and fast growing companies in high tech industries clarify their story through positioning and storytelling.

2 comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Great idea to approach this with the copy/adapt/combine mindset! As much as I like Iota, I have never considered trying to hook up a sensor because it seemed like I would first need to go back to school for a degree in computer science. Your article definitely makes me feel that this is a journey I could afford to take.

    • Inside IOTA Foundation they’re working on this, so anyone like you can start doing things yourself and feel confident doing it. I’ll keep investigating things and report them here; the good, the bad, and the ugly. By mapping the problem, we can start solving it. Have fun experimenting Kevin, and don’t forget to reach out to others when you get stuck.

By Bas van Sambeek
Implications of a machine economy