Installing docker on ubuntu

Installing docker on an ubuntu 16.04 Virtual Machine

Bibliography

Docker documentation: https://docs.docker.com/engine/installation/linux/ubuntulinux/

Let’s go

I basically followed the documentation available in the bibliography. Here are the commands I entered and the results:

Prerequisites

Reference

https://docs.docker.com/engine/installation/linux/ubuntulinux/#/prerequisites

Input

uname -r

Output

4.4.0-36-generic

Analysis

My kernel it’s 4.4.x, that’s fine.

Input

sudo apt-get update

Output

Trovato:1 http://it.archive.ubuntu.com/ubuntu xenial InRelease
Scaricamento di:2 http://it.archive.ubuntu.com/ubuntu xenial-updates InRelease [95,7 kB]
Scaricamento di:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [94,5 kB]
...
Recuperati 1.285 kB in 12s (103 kB/s)
Lettura elenco dei pacchetti... Fatto

Analysis

My APT index it’s updated.

Input

sudo apt-get install apt-transport-https ca-certificates

Output

Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze
Lettura informazioni sullo stato... Fatto
ca-certificates is already the newest version (20160104ubuntu1).
apt-transport-https is already the newest version (1.2.12~ubuntu16.04.1).
0 aggiornati, 0 installati, 0 da rimuovere e 3 non aggiornati.

Analysis

The apt-transport-https and ca-certificates packages were already installed.

Input

sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

Output

Executing: /tmp/tmp.R97nJLsyWy/gpg.1.sh --keyserver
hkp://p80.pool.sks-keyservers.net:80
--recv-keys
58118E89F3A912897C070ADBF76221572C52609D
gpg: richiesta della chiave 2C52609D dal server hkp p80.pool.sks-keyservers.net
gpg: chiave 2C52609D: chiave pubblica "Docker Release Tool (releasedocker) <docker@docker.com>" importata
gpg: Numero totale esaminato: 1
gpg:               importate: 1  (RSA: 1)

Analysis

It looks good, the key it’s from them.

Input

sudo nano /etc/apt/sources.list.d/docker.list

Delete everything (if present) and paste just this line:

deb https://apt.dockerproject.org/repo ubuntu-xenial main

Exit and save.

Analysis

We added the docker repos the the APT list.

Input

sudo apt-get update

Output

Scaricamento di:1 https://apt.dockerproject.org/repo ubuntu-xenial InRelease [30,2 kB]
Scaricamento di:2 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages [2.313 B]
Scaricamento di:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [94,5 kB]
Trovato:4 http://it.archive.ubuntu.com/ubuntu xenial InRelease
Trovato:5 http://it.archive.ubuntu.com/ubuntu xenial-updates InRelease
Trovato:6 http://it.archive.ubuntu.com/ubuntu xenial-backports InRelease
Recuperati 127 kB in 10s (12,0 kB/s)
Lettura elenco dei pacchetti... Fatto

Analysis

The APT index it’s update also from the the new repos added.

Input

sudo apt-get purge lxc-docker

Output

Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze
Lettura informazioni sullo stato... Fatto
Il pacchetto "lxc-docker" non è installato e quindi non è stato rimosso
0 aggiornati, 0 installati, 0 da rimuovere e 3 non aggiornati.

Analysis

There was no need to purge the packet because it wasn’t already installed.

Input

apt-cache policy docker-engine

Output

docker-engine:
  Installato: (nessuno)
  Candidato:  1.12.1-0~xenial
  Tabella versione:
     1.12.1-0~xenial 500
        500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages
     1.12.0-0~xenial 500
        500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages
     1.11.2-0~xenial 500
        500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages
     1.11.1-0~xenial 500
        500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages
     1.11.0-0~xenial 500
        500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages

Analysis

It’s getting it from the xenial repo so it’s fine for ubuntu 16.04

Installing

Reference

https://docs.docker.com/engine/installation/linux/ubuntulinux/#/install

Input

sudo apt-get update

Output

Trovato:1 https://apt.dockerproject.org/repo ubuntu-xenial InRelease
Scaricamento di:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [94,5 kB]
Trovato:3 http://it.archive.ubuntu.com/ubuntu xenial InRelease
Trovato:4 http://it.archive.ubuntu.com/ubuntu xenial-updates InRelease
Trovato:5 http://it.archive.ubuntu.com/ubuntu xenial-backports InRelease
Recuperati 94,5 kB in 10s (8.912 B/s)
Lettura elenco dei pacchetti... Fatto

Analysis

The APT index it’s updated again.

Input

sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual

Output

Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze
Lettura informazioni sullo stato... Fatto
linux-image-extra-4.4.0-36-generic is already the newest version (4.4.0-36.55).
È stato impostato linux-image-extra-4.4.0-36-generic per l'installazione manuale.
The following additional packages will be installed:
  linux-generic linux-headers-4.4.0-38 linux-headers-4.4.0-38-generic
  linux-headers-generic linux-image-4.4.0-38-generic
  linux-image-extra-4.4.0-38-generic linux-image-generic
Pacchetti suggeriti:
  fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools
Pacchetti raccomandati:
  thermald
I seguenti pacchetti NUOVI saranno installati:
  linux-headers-4.4.0-38 linux-headers-4.4.0-38-generic
  linux-image-4.4.0-38-generic linux-image-extra-4.4.0-38-generic
  linux-image-extra-virtual
I seguenti pacchetti saranno aggiornati:
  linux-generic linux-headers-generic linux-image-generic
3 aggiornati, 5 installati, 0 da rimuovere e 0 non aggiornati.
È necessario scaricare 68,5 MB di archivi.
Dopo quest'operazione, verranno occupati 296 MB di spazio su disco.
Continuare? [S/n] s
Scaricamento di:1 http://security.ubuntu.com/ubuntu xenial-security/main amd64 linux-image-4.4.0-38-generic amd64 4.4.0-38.57 [18,7 MB]
...
Configurazione di linux-image-generic (4.4.0.38.40)...
Configurazione di linux-headers-4.4.0-38 (4.4.0-38.57)...
Configurazione di linux-headers-4.4.0-38-generic (4.4.0-38.57)...
Configurazione di linux-headers-generic (4.4.0.38.40)...
Configurazione di linux-generic (4.4.0.38.40)...
Configurazione di linux-image-extra-virtual (4.4.0.38.40)...

Analysis

linux-image-extra-4.4.0-38-generic and linux-image-extra-virtual are now installed with all their dependencies.

Input

sudo apt-get update

Output

Basically it’s always the same…

Analysis

Updated the APT index again…

Input

sudo apt-get install docker-engine

Output

Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze
Lettura informazioni sullo stato... Fatto
The following additional packages will be installed:
  aufs-tools cgroupfs-mount git git-man liberror-perl libltdl7 patch xz-utils
Pacchetti suggeriti:
  mountall git-daemon-run | git-daemon-sysvinit git-doc git-el git-email
  git-gui gitk gitweb git-arch git-cvs git-mediawiki git-svn diffutils-doc
I seguenti pacchetti NUOVI saranno installati:
  aufs-tools cgroupfs-mount docker-engine git git-man liberror-perl libltdl7
  patch xz-utils
0 aggiornati, 9 installati, 0 da rimuovere e 0 non aggiornati.
È necessario scaricare 23,5 MB di archivi.
Dopo quest'operazione, verranno occupati 128 MB di spazio su disco.
Continuare? [S/n] s
Scaricamento di:1 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 docker-engine amd64 1.12.1-0~xenial [19,5 MB]
…
Elaborazione dei trigger per libc-bin (2.23-0ubuntu3)...
Elaborazione dei trigger per systemd (229-4ubuntu8)...
Elaborazione dei trigger per ureadahead (0.100.0-19)...

Analysis

Docker engine it’s now installed!

Input

sudo service docker start

Output

Nothing

Analysis

The docker service is started.

Input

sudo docker run hello-world

Output

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c04b14da8d14: Pull complete
Digest: sha256:0256e8a36e2070f7bf2d0b0763dbabdd67798512411de4cdcf9431a1feb60fd9
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker Hub account:
 https://hub.docker.com

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

Analysis

It works! The hello world image was run successfully!

Adding a docker group

Reference

https://docs.docker.com/engine/installation/linux/ubuntulinux/#/create-a-docker-group

Input

sudo groupadd docker

Output

groupadd: group 'docker' already exists

Analysis

I don’t need to add a docker unix group because it was created during the install.

Input

sudo usermod -aG docker $USER

Output

Nothing

Analysis

The current unix user was added to the docker unix group.
After a logging out and in again I’m able to run docker without sudo like this:

Input

docker run hello-world

Output

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker Hub account:
 https://hub.docker.com

For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

Analysis

It’s done, docker is installed 🙂

Permission error with Gradle on Travis CI

What happened?

I was setting up the continuous integration for a project that used Gradle as build tool on Travis CI.

The first build failed due to a repeated permission denied error running the gradlew wrapper file.

The important part it’s the following:

$ ./gradlew assemble
/home/travis/build.sh: line 179: ./gradlew: Permission denied

The command “eval ./gradlew assemble” failed. Retrying, 2 of 3.

/home/travis/build.sh: line 179: ./gradlew: Permission denied

The command “eval ./gradlew assemble” failed. Retrying, 3 of 3.

/home/travis/build.sh: line 179: ./gradlew: Permission denied

The command “eval ./gradlew assemble” failed 3 times.

The solution

Obviously the first thing to do is searching on google about the problem.

This lead me to this stackoverflow answer, from wich I used the second solution proposed.

Basically the problem is due to the fact that the the gradlew wrapper file it’s not set as executable.

I liked more the solution of adding a before_install call to chmod +x on the file in question.

So from this .travis.yml

I just ended up with:

Which is fine.

Bye.

walk-stats (part 1)

Let’s develop something

Introduction

Sometimes you need to keep yourself busy doing something, so I decided to document the birth and evolution of my next project from the early beginnings to a working stage (hopefully).

I will develop an application to keep track and create statistics on walks I make around here when I have some free time.

There are already programs that basically do the same thing like map my walk, walk log and so on.

I know it’s not nice to answer a question with another one, but to the question why another one? I would simply answer, why not?

This could be an interesting project and I haven’t seen much documentation about the process of developing a project from the beginning.

I’ll try to be as clear as I can and document each choice I make to make some sense of this in the end.

I think doing this could:

  • Keep me busy, making me think about something else.
  • Be an interesting challenge to solve.
  • Make me learn something new.
  • Let me experiment on things.
  • Make my coding skills better.
  • Help somebody who’s curious about anything I’ll talk about here.

First things first!

Well I like to do code while listening to music, so the first thing to do is finding something to listen to.

Getting back home from work I was thinking about the record I.V. by the band Loma Prieta.

I don’t have it on my phone so the choice it’s pretty easy on what to listen to for me, you can buy it by clicking on the links.

Here’s the player from bandcamp if you want to check them out:

What do I want to do?

Programming basically consists of finding ways to solve problems and make a computer do it for you in the best way possible.

What I want to do is to keep track of when I walk and calculate statistics to see how things are going.

That’s basically it for now, later on I’ll try to analyze this in more details and try to find a solution each subproblem to come up with something that would work for me.

Decisions, decisions, decisions…

How to write it?

I like the Java programming language, I also use it every day at my job, so the choice for me it’s pretty easy, using it 🙂

How to call it?

Well this should keep track of my walks and do statistics on them, why not calling it walk-stats?

Sounds reasonable, and it’s not already taken, so be it, welcome walk-stats.

How to release it?

I’m a pretty strange person, I’m a bit of a misanthropist, but I still believe that helping someone who needs it (and while programming you came across a lot of challenges) it’s a nice thing to do.

I also think that more people looking and collaborating at something would make it better.

So I’m releasing the code for this project with the BSD 2-clause license, basically, do whatever you want with this program as long as you keep the license for the code I wrote in source and binary form.

Analysing the problem a bit more in depth

A nice way to attack and solve a problem it’s dividing it in smaller subproblems, as a lot of people said before: divide et impera, it worked then, and still works today.

So from keep track of when I walk and calculate statistics on it, it’s easy to divide it into 2 smaller problems:

  1. Keep track of when I walk.
  2. Calculate statistics on it.

This is helpful  because I can focus on the first problem first and move on with the second part later.

Keep track of when I walk

Questions? Answers!

How can I record data from a walk?

Well, I don’t feel like writing a full pledged gps logger application for my Android phone, I just want to aggregate the data in a unique place and make some computations about it, so Logger GPS for Android would sure do.

It’s open source and the code it’s available on github, free to download from the Google Play Store.

With it I can save data in the GPX format, which is pretty cool.

What’s the data I need to save about each walk?

For now, without worrying too much about it I guess I need to save:

  • The date and time I was walking
  • The actual data GPS positions from the walk

Where can I store that data to make it easily accessible and usable?

Probably in a database, where I can structure the data and query it.

How do I want to see the data?

Well it would be cool to see the actual map with the track on it, so I’ll try to keep it an option. But it’s good enough to see the numbers too as the first release.

Calculate statistics on the data

Other questions and answers

What do I need to compute from the saved data?

It should be useful to see:

  • Total time.
  • Total distance.
  • Average speed.
  • Maximum instantaneous speed.

All of this also from all walks together. (this should be be easy from the single aggregated data).

How do I want to see the data?

Again, graphically a graph would be cool, I’m not a graphic so I would keep that in mind, but just the raw data it’s good enough for the first release.

Let’s start setting up the project

Distributed version control system for the code

I think it’s important to keep the code under version control, it helps focusing on what you’re doing, and all the others nice things like distributed development, versioning, history, rollbacks and so on.

I like git, my code is open so I will use github as the public repository for this project.

I won’t focus much on how git or github works, if you need help there’s a nice documentation about them.

It works like this:

  1. Create a github account
  2. Login
  3. Create a new repository
  4. Add a .gitignore and/or a license and/or a readme if needed
  5. Profit

So here it is, the repository for the project!

That’s it for now, but the fun part is yet to come 🙂 See ya!

JUnit test class names are important with maven

maven-logo-black-on-white

junit-logo

I came across a funny issue on utils (available here) today, basically 2 unit tests were not executed by Apache Maven on Travis CI.

It’s funny beacause it happened to me before, so I knew how to fix this problem.

On my machine I usually run JUnit tests with the JUnit plugin integrated into the Eclipse IDE because it’s nice, green/red, failure log, stacktrace and stuff.

Instead, when calling from the command line mvn test, Maven uses the maven-surefire-plugin to execute the tests. In its documentation it says that the default configuration, which I can’t be bothered to change, is to pick up every file name that matches this expressions:

  • **/Test*.java
  • **/*Test.java
  • **/*TestCase.java

A typo like NullCheckerTests, instead of NullCheckerTest prevents the tests in the class from being executed because the class it’s just ignored during test execution.

The solution it’s easy, following naming conventions, I think it’s nice to call all my test with an ending *Test in the name of the file and class, after all if you’re declaring an xxx test class, so it should be called XxxTest in a file named XxxTest.java.

An example of the problem and the relative solution can be found here.

I thought that sharing this issue could be useful if anybody encountered the same problem.

By the way, because of this issue I released version 1.0.5 of utils.

Utils

Long time, no see.. It’s been a very busy year to say the least.

I always liked to solve problems, to write code and experiment with stuff, so as you do, I developed some personal projects to try out new things.

I usually develop in Java, using Apache Maven as my build and dependency management tool, in my spare time and at my job too. I’ve noticed that I usually keep my general purpose utilities classes under packages like *.utils or *.helper.

This led to a lot of copy-pasted code all over the place. A lot of methods were also untested. I couldn’t even be bothered to look inside the other projects if there was already what I needed, so I ended up re-writing already existent stuff, that’s for sure.

I finally decided that I’m done with this mess.

I started a project called utils, and I choose that it should be open source and available under the BSD 3-Clause License.

The source code is hosted on GitHub and I put the project under continuous integration testing with a service called Travis CI. I use another service called Codacy that provides automated code analysis. I also discovered another service called JitPack looking around for a quick way to share my artifacts online. The home page of JitPack reads “Easy to use package repository for Git” and I can say that’s really great! It uses maven as the build tool, provides artifacts for sources/javadoc and it’s integrated with GitHub release system (just tag your code on git and you’re good to go basically, artifacts are online usually the order of seconds).

All this services are free for open source and it’s a great technological stack to write good code, check them out.

Here’s what i’ve setup for the project:

utils is open source and in development so, of course suggestions, critics, contributions and whatever are welcome.

Debugging a program on the stellaris launchpad board

OpenOCD now supports TI’s stellaris launchpad. Patching it it’s no longer necessary!
The source it’s available here!

After creating a template for the Stellaris Launchpad, I wanted to debug it and my own programs as well.

So I installed openOCD and used gdb (for arm-none-eabi) to debug it and see if it works properly.

I writing here a tutorial to help someone who would like to do the same.

The first thing to do it’s obtaining a compile toolchain, I’m lazy and I use the arm-none-eabi from Codesourcey that’s already built from them and free to use as I described it here.

When you got that working the next step it’s getting the Stellarisware software, the process it’s described here too. (It’s not really needed, but if you want to do something quickly that’s the way to go because the API for it it’s well documented and easy to use).

After doing the previous steps you need to get the source code of openOCD, patch it and build it. You can find how all this born in (this forum topic).

You’ll need git, which you can get on Ubuntu just opening a terminal and typing:

sudo apt-get install git-core

You need to get the latest openOCD source code so type on the terminal:

cd ~/stellaris/
git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd

This will create a directory called openOCD containing all the source files of the project. then you need to install the libraries you’ll need to built it. So again type in the terminal:

sudo apt-get install libtool autoconf texinfo libusb-dev

This tutorial will just focus on the Launchpad board, you’d probably need other libraries if you need to build openOCD for other dongles.

The next step it’s to patch the sources with the latest patch from this archive (thanks Spencer Oliver). The process it’s quite easy and you can choose different methods to do it, I’ll go for the git pull to the project so type:

git pull http://openocd.zylin.com/openocd refs/changes/22/922/10

And git will automatically patch the sources with the latest patch revision.

Then you’ll need to build openOCD, there are plenty of information on the README file, basically I just did this:

cd openocd
./bootstrap
./configure --enable-maintainer-mode  --enable-ti-icdi
make

I skipped the “make install” step.

I then created a directory with the binary file and all the other configurations needed:

cd ~/stellaris
mkdir openocd-bin
cp -r ./openocd/tcl/* ./openocd-bin
cp ./openocd/src/openocd ./openocd-bin

Then you’ll need a .cfg file to pass the openOCD, I used the one this guy made, because I’m lazy (haven’t I told you?). So just make a file called LM4F120XL.cfg in the openocd-bin folder and copy the following in it:

# TI Stellaris Launchpad ek-lm4f120xl Evaluation Kits
#
# http://www.ti.com/tool/ek-lm4f120xl
#
#
# NOTE: using the bundled ICDI interface is optional!
# This interface is not ftdi based as previous board were
#
source [find interface/ti-icdi.cfg]
set WORKAREASIZE 0x4000
set CHIPNAME lm4f120h5qr
source [find target/stellaris_icdi.cfg]

Now a quick check, the openocd-bin folder should contain the following files:

bitsbytes.tcl
board
chip
cpld
cpu
interface
LM4F120XL.cfg
memory.tcl
mem_helper.tcl
mmr_helpers.tcl
openocd
target
test

Now you’re ready to launch it from here with sudo, connect the board to a USB port and just type in the command line:

sudo ./openocd --file ./LM4F120XL.cfg

Now that you’ve got it running open another terminal to download a template project I made, to run it on the board and debug it! So type:

cd  ~/stellaris
mkdir projects
cd projects
git clone https://github.com/scompo/stellaris-launchpad-template-gcc.git

This will clone the project into the stellaris-launchpad-template-gcc folder. You just need to open up the Makefile with any editor and change this:

# Stellarisware path
STELLARISWARE_PATH=~/stellaris/stellaris/

With the path to your stellarisware main folder. Then you can just build your project typing:

make

Then comes the cool part of the process, see if the program it’s running properly, so just connect arm-none-eabi-gdb to open ocd, load the program and see if everything it’s good!

arm-none-eabi-gdb main.axf

This will open up gdb for arm-none-eabi with a target file called main.axf. Next will type to the (gdb) prompt, so let’s do something useful (Again thanks a lot the the stellaristi forum guys for this)!

target extended-remote :3333
monitor reset halt
load
monitor reset init

Now the target processor it’s halted at the beginning of the startup_handler() code of the LM4F_startup.c file. Supposedly this will work fine doing it’s magic, but check it out, and if you find any strange behavior just tell me opening an issue in the github project page. So let’s go on and just set some breakpoints and display some the variables at each break.

b main.c:51
b Timer1A_ISR
display count
c

The c command will just continue the execution of the program from the breakpoint. If you need any help just type help in the gdb prompt window.

Everytime you’ll write c to continue executing the program you’ll see that the variable count will be updated, so basically the interrupt routine it’s running and updating the volatile variable. Well, we’re good then!

To exit gdb just enter “q” and confirm with “y”.

To exit from openocd just use “ctrl”+c like every command line program in linux. I’ve noticed that I need to disconnect and riconnect the board sometimes to restart openOCD so if it’s the case, just go for it doing this.

This would hopefully be a starting point for your own projects, just copy this template folder and start doing everything you want! Good hacking!

A lot of stuff learned!

I’ve been playing around a lot with the Stellaris Launchpad board, looking around the stuff I never noticed that the besides the fact of being licensed with a BSD style license, the Stellarisware SW provided by Texas Instruments has a closed license for the various examples.

The basic files needed to create a program for the board, and basically for all the ARM processors are the following with binutils and gcc:

  • The program you want contained in a .c file.
  • A linker script due to the fact you don’t have an operating system running.
  • A startup code file that zeroes the .bss segment variables, copies the .data segment to ram and setups the NVIC vector table.
  • A Makefile to build everything easily.

The program and the Makefile can be done with not much worries, but the linker script and the startup code are quite difficult, at least for me, to understand and set up properly.

So I ended up building from scratch the whole files needed and licensed them with a BSD license (Basically, do what you want with them, just give me credit I’m happy if someone find them useful, you can contribute, but don’t blame me if it doesn’t work lol)

You can find them in this Github repository

Continue reading “A lot of stuff learned!”

timeTable

I’m fed up with the transportation service of my city, it’s slow and it gives no clue about what bus to catch when you need to go somewhere.

I’m planning to do a web application to use with it and I’m developing a website in Django/Python to implement the timetable with a search for routes.

The final goal will be to put a “I’m here” button which would tell the nearest stop and tell you the next useful bus to catch.

After learning a bit of Python to work with the Tumblr API I’ve noticed that it’s a quite nice web oriented language to use, so I choose it in combination with the Django project and programming dynamic web pages it’s not as bad as I remembered from high school. 🙂

You can find if you want the source files in this Bitbucket repository!

solarPower changes

Basically I’m switching to gEDA, another open source EDA tool, I’m much more used to it!

I have planned to use a small 8 pin Attiny85 microcontroller, wich I’m going to buy from mouser, with a sharp memory display or a normal lcd as interface. The sharp one has the advantage that it’s very low power and with a very good readibility, the other one it’s much more easier to interface, a typical 4/8 bits parallel LCD.

The attiny85 has just 8 pins, so I planned to use a 74HC595 shift register to interface the display with a 4 bit configuration and switch the charging of the battery off when needed.