From OpenSCADAWiki
Jump to: navigation, search
This page contains changes which are not marked for translation.

Single-board computers Raspberry Pi from the Raspberry Pi foundations
Begin: 08 (August) 2012
Participants: Roman Savochenko
Description: "Raspberry Pi®" is a single-board computer created for charity purposes. Designed to teach basic computer science in schools, positioned as a low-cost solution for novice developers. Developed by "Raspberry Pi Foundation". First board of Raspberry Pi was got to assembling and adaption of OpenSCADA from Maxim Lysenko. The board Raspberry Pi2 was purchased for tasks of OpenSCADA and adapting it to work with generic buses like I2c, SPI, 1Wire with different sensors on its. The board Raspberry Pi3 was purchased and sponsored by Proviron Holding NV for some debug and technical support.

RaspberryPi.png
Parameters: Raspberry Pi Raspberry Pi2 Raspberry Pi3
Hardware platform: ARM11 (ARMv6) ARMv7 Cortex A53 (ARMv8)
Central processor: Broadcom BCM2835, 700 MHz Broadcom BCM2836, 900 MHz, 4 Cores Broadcom BCM2837 64bit, 1.2GHz, 4 Cores
Memory: 256/512 MB, integrated to CPU 512 Mb or 1Gb, integrated to CPU 1Gb, integrated to CPU
Solid memory: flash card MMC flash card MicroSD
Video subsystem: integrated video core Broadcom
Audio subsystem: integrated to CPU
Electrical power: microUSB, 5V, from 700 mA microUSB, 5V, up to 2.4A
Interfaces: 2xUSB, Ethernet 10/100M, HDMI, video RCA, Stereo Jack 3.5 mm, UART, JTAG, SPI, I2C, DSI, CSI 4xUSB, Ethernet 10/100M, HDMI, video RCA, Stereo Jack 3.5 mm, UART, SPI, I2C, DSI, CSI 4xUSB, Ethernet 10/100M, WiFi 802.11 b/g/n, Bluetooth 4.1 LE, HDMI, video RCA, Stereo Jack 3.5 mm, UART, SPI, I2C, DSI, CSI
Weight: 45 g.
Size: 85.6 × 53.98 × 17 mm

RaspberryPi openscada.png

Raspberry Pi
For working the board used special distributive Raspbian "Wheezy". Building OpenSCADA was done for LTS version 0.8.0.5 and Work version 0.8.1 direct on the board. For building had to expand swap memory size to 500 Mb due more memory need for some modules of OpenSCADA building by modern compiler (GCC 4.7) and with optimization (-O2). Result packages successfully installed and operation.

Graphical desktop environment into selected distributive built on LXDE 0.5.5, displayed in full resolution of the display through HDMI, or in resolution 640x480 through composite video-output. OpenSCADA successfully have started and have worked into graphical mode, but its performance insufficient for normal dynamic models of OpenSCADA execution.

Raspberry Pi 2 and 3
For working with the boards there also used a special distributive Raspbian "Wheezy". OpenSCADA has built for Work version 0.9 direct on the board and allowed memory here enough for this operation but it has 1MB and more, the building there allowed on all four threads. The building of OpenSCADA performs in packages which then placed into proper repository of Debian 7 from time to time of the buildings. Also for Raspbian "Jessie", mostly for the generic architecture ARMHF, there performs regular building of OpenSCADA by the OpenSCADA automatic builder into the cross-compiling environment and the result packages are placed into proper repository of Debian 8.

The typical graphical desktop environment into the selected distributive built on LXDE 0.5.5 (Wheezy) and 6 (Jessie) but it's replaced to TDE R14 for more features with low hardware demands. For remote access there was configured VNC access in display resolution 1024x768. OpenSCADA is successfully started and worked into graphical mode and the performance here enough already by the multi-threading.

RaspberryPi TDE.png

For more free handling to the board was connected a WiFi adapter and on RPi3 it presents already.

To allow for operations with GPIO directly in OpenSCADA there was created a module DAQ.GPIO based on the library bcm2835. For now the module provides access to "Raspberry Pi" GPIO (0...31) as OpenSCADA DAQ's parameter attributes, static and dynamic functions, which the comparing information of performance shown here.

RaspberryPi experiments.jpg

To the board there was connected a 16x2 text display 1602A and a program like to the original Python one was wrote into OpenSCADA by using the static functions of the module DAQ.GPIO. As a result the program works fine and some faster to the Python original one.

To the board there were directly connected sensors DHT 11 and AM2303 (humidity and temperature) and a program like to the original Python program's C-language driver part was wrote into OpenSCADA by using the static functions of module DAQ.GPIO.

To allow creation derivative DAQ templates with their configuration the dynamic linking to static external functions was added into DAQ.JavaLikeCalc, like this:

function put = addr+".fnc_put";
if(put) {
  put(D4, vl&0x10);
  put(D5, vl&0x20);
  put(D6, vl&0x40);
  put(D7, vl&0x80);
}

To allow operation in OpenSCADA with devices on bus I2C the output transport "Serial" was adapted to the bus by selection the bus and a slave device's address (first byte of the sequence) set by IO control command I2C_SLAVE. In this way now to OpenSCADA there were connected:

  • The 8-bit A/D and D/A converter chip PCF8591. Through the chip PCF8591 were connected sensors LM35 and LM335.
  • The 8DIO converter chip PCF8574, which also adapted and tested for connection to 1602A.
  • The barometric pressure/temperature/altitude Sensor BMP180.
  • The memory chips AT24CXX by calls through the proper protocol.

The tracing task of the work out opened here.

Orange Pi Zero
For working with the board there used a special distributive Armbian "Jessie". As builds of OpenSCADA there have used the packages repository, mostly for the generic architecture ARMHF, for which performs regular building of OpenSCADA by the OpenSCADA automatic builder into the cross-compiling environment.

The board provides more low level buses (3xUART, 2xSPI, 2xI2C), despite its small size, and restricted GPIO in 16 pins which mostly used by the buses. The buses are standard but GPIO are some specific ones for which we need implement special support into the presented module DAQ.GPIO making it more unified one. Then there planed next tasks:

  • connect a device to the I2C bus;
  • connect a device to the Serial bus,
  • try to adapt 1Wire (DS9097) to the Serial buses;
  • the specific GPIO support implement for OpenSCADA;
  • WiFi driver fix/update.