Reconnecting with Nature

During a recent holiday in England, I spent a few days in a location without any links to the internet at all. No mobile phone signal, no WiFi hotspots. Nothing.

It was interesting to see the impact this had. There were countless times when I wanted to check something on a map. Or the opening times of a shop. Or get the latest news or weather forecast. Without realising it, I have become an autonomous and habitual user of Google and suddenly found myself disconnected.

At some point during those few days the frustration of not having instant answers to questions was replaced with a sense of calm. A distant remnant in my brain remembered a time when this was normality. When there was no internet, no smartphone.

I began to feel more aware of my surroundings. The birdsong. The vivid green of the grass, the blue of the sky. You don’t need a weather forecast when you remember that you have eyes and can look up at the clouds to judge their size, speed and direction and make an educated guess. Who needs a map when you’ve got the sun and the stars?

Being offline for so long has been good for me. Maybe I should do it more often.

The Things are coming…

Recently, I attended #offcamp – a barcamp style discussion around open data which was organised by @bcs_isleofman and free to attend.

The morning sessions were OK and it was good to see that some thought is being given to making data open and available, especially data that has been collected by governments and already paid for by the public.

However, what really caught my attention was the crowd sourcing of data using sensors and the Internet of Things. I hadn’t realised that the problem of expensive telecoms links for remote IoT devices is beginning to be solved by new RF chipsets based on spread spectrum techniques similar to those used in QRP amateur radio experiments.

Sadly most of these RF technologies are proprietary, but that doesn’t mean that the infrastructure built with them has to be. A group of people from Amsterdam have built The Things Network which is an open movement with the aim of providing free and open communications for IoT devices around the world.

Given my interest in radio and electronics, together with the open philosophy of building something free for community use, I knew that I wanted to get involved with this. So, I’ve established an Isle of Man community with the aim of getting our very own Things Network established here.

Guerrilla Wifi?

This week, I tried some different firmware on the ESP8266 modules that I have. I flashed a version of NodeMCU which allows Lua scripts (and other files) to be uploaded.

By using this software: https://github.com/reischle/CaptiveIntraweb I was able to turn the ESP8266 into a wifi access point which serves a static site, regardless of what web address the end user tries to reach.

Given the small size and modest power requirements, this would be great for announcing things to a wide audience by placing an ESP8266 in a busy area, and choosing an ‘inviting’ SSID for people to connect to.

I’ll leave it up to you to decide whether to use this for marketing, advertising or political activism…

RFID Business Cards

I was lucky enough to get some vouchers for Amazon for my birthday recently. I bought some things I needed, but then had a couple of pounds left on the voucher. I decided to ‘waste’ this on some MiFare Classic 1K RFID cards.

These can be formatted to the NDEF standard, which means that many devices (although usually phones in everyday use) will understand the data payload and know what to do with it.

I used a trusty Arduino Uno together with a PN532 RFID chip to write a URL onto the cards. Now anyone with an RFID enabled phone can scan the cards and instantly be taken to a website with more info about me.

I like to think of it as an RFID business card!

Adventures with the ESP8266

I first saw an ESP8266 board at OggCamp as part of a central heating control project. Recently, I’ve been researching a project for CodeClub that needs to control devices remotely over some kind of radio link and so I thought it was time to get to grips with these devices.

They turned up in the post with absolutely no documentation whatsoever. A quick search with Google images hinted at a pinout, and so I tentatively applied 3.3 volts (from an Arduino Uno) to what should be Vcc and GND and was reassured by an LED lighting up on the board.

I then realised that I didn’t have a 3.3V serial I/O device to attach the ESP8266 to a computer for programming. The Arduino UNO has a serial interface, but it’s at 5 volt logic levels. I ordered a USB to serial board based on the FTDI chip, and waited…

Finally I was all set. FTDI interface attached to laptop, and with the help of some crocodile clips and breadboard, I had everything hooked up.

Nothing worked.

Hmm. After half an hour of checking connections and fiddling with baud rates in the serial console, I finally realised that there is a pin labelled ‘CH_PD’ which needs pulling up to Vcc to bring the chip out of a powered down state!

I had blinky lights and setting the baud rate to 115200 produced readable text from the ESP8266 on my screen. Yay! Sadly, I couldn’t get the device to accept any commands until I realised that it needs both a carriage return and a linefeed character after each instruction.

So now I had success in that my laptop was talking to the ESP8266, and that it was talking back. The next step was to replace the stock firmware (which is based on the old Haynes AT commands for modems) with something more flexible.

I opted to use the Arduino IDE, as I’m already familiar with the C style code it uses. Adding the ESP8266 using the IDE’s board manager, and pasting in this url: http://arduino.esp8266.com/stable/package_esp8266com_index.json was pretty easy. Great work, community!

Finally, I found a nice piece of example code which I copied and pasted. I edited the WiFi config details, and also changed the GPIO pin number (as my ESP8266 only has two!) and then compiled and uploaded. You have to ground GPIO 0 pin when applying power to ESP8266 to get it ready to accept new firmware. This worked first time. Yay!

So, taking my phone and sticking in the IP address which the ESP8266 had been assigned (by DHCP) produced a simple web page with an ‘on’ and ‘off’ button. I attached an LED and resistor to the GPIO pin on the ESP8266 and felt a great sense of achievement as I was able to turn this on using the menu on my phone. I also checked from a browser on my laptop which worked well too.

So, concept proved. I really like the ESP8266. Cheap, easy to program and with enough power to be totally self-contained for small Internet of Things projects.