Blog

API Bindings and package management

In the past our API Bindings installation and usage guides did assume that a user already knows one of our languages. In the last days we improved the old documentation considerably. It should now be possible to to install the API Bindings and test an example as a novice without having to look it up anything somewhere else.

You can find links to the usage and install guides for each language in our documentation.

One suggestions we got very often in the past was to use packages and package repositories for languages that have this feature. At first we didn’t like the idea since all of our Bindings are automatically generated and uploading a package to a repository adds an otherwise unnecessary manual step to the process of releasing new Bindings.

However, we got so many requests that we decided to add packages to repositories where it is easily possible for us. Currently we support Maven (Java), NPM (JavaScript), CPAN (Perl), PyPI (Python) and GEM (Ruby). This means, that you can install and update the Bindings for each these languages with one simple command line one-liner.

https://www.tinkerforge.com/static/img/_stuff/repo_logos.jpg

Java - Maven

Add dependency to your pom.xml

JavaScript - NPM

> npm -g install tinkerforge

Perl - CPAN

> cpanm Tinkerforge

Python - PyPI

> pip install tinkerforge

Ruby - GEM

> gem install tinkerforge

First LiveHacking in Hamburg

As we already wrote in the blog, the first LiveHacking in Hamburg took place yesterday:

https://www.tinkerforge.com/static/img/_stuff/live_hacking.jpg

It was organized by the Java User Group Hamburg, Sven Ruppert (Codecentric AG) and Alexander Bischof. Bastian was there to attend the event. The participants where invited in the accommodations of the “Hacker- und Makerspace Attraktor e.V” and could realize their ideas with the Tinkerforge building blocks. It was very nice to look over their shoulders and to discuss different ideas and possible improvements with the participants. We already released some of the suggested improvements today.

Sven has also written an article about the event. You can find it here (in German) .

More LiveHackings will take place all over the country. We will support Sven Ruppert on these events. Many thanks for all the positive feedback and the ideas for improvement! We look forward to the next events.

LED Strip Bricklet supports WS2811 and WS2812(B)

With the new firmware version 2.0.4 the LED Strip Bricklet now also supports the LED drivers WS2811, WS2812 and WS2812B (sometimes also called “NeoPixel”) additionally to the already supported driver WS2801.

The tested it with different LED strips as well as a 256 Pixel LED matrix from different manufacturers.

https://www.tinkerforge.com/static/img/_stuff/ws2812b_led_matrix.jpg

At the Maker Faire we also had a WS2812B strip connected to a RED Brick which was running two days straight without any hickups. The tutorials in the documentation has also been updated accordingly. It now also describes how you can connect the newly supported drivers (the clock line is not used anymore).

LiveHacking with Tinkerforge

https://www.tinkerforge.com/static/img/_stuff/jug_hamburg.jpg

There will be a whole series of events about “Tinkerforge and IoT” in different cities of Germany and around the World in the coming months. The first event will be on the 7th of July in Hamburg. The series of events is called LiveHacking and will be managed by Sven Ruppert. You can attend for free, a description can be found here (German).

Sven works for the Codecentric AG and does lots of lectures at Java User Groups (JUGs) and he writes for Jaxenter and EclipseMagazin. Currently he is engaged in “Internet of Things”. While searching for appropriate hardware for his events he found the Tinkerforge building blocks, which he will use to familiarize people with Java8 in the context of IoT.

Bastian (from Tinkerforge) will also be present at the event in Hamburg, which is unfortunately already booked out. More LiveHackings are however planned.

RED Brick Software Infrastructure

In the past we only wrote about the hardware of the RED Brick. Today we want to discuss the software infrastructure of the RED Brick.

Attention: This article discusses the technical details of the software of the RED Brick. This detailed background knowledge is not necessary to use the RED Brick in its final stage!

The following graphical overview shows the currently planned software infrastructure. This infrastructure will be explained in this blog post.

https://www.tinkerforge.com/static/img/_stuff/red_brick.png

Overview

The colors in the graphic have the following meaning:

  • Blue: Tinkerforge software components

  • Green: Tinkerforge hardware in the Stack of the RED Brick

  • Purple: Tinkerforge hardware externally connected

  • Orange: External software components

The stack, as well as Mini USB and USB A, are shown as the interface between the RED Brick and the environment in the graphic.

The Mini USB connection is used to provide a composite USB gadget driver with two USB classes: The first class is a serial port. It can be used to get easy shell access to the RED Brick. The second class is the Brick API. A PC will see a RED Brick that is connected through USB the same way as any other Brick. The RED Brick has an API like other Bricks and Bricklets. With this API the RED Brick can be configured. The configuration consists of the transfer of the user program, configurations for the program execution (programm is started once, every hour, on startup, etc.), as well as other configurations. Thus the RED Brick can be seen as a black box that controls Bricks and Bricklets with high level languages.

Over the stack connectors it is possible to use all Bricks as well as the Ethernet Extension and RS485 Extension with the RED Brick. For the Ethernet Extension we have to write a driver. This driver will show the Ethernet Extension as a normal Ethernet interface in the linux system (eth0).

With the USB A connector you can use any USB devices (mouse, keyboard, WIFI stick) and of course also other Tinkerforge hardware.

All of these connections can be used at the same time. A RED Brick stack that is connected to a PC via Mini USB, uses Bricks and Bricklets, uses more Bricks and Bricklets through the RS485 Extension, is connected to the Internet through the Ethernet Extension and has other devices connected over USB A is possible without problems.

In the following we will introduce the components that are necessary for this system:

Linux distribution

The Linux distribution of the RED Brick is based on Debian. It is already making very good progress. The Linux kernel configurations that are necessary for the components (RAM, power supply) and the interfaces (USB Mini/A, HDMI, SD card, SPI/I2C/UART in the stack, GPIO, LEDs, etc.) are done. All of the Tinkerforge Bindings and the necessary compilers and interpreters are preinstalled in the distribution. Additionally the most important libraries for all of the supported languages are preinstalled, this allows the development of more complex applications.

Further more it possible to create two images:

  • Full image: This image makes all possible functions of the RED Brick available, including the graphics driver for OpenGL and graphical output via HDMI.

  • Fast image: This image is designed for maximum speed. For example the GPU is turned off in this image, which reduces the boot time significantly.

With the full image the RED Brick acts as a PC replacement. With the fast image the RED Brick is more of a substitute for the Master Brick that has an OnDevice API for C/C++, C#, Delphi/Lazarus, Java, JavaScript, MATLAB/Octave, Perl, PHP, Python, Ruby, Shell and Visual Basic .NET.

Status: 100%

SPI stack communication

The communication between Bricks in the stack is done over SPI. The currently used protocol, which is used between Bricks, is made for the SAM3S4 processor that is used by the Bricks. This protocol is very efficient, but it would bring the Linux system on the RED Brick to its knees. The solution for this problem is to use DMA, the processor is not burdened by the communication if DMA is used. The protocol that is currently used is not compatible to DMA. Thus we have to design a new SPI protocol that is compatible to the DMA controller of the SAM3S4 processor as well as the A10S processor that is used on the RED Brick. This protocol then has to be implemented on the RED Brick as well as all of the other Bricks.

Status: 25%

The new protocol is completely laid out and the implementation for the SPI slaves is finished. Currently we are implementing the SPI master driver for the RED Brick. It looks like we will be able to use /dev/spidev, which simplifies the development since it can be done completely in the Brick Daemon. If we get performance problems we can easily transfer the relevant parts directly into the Linux kernel.

RED Brick API Daemon

The RED Brick API Daemon is a daemon that implements the API of the RED Brick. That means it implements the configuration that can be done over Mini USB.

Status: 25%

The most important components of the API are laid out and the necessary infrastructure (communication with Brick Daemon etc) is implemented.

Composite USB Gadget Driver

The composite USB gadget driver makes two interfaces available over Mini USB. Through this driver the RED Brick is seen as a “normal Brick” on the PC. It is however possible to get shell access to the Linux on the RED Brick at the same time.

Status: 100%

The driver is ready and functional.

User Interface

The goal is to be able to configure the RED Brick with the Brick Viewer. The API of the RED Brick only needs to be used by “power users”. The “normal user” can use the Brick Viewer to transfer his program to the RED Brick.

Status: 0%

The implementation of the user interface has not yet started.

Ethernet driver (W5200)

The Ethernet Extension uses the WIZnet W5200 IC for Ethernet communication. There is unfortunately currently no Linux kernel driver available for this IC. But there are drivers available for the very similar W5100 and W5300, which will simplify the implementation of the driver greatly.

Status: 0%

The implementation of the Ethernet driver has not yet started.

RS485 Extension support

Support for the RS485 Extension has currently a low priority. We will start with the implementation after the RED Brick is officially released.