Friday, October 17, 2014

Raspberry Pi doing i2c LCD display in C++

I'm working on a Raspberry Pi project that needs to be running headless but still be able to communicate with the outside world in some way. We are currently using a simple Red (error), Yellow (waiting for something), Green (Ok) (+blinking) to inform the user of various conditions (you can see them in the picture).

For most features that seem to be ok, but we are thinking about having somekind of display for a bit more details. A cheap 16x1/16x2 display would work quite nicely I think.

Today inspiration hit me to look into that a bit more. I had a 16x1 LCD laying around and a PCF8574T i2c I/O-expander backpack. Wired it up to the Raspberry Pi and started to look for some (proper aka C++) code. No luck there. Just some silly python this and python that. meh.
Well, it works fine on the Arduino.. and that is C++.. hmm, let's port it to plain Linux i2c interface (well, ok, wiringPi i2c wrappers). And so I did.

Here you go:

Raspberry Pi controlling LCD display with i2c in C++

I will do a bit cleanup and then code will be up on github.

You can get LCDs and i2c backpacks from Amazon:

Wednesday, October 15, 2014

Some Kotibussi progress and backend thoughts

The first Kotibussi demo used the very basic ENC28J60 Ethernet controller based ethernet shield. That means the TCP/IP stack had to be run on the Arduino itself, taking up a lot of precious memory. I'm moving it now over to a WizNet W5200 based shield that takes care of the TCP/IP stack in hardware for me, makes a ton of difference in the amount of memory I now have to play with.

Some ideas are to have an integrated RTC and some way to configure the device without re-flashing, aka some control buttons and menu system, the added memory helps a ton in this.

And the backend. Luckily there is a standard for M2M transport data, Siri, unfortunately it is not well suited for low-bandwidth/low-speed/low-memory devices as it is XML based and extremely verbose. And it is also pull based so I would need to poll the data and that is just stupid.

So a Siri2MQTT gateway needs to be created, some minor progress in there, just a skeleton for now but  getting there.

Then there is the minor issue that Turku does not provide any data yet (no timetable, they hope to get it open in 2015), luckily some cities in Finland aren't that behind in progress so I will use Tampere Public Transport SIRI service for now.


Monday, October 06, 2014

Zone handling in Onkyo ISCP

Is kinda annoying.

My device has 2 zones, Master and Zone 2. Onkyo devices can have up to four zones. You can ask the device if the zones are powered, and it can say 01 for powered, 00 if off and N/A if the zone does not exist. So probing what zones are available should be just a matter of asking the power information, and ignore zones that say N/A, right ?

Nope, my 2 zone device answers for Zone 3 with a 00 and for Zone 4 N/A. Sigh...

Oh and no, I can't turn on Zone 3, it just answers with 00. And just for fun I plugged in a USB Sound card as I noticed the firmware contains snd-usb-audio.ko module, but no, no such luck, no Zone 3. Oh, yes, your Onyko runs Linux in case you didn't know that yet.

Tuesday, September 30, 2014

KotiBussi, 3 place and shared challenge price

Related to the previous post in Finnish. It is a description of my entry to the regional app4finland competition, a simple home Buss information display concept.

The idea is to have realtime display of buss(es) on a simple display so you know when to run to the buss-stop. The idea came when I started to think about what is the most annoying thing with using public transport here in my home city of Turku. I personally hate to stand at the buss-stop and wonder where the hell is it, or did it go already ? And at this time there are just a handfull of stops with information displays (that don't even display correct information, last time I needed to take a local buss).

Yes, you can get that from an app or web site. But not everyone has a smartphone. And how much time does it take to first dig the from somewhere, start the app, wait for it to load, then find the particular buss/buss-stop, etc (but the backend could be used for a mobile app, so that is not ruled out)

And this could be used not only at home, but for example at the work place, stores and hospitals. Well, you get the picture.

And instead of having the device polling the information, it uses MQTT to passively listen for changes and that means it does not need much of processing power, a basic arduino is just fine.

The backend part is still to be written, basically a SIRI to MQTT gateway.

Oh, the important part, I won! Third place in one category and shared winner of a specific challenge (transport).

Thursday, September 25, 2014

Kotibussi, Apps4Finland demo konsepti

Kotibussi, Apps4Finland innosta sarjaan demokonseptilaite, josta näkee nopeasti seuraavan bussin tiedot kotoa, ilman tarvetta puhelimelle tai tietokoneelle.

Demolaitte on toteutettu Arduino, Ethernet shieldillä ja LCD näyttöllä.

Arduinossa pyörii MQTT client joka kuuntelee MQTT palvelimella olevia pysäkkitietoja ja päivittää realiajassa tiedot tulevasta bussista, sekä sitä seuraavasta.

Oikeassa toteutuksessa MQTT palvelimelle tiedot haettaisiin reaaliaikaisesta SIRI syötteestä, joka Turun seudulla on tulossa 2015.



Näin bussin käyttäjän ei tarvitse juosta pysäkille seisomaan turhan takia vaan voi rauhassa katsoa näytötä ehtiikö vaikka vielä juomaan aamukahvin loppuun vai ei.

BS: Pysäkin numero
L: Linjanumero
N: Nyt tuleva bussin arvioitu min:sec saapumisaika
S: Seuraavan bussin arvioitu min:sec saapumisaika


Demo ohjelman koodi löytyy github:sta.

Friday, September 19, 2014

Onki now in Jolla Store

Just a quick one to tell you that Onki got trough QA and is now available in the Jolla Store, have fun and a nice weekend!

Wednesday, September 17, 2014

Onki - Onkyo remote controller for Jolla

Just submitted a preliminary alpha version to harbour of a Onkyo A/V receiver remote control app for Jolla. (Update: Oh, and on openrepos now too!)

Basic functionality is there, you can Power on/off, select input source, adjust the volume, mute on/off and tune the radio up/down and also tuner presets up/down.

For now the only cover actions are Tuner presets up/down. Cover action could be configurable to something else, perhaps volume or input ? What do you think ?

Cover actions (Tuner preset up/down)
Device selection works, only automatic discovery for now. In the future you will be able to add your device IP manually in case your Jolla is for example on another network. (Oh, and having your Onkyo on a public network, not perhaps the best of ideas as there is absolute no authentication...)

Onkyo device selection, for now only automatic discovery is supported.
The main screen will have the common control at the top, with current input as the screen title. The common control (for now) include Power button, Volume Up/Down and Mute.

On the bottom you have the input specific actions, on the screenshot below the tuner actions are visible.
Main view with common control and input specific ones
Input selection is available from the pull-down menu. For now all possible input that a device can have are visible, some might not exist on your device so obviously they won't work.



More functionality will come when I have the time to implement them.

Oh, wanna help ? The ISCP library is available on github, the app will also be soonish.