Homepage Wiki Forum Buy

Web application

From GNUBLIN

Schwierigkeitsgrad Voraussetzung Gnublin Familie
Gnublin logo easy.png Network basic configuration, browser, commandline All

The last version of the Gnublin-Distribution contains a complete web application demo, to show you how to make your own

Webdemo all.jpeg


Contents


Preparation

There must be a WLAN/LAN/USB-GADGET connection established to the host-computer and the packet php5-cgi has to be installed in order to run the web application if the packet isn't installed yet, you can do this with the following command:

apt-get install php5-cgi

afterwards php has to be configured with the following commands:

lighty-enable-mod fastcgi
lighty-enable-mod fastcgi-php


Usage of the application

The application is pre-installed and can be called as follows:

gnublin-webdemo -i

This command initialises the drivers for a port-expander, a dogm-display, a stepping motor and a LM75 temperature sensor and prepares the filessytem and webserver lighttp, so that the functions of the web application can be used.

furthermore the /var/www directory will backed up.

If you don't own a port-expander or a relay-module the following error messages occur on initialisation:

/usr/bin/gnublin-webdemo: line 136: echo: write error: Invalid argument /usr/bin/gnublin-webdemo: line 137: echo: write error: Invalid argument /usr/bin/gnublin-webdemo: line 138: echo: write error: Invalid argument /usr/bin/gnublin-webdemo: line 139: echo: write error: Invalid argument /usr/bin/gnublin-webdemo: line 140: echo: write error: Invalid argument /usr/bin/gnublin-webdemo: line 141: echo: write error: Invalid argument /usr/bin/gnublin-webdemo: line 142: echo: write error: Invalid argument /usr/bin/gnublin-webdemo: line 143: echo: write error: Invalid argument

These error messages are not bad. They just say, that no port-expander or relay-module is connected. Only the GPIO-demo doesn't work then.


If you want to remove the webdemo and reload the backup of the /var/www directory, you can do this with the following command:

gnublin-webdemo -r

If you don't own a port-expander or a relay-module the following error messages occur on removing the webdemo:

/usr/bin/gnublin-webdemo: line 194: echo: write error: Invalid argument /usr/bin/gnublin-webdemo: line 195: echo: write error: Invalid argument /usr/bin/gnublin-webdemo: line 196: echo: write error: Invalid argument /usr/bin/gnublin-webdemo: line 197: echo: write error: Invalid argument /usr/bin/gnublin-webdemo: line 198: echo: write error: Invalid argument /usr/bin/gnublin-webdemo: line 199: echo: write error: Invalid argument /usr/bin/gnublin-webdemo: line 200: echo: write error: Invalid argument /usr/bin/gnublin-webdemo: line 201: echo: write error: Invalid argument

These error messages are not bad.

Call the application

First you have to find out, what IP-Address your Gnublin has:

ifconfig

then you just insert the IP-Address in the adress bar of your browser and hit enter.

Range of functions

  1. with the GPIO-Demo menu item you can switch the first 8 ports with the I2C address 0x20 of a port expander on or off.
  2. with the item 'Datenlogger' you can log the temperature-data of a LM75-module
  3. at the 'Display' item you can write a text to the LCD Display. You send the written text by pressing 'enter'.
  4. 'Schrittmotor' allows you to control a stepping motor

Attention: the I2C-address for the command of the stepping-motor is preconfigured as 0x76, the default address of a stepping motor module is 0x60 If you want to control a stepping motor with the 0x60 address you just have to change the file stepper.php in the /var/www2/pages directry at line 32.


exec("/usr/bin/gnublin-step -a 0x76 -p $value"); becomes: exec("/usr/bin/gnublin-step -a 0x60 -p $value");


Demo

Here you can see the web-application in action

GPIO-Demo

Webdemo gpio.jpeg

Stepping motor-Demo

Webdemo stepper.jpeg

Temperature-Demo

Webdemo temp.jpeg

Display-Demo

Webdemo display.jpeg

In other languages