Docker ~01 Docker and Raspberry Pi

Today I tried to install Docker on my Raspberry Pi 3 board to check how it will work, just for testing purpose. And you know what? It works very nice. First of all, I install Raspbinan Jessie Lite on SD card. For this point, I log in on a fresh installation and make the system update. After update list of repositories, I made the update of the whole raspberry:

Next step is to install Docker directly from the Docker website for ARM architecture.

This process will take a few minutes. After installation finished we will see the latest installation of Docker and that is running on ARM architecture:

Installation process suggests us to use user pi and add them to docker group. This will allow us to run docker command without using the sudo command.

To check that Docker demons are running we can use: sudo docker info

As you can see docker demons are running. After running classic: sudo docker run hello-world docker can’t find hello version:

The container didn’t start. This problem appears due to incompatible between two architectures: ARM and x86. To solve this problem the best way is to find Docker image that can be run on ARM architecture. So how can we find this image?

The best way is to find an image on Docker Hub. Searching for: ARM or RPI.

Another way is use Docker build to build our own Docker images for Raspberry. To create simple Dockerfile we must create the build directory, and in this folder placed Dockerfile that in my case contains:

To run Docker build: sudo docker build -t /rpi-java8 .
The build will take a while. After finish, we can check by using: sudo docker images. This will list:

To run created Docker image we can use: sudo docker run -it /rpi-java8. But this displayed all options for java because I didn’t specify anything. After adding some variables like: java -version we can see:

Raspberry pi 3 and LCD TFT 3,2” 320x240px GPIO

A few days ago I bought a LCD TFT 3.2 ” 320x240px GPIO my Raspbbery pi 3. After unpacking and application LCD TFT 3.2 ” 320x240px for GPIO GPIO pins raspberry in the screen light up a bright light but not seen at all boot the system, or even Raspbian desktop. After formatting the SD card and re-uploading Raspbian still I had the same problem. I started to look for solutions and it turned out that the manufacturer of TFT LCD 3.2 ” 320x240px GPIO controller provides the Raspbian – some older version. It even has the iso image with a preinstalled driver.  Despite the changes in the configuration: raspi-config and rebooting system problem with the display of anything still remained unresolved.

Below aI put some steps that help to run and use LCD TFT 3,2” 320x240px GPIO.

  • Expand Filesystem
  • Select from Boot Options: B4 Desktop Autologin Desktop GUI, automatically logged in as ‘pi’ user
  • From Advanced Options choose:
    • AA GPIO Server
  • Download driver from manufacturer web page
    • Driver
    • Unzip zip file:
      tar xvf <file>
    • Go to: LCD-show catalog
    • Run:
      ./LCD32-show
  • Reboot system

After this steps, we should see desktop displayed on the screen. It takes me some time to figure out that documentation doesn’t say about one step, run GPIO Server. It should be obvious but for a person, that first time tries to use LCD it not very clear. And one more thing is better to just install new Raspbian on SD card and download and install driver, then download iso image with preinstalled driver. From my experience, only one iso image that I download was booting.


References:

Most useful Raspberry Pi shell commands

Raspberry pi offers to install many Linux distributions. On Linux you can use commands to save your time and become more powerful in you work environment. Below I put some useful command:

  • apt-get update: update raspberry pi system version
  • apt-get upgrade: upgrade all packages installed on raspberry pi
  • clear: clear all logs in console
  • startx: command allows to start graphics user interface
  • reboot: allows to reboot system immediately
  • shutdown -h now: shutdown immediately
  • power off: allows to shutdown machine
  • data: prints current data
  • shutdown -h 03:33 : shutdown at 3:33
  • apt-get install nano: install nano editor – nano online documentation

Network commands:

  • ifconfig: allows you to check: IP address, wireless connection
  • iwconfig:
  • nmap: software that allows to scan:
    • network and list connected devices
    • port number
    • protocol
    • state: open or closed operating system
    • MAC address
  • ping: allows to send ICMP echo request packet to network host
  • wget: allows to download file from Web and saves to current directory

System information commands:

  • df: displays statistics about the amount of the free space on the specified filesystem
  • free: display how much free memory is available
  • hostname: display name of the current host

Search commands:

  • grep: allows to search inside files certain search patterns. Support regular expressions which allows special letter combinations to be included in the search
  • awk: programming language useful for search and manipulating text files
  • find:  allows to search a directory and subdirectory for file matching certain patterns
  • whereis: allows for location or a command
  • history: allows to display list of commands typed in console

Feedbacker – mini greenhouse

A few days ago I order mini greenhouse online shop. During my participation in #dajsiępoznać competition on which I wrote here. Finally my order came:

1 2

3 4

With the submission of its entire greenhouse I have no major problems. One thing that surprised me is that the included missing screws on greenhouse walled. When purchased whole, I thought that I would receive a complete set. One screw or two should solve the problem.
The second issue appeared when I complete whole greenhouse. Box is not tight, which will affect the measurement:

  • temperatures
  • humidity
  • pressure
  • air gas concentration

The greenhouse is not large dimensions. It is quite small, and its dimensions are:

  • width: 45 cm
  • depth: 22 cm
  • height: 35 cm

Despite a few flaws, it is suitable for prototype on which you can experiment.

Raspberry Pi Models

It’s time to look for some Raspberry Pi. There are several versions of which I will try to compile and compare. Personally, I’m in possession of versions 1 and 2. On third version I will have to wait a bit. With the first two versions of Raspberry Pi I already have some experience. Starting from building test environment, which by the way was fatal to the first version, and my patience, robot arm, environment to automate building small application builds, small radio, neighborhood monitoring system and ending with the media server. But about this, I’ll write another time.

So let’s start from the beginning. Below I put table with compilation technical specifications various versions of raspberries:

Model Raspberry Pi 3 model B Raspberry Pi 2 model B Raspberry Pi 1 model B
Release 3 – 2016 2 – 2015 2 – 2012
Procesor chipset Broadcom BCM2837 64-bit Broadcom BCM2836 32-bit Broadcom BCM2835 32-bit
Operating system Linux, RISC OS, FreeBSD, NetBSD, Plan 9, Inferno, AROS, Windows 10 loT Linux, RISC OS, FreeBSD, NetBSD, Plan 9, Inferno, AROS, Windows 10 loT Linux, RISC OS, FreeBSD, NetBSD, Plan 9, Inferno, AROS
Timing 1,2 GHz 900 MHz 700 MHz
Architecture ARMv8-A ARMv7-A ARMv11-A
RAM Memory 1 GB DDR @ 400 MHz 1 GB DDR @ 400 MHz 512 DDR @ 400 MHz
GPO JACK 40-pin (2×20 pin)
raster 2,54 mm
40-pin (2×20 pin)
raster 2,54 mm/td>
40-pin (2×20 pin)
raster 2,54 mm
Power supply 5,1 V / 2,5 A microUSB 5,0 V / 1,8 A microUSB 5,0 V / 2,0 A microUSB
Board dimensions 85 x 56 x 17 mm 85 x 56 x 17 mm 85 x 56 x 17 mm
USB Inteface: 4x USB 2.0 4x USB 2.0 2x USB 2.0
Network Interface: Ethernet 10/100 Mbps Ethernet 10/100 Mbps Ethernet 10/100 Mbps
WiFI 802.11 b/g/n 150 Mbps none none
Bluetooth Low Energy, BLE 4.1 none none
Camera CSI port CSI port CSI port
Touch screen DSI port DSI port DSI port
Video HDMI HD 1080px / 30 fps/td> HDMI HD 1080px / 30 fps HDMI HD 1080px / 30 fps
Communication UART, SPI, I2C, GPIO UART, SPI, I2C, GPIO UART, SPI, I2C, GPIO

Raspberry pi 1

 998-11 998-14

Raspberry pi 2

2358-01 2358-03

Raspberry pi 3

3055-06 3055-08

To be able to take full advantage of the Raspberry Pi acquire a suitable equipment:

  • Charger 1 A
  • HDMI cable
  • memory card, at least 4 GB
  • keyboard, mouse
  • display
  • prototype board

Raspberry Pi philosophy is very simple. A small board which became the foundation of education at low cost, as well as the driving force behind many projects, both amateur and professional. With each new release of Raspberry Pi, it is becoming more efficient and faster. Definitely I will use Raspberry pi in my next project, but I will  write about it soon.


Reference: