Webserver and Data Management with a Rasberry Pi

With the Rasberry PI you have a low cost data server at hand to collect and store process data or access central or public data sources. In this post we show how to setup an intial system.

Hardware required:

  • Rasperry Pi 3 Model B (that is what we are using in this project, but any other variant will do also)
  • Micro SD Card 8 GB or more (depending on the amount of data you plan to store).  Adapter to connect SD to MAC.
  • USB Cable (for conection to MAC and USB charger for independent energy supply later on)
  • For downloading the required software and formatting the SD we use a MacBook Pro, but a PC will also do the job.

Software required:

During this proejct we setup the system using the following software components:

  • NOOBS (New Out Of The Box Software)
  • A tool for formatting Micro SD cards
  • An Operating System for the Raspi: NOOBS LITE offers RASBIAN as the default option, which we also recommend for dataintensive applications

 

 

Step 1: Operating System

Startup your MAC and download NOOBS LITE.

https://www.raspberrypi.org/magpi/beginners-guide-noobs/

Get and install a suitable SD Card formatter for your MAC from sdcards.org https://www.sdcard.org/downloads/ and format SD Card.

Unzip and copy all NOOBS file onto to SD card.

Remove SD card  from your MAC/PC and put it into Rasperry PI. Connect the Raspi to a Monitor and a Keyboard and start up raspi, foolow the instructions connect to entwork and install RASPIAN.

When successful the Rasberry Pi will restart and boot up the new operating system.

Step 2: Webserver

We recommend the apache webserver. Detailled instructions you will find under this link:

Apache web server: Build a local HTML server with a Raspberry Pi

Short instructions: Open the command line on the raspi and enter the following line of code:

sudo apt-get install apache2 -y

Step 3: Database

Finally we setup  MYSQL and PHP as our pimary programming laguage and database management system. Dpeneding on the release available you may have to adjust to the version of PHP currently available.

sudo apt-get install php7.0 mysql-server -y

With this you have a small scale server enviroment ready to operate non-mission critical data. Have Fun!

 

OPTIONS

Enable access to https sites:

https://wiki.debian.org/Self-Signed_Certificate

3 essential steps before deploying a Step 7 project in TIA Portal

A very useful post from the Blog of DMC Inc. if you use one of the latest Siemens PLCs (1200, 1500).

These three hints will make your life a lot easier:

https://www.dmcinfo.com/latest-thinking/blog/id/9594/3-essential-steps-before-deploying-a-siemens-plc-project

This article gives advise on how to configure your PLC to startup in RUN mode, with a Webserver and how to not get locked out from the HMI.

Enjoy!

European Robotics Companies

The most promising European Robotics companies are listed here:

As mentioned already in a post before, we see Universal Robots as the leader in the promising field of collaborative robotics. In almost every research institute you visit, you will come across one of these species made in the land of Lego.

Universal Robots

Headquarters: Odense, Denmark

Technology Focus: Collaborative Robots (market leader)

Mission: When we say the UR robot can automate virtually anything we mean virtually anything – from assembly to painting, from screw driving to labeling, from injection molding to welding and from packaging to polishing.


It is always worth to have a closer look when the BOSCH foundation starts something new.

Deepfield Robotics

Headquarters: Renningen, Germany

Technology Focus: Autonomous machines to improve conventional and organic weed management.

A Bosch Startup initiative, which is still in the development phase. Linked to the Deepfield-Connect business, which sells connected sensor devices for agricultural applications.


ABB offers a wide range of pick-and-place, 6-axe and collaborative robots.

ABB Robotics

Headquarters: Zurich, Switzerland

ABB is a leading supplier of industrial robots, modular manufacturing systems and service. A strong solutions focus helps manufacturers improve productivity, product quality and worker safety. ABB has installed more than 250,000 robots worldwide.


Kuka has been recently sold to Chinese Investors, but still having an European headquarter. Their orange robotic arms are very popular in automotive factories around the world.

KUKA Robotics

Headquaters: Augsburg, Germany

Technology Focus: As a specialist in the field of robotics and automation technology, KUKA Robotics is one of the leading manufacturers of industrial robots. With its wide selection of robots, KUKA covers virtually all payload ranges and robot types, and sets standards in the field of human-robot collaboration (HRC)


Not a company per se, but more of a EU Robotic Networking innitiative:

EU Robotics

Headquarters: Brussels, Belgium

Focus: The objectives of euRobotics are to boost European robotics research, development and innovation and to foster a positive perception of robotics.

Power consumption of autonomous IoT devices

Evaluation of the power consumption of an autonomous IoT device

The popular Arduino Uno micro-controller  in combination with GSM/GPRS shields based on the SIM900 chip are quite popular as prototype platform for new developments or autonomous IoT systems. The main challenge to implement a true energy autonomous system is the considerable energy demand of this components if you use them out-of the-box. Data sheets and other supplier information give no or only limited information of the true power requirements.

An evaluation project from CADEMIS determined the energy requirements of a basic setup which might be a useful  indication for the design of related IoT systems.

System Setup:

In order to determine the energy consumption a simple system setup was used to determine the current at a 12 Volt battery.

Wiring Schema

A control program  implemented in the Arduino IDE  switches between four different states:

1: GSM board OFF, Onboard LED ON

2: GSM board OFF, Onboard LED OFF

3: GSM board ON, Onboard LED OFF

4: GSM board ON, Onboard LED ON

Between the states a delay of 10 seconds was implemented in order to get a steady reading on the Ampere-meter.

Components:

Arduino Source Code:

The source code for Arduino IDE 1.6.13 to switch between the four states mentioned above:

Source Code Power Consumption Evaluation

Measurement Results:

GSM Shield LED Current / mA Power / mW
OFF ON 54 mA 648 mW
OFF OFF 44 mA 528 mW
ON OFF 68 mA 816 mW
ON ON 80 mA 960 mW

Special remark on switching on the GSM Shield: When switching on the board (between state 2 and 3) the power consumption is between 70 mA and 220 mA for about 5 seconds. As mentioned in several posts in forums causes every switching operation a significant peak in current and power.

Summary:

It is strongly recommended to switch off unused loads in order to reduce the power consumption by up almost 50% for a simple setup like this. This can double the operation-time between battery reloading or reduce the solar power requirements and costs.

References:

  • Thanks to the girls and guys from Geeetech for publishing the basic information on how to control the SIM900 board:

http://www.geeetech.com/wiki/index.php/Arduino_GPRS_Shield

CODESYS News

Here you find the latest news on the CODESYS development system from 3S-Smart Software Solutions GmbH:

CODESYS for Rasbery PI

Now you can even run you PLC program on the popular Rasbery PI platform. Available from the CODESYS website you can download the required software for EUR 50. A limited free demo version works for two hours.

http://store.codesys.com/codesys-control-for-raspberry-pi-sl.html 

Have a look and enjoy the brave new PLC world. Looking forward to hear from your adventures and experiments with this new tool for (serious) Makers.