4.3 Web control

The Internet is a global system of interconnected computer networks that use the standard Internet protocol suite (TCP/IP) to serve several billion users worldwide. It is a network of networks that consists of millions of private, public, academic, business, and government networks, of local to global scope, that are linked by a broad array of electronic, wireless and optical networking technologies. The Internet carries an extensive range of information resources and services, such as the inter-linked hypertext documents of the World Wide Web (WWW), the infrastructure to support email, and peer-to-peer networks.

Writing text messages and emails, surfing the web, making phone calls – all these things can be a real challenge for people with disabilities. And that applies all the more to wheelchair users with impaired motor skills in their hands and to severely disabled people, who are dependent on communication aids to be able to operate electronic devices without difficulty.

The internet control module aims at complete connectivity of the wheelchair to the internet of things and hence providing an endless list of services to the user.

4.3.1 Features offered:

  • Monitoring of vital signs of patient.
  • Alerts the caretaker/hospital under critical conditions.
  • Allows communication for patient with people by using facilities like Skype/voice chat/video-chat.
  • Wheelchair as a part of internet of things - 24x7 connectivity
  • Service assistance provided for user.
  • Maintain database of health condition.
  • Semi-automated navigation assistance with preloaded maps.

4.3.2 Working:

WebIOPi Web Server runs on the Raspberry Pi. This makes our Raspberry Pi a virtual host.

On the Webserver there exist the html files which form the backdrop for our website.

www.smartwheels.mooo.com

Website: The website is built in HTML5. The website provides the following options:

  • Control buttons using which the wheelchair could be navigated.
  • Web camera streaming window which gives the live view of the robot’s surrounding.
  • Login: Provides access to control the wheelchair from remote locations based on the user.

4.3.3 WebIOPi

Webiopi is uses a REST API Architecture and an Apache 2.0 server license. It is used to control the Raspberry pi over LAN and WAN, WebIOPi includes an HTTP server that provides both HTML resources and a REST API to control things. Your browser will first load a HTML file, then the included Javascript will make Asynchronous calls to the REST API to control and update the UI. This method is very efficient, because it don't need to refresh and download the whole page.

Figure 19: WebIOPi Server Structure

4.3.3.1 Installation

WebIOPi is developed and tested on Raspbian. You only need Python, either 2.7 or 3.2. Download, then extract and install WebIOPi. The setup script will automatically download and install required dependencies using apt-get. You may have to manually install GCC and Python development headers if you are not using Raspbian. Stop your existing WebIOPi service, then process with the setup. Your configuration will be kept but others files will be override.

tar xvzf WebIOPi-x.y.z.tar.gz cd WebIOPi-x.y.z sudo ./setup.sh

4.3.3.2 Running WebIOP

sudo webiopi [-h] [-c config] [-l log] [-s script] [-d] [port] Options: -h, --help Display this help -c, --config file Load config from file -l, --log file Log to file -s, --script file Load script from file -d, --debug Enable DEBUG Arguments: port Port to bind the HTTP Server

4.3.3.3 Running WebIOPi (Daemon)

You can also start/stop the background service, the configuration will be loaded from /etc/webiopi/config.

$ sudo /etc/init.d/webiopi start

$ sudo /etc/init.d/webiopi stop

4.3.3.4 Usage

While directly using your Raspberry Pi with keyboard/mouse/display plugged, open a browser to http://localhost:8000/

While Raspberry Pi is connected to your network, a new browser could be opened to http://raspberrypi:8000/ with any device of your network. Replace raspberrypi by its IP.

You can even add a port redirection on your router to use WebIOPi over Internet (forward port 8000 with IP of raspberry pi).

Default user is "webiopi" and password is "raspberry"

The WebIOPi behaviour is extended by loading custom Python script using an Arduino like syntax with setup/loop functions

The customization process has 3 steps:

  1. Write a simple Python script to initialize the GPIO and handle auto on/off
  2. Write a simple HTML/Javascript page
  3. Configure WebIOPi Server

4.3.3.5 Configuration

  1. Edit /etc/webiopi/config :
  2. Locate [SCRIPTS] section, add following line to load your Python script

[SCRIPTS]myproject = /home/pi/myproject/python/script.py

  1. Locate [HTTP] section, add following line to tell WebIOPi where to find your HTML resources

[HTTP]doc-root = /home/pi/myproject/html

  1. The two steps above are enough to run our app, but we want to limit remote control to the Light only. By default, we can remotely change function and value of all GPIO.

4.3.3.6 Testing

To debug your script and config, you should first run WebIOPi foreground before using the daemon service :

sudo webiopi -d -c /etc/webiopi/config

Figure 20: Protocol between Browser and WebIOPi

The data which is sent by the user while using from a remote location is captured on the raspberry pi and converted into logic that is used to run the motors.

The internet control of Raspberry Pi opens a gateway for enormous number of possibilities for the smart wheelchair and its control.

results matching ""

    No results matching ""