Interface


Design

The assignment for this week is to design an interface


Interface

My idea of an interface is to use html and php.
The requrements for my interface and application is to have Apache, Mysql and php installed in the computer. The operating system that am using is ubuntu.

After searching on the net, I was able to get how to install the apache, mysql and php. This id done by typing on the command prompt

sudo apt-get install apache2 php5 libapache2-mod-php5 mysql mysql-server

Then follow the necessary steps that follow.
Before Apache can see that php is installed you will have to restart Apache like so:

sudo /etc/init.d/apache2 restart

You have to first set a password for mysql. To do this, run the first command in order to get to the mysql prompt and the second to set the password:

mysql -u root mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('YOURPASSWORD');

Once apache,mysql and php is instaled, we build our application and save in folder in system files as follows.

/var/www/


Application

My application is to build an interface for controlling hardware over internet.

The idea is to use a webpage that resides in the computer which will have classes for accessing the serial port or the usb of a computer for communication to a microcontroller. To access the application from another computer, one is required to type on a webpage the ip address of my computer.


How to know the public IP of your computer

If you want to know the public IP of a computer, you can go to

www.whatismyip.com


Html interface



Html interface code

The codes that I used for the php interface are as following.

interface html

interface php code

php serial class