Skip to content

40Keeper/django_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ICS SECURITY TESTBED

WEB INTERFACE


Please make sure you are accessing the programs from a user having temporary root access. For the existing user,

Username: nips
Password: peach1395

Commands to Run the Web Interface

Change to the directory newproject under home

    cd ~
    cd newproject

alt text

Activate the virtual environment with the help of source command. Make sure to do this every time, as without activating the virtual environment, Django will not work.

    source my_env/bin/activate

alt text

From newproject, go to the directory containing the Django Project

    cd django_project

To run the django_server, execute the following command in django_project directory

    python manage.py runserver

Terminal will print a few lines of output ending with "Quit the server with CONTROL-C".

alt text

Keep this terminal running and DO NOT close it.


Login Details

You will be automatically redirected to a Log In page

alt text

Log In into the interface with the help of user credentials as provided above.


Connecting server to the network

  • Connect the Host computer of Web Interface to the network switch physically via Ethernet cable.

alt text

  • Open "Wired Settings" alt text

  • Open the "Wired" dialog box from the gear icon.

alt text

  • Go to IPv4
  • Select "Manual"
  • Enter the Address as 10.114.10.80
  • Enter the Netmask as 255.255.255.0

alt text

  • Apply changes and close
  • Turn your Wired network connection OFF and ON.

To access the internet

  • If you wish to access the internet, then connect the ethernet cable to a server with Internet access.
  • Go to "Wired Setttings > IPv4" and select the option "Automatic (DHCP)"
  • Turn your Wired network connection OFF and ON.

Launching project on a browser

Go to your favourite browser and after executing the previous command, type the following in the SEARCH BAR and hit ENTER.

127.0.0.1:8000

Alternatively, you can also type the following:

localhost:8000

You have now entered the Web Interface Page. If the page prompts you to log in, then you have executed everything correctly!


INSTRUCTIONS TO RUN THE SERVER

Make sure that you have logged in.

Also, NOTE that this procedure must be followed only for the existing robotarm+conveyor system (as of 20 July 2022). There might be changes in method of execution while integrating a new robot into the Testbed.

"Add image of web interface"

After logging in, you will be directed to the web interface.

STEP-1: To run the Robot Arm Server files-

  1. Open a new terminal

  2. ssh pi@10.114.10.85

    [password: raspberry]

  3. Once you see "pi@robotarm" on the terminal, you have now entered the Raspberry Pi.

  4. cd python

  5. python robot_arm_server.py

alt text

ROBOT ARM SERVER IS NOW RUNNING!

STEP-2: To run the Conveyor Belt Server files-

  1. Open a new terminal

  2. ssh pi@10.114.10.86

    [password: raspberry]

  3. Once you see "pi@conveyor" on the terminal, you have now entered the Raspberry Pi.

  4. cd python

  5. python conveyor_server.py

alt text

CONVEYOR BELT SERVER IS NOW RUNNING!

STEP-3: To run the RPM Sensor Server files-

  1. Open a new terminal

  2. ssh pi@10.114.10.87

    [password: raspberry]

  3. Once you see "pi@hallsensor" on the terminal, you have now entered the Raspberry Pi.

  4. cd python

  5. python sensor_server.py

alt text

RPM SENSOR SERVER IS NOW RUNNING!


Execute the Client Scripts from Web Interface

The client scripts have been stored on the Host computer of the Web Server, and will be executed by hitting the "Run" buttons on the interface.

  • Under the "Robotic Arm Command", on hitting the "Run" button, Robotic Arm will start working. alt text

  • Under the "Conveyor Belt Command", on hitting the "Run" button, Conveyor Belt will start working.

  • You may choose Delay for the belt from the given options in the drop down menu. If you select a different value of Delay and execute the program again, the conveyor should move with a different speed. alt text

  • Under the "Speed Sensor Output", on hitting the "Run" button, the RPM Sensor starts counting. alt text

  • The function triggerred by hitting "Run" button wil dynamically update the RPM data at every rotation of conveyor motor into a MySQL Table.

  • In order to access the SQL Table, entr the following URL in a new browser page and hit ENTER.

localhost/phpmyadmin
  • Log In into PHPMyAdmin with the same credentials as above.
  • Go to ICS_Testbed > RPM_Count_Table
  • REFRESH the page to see latest entries of RPM Value from the sensor.
  • NOTE:- Set the "Sort by key" option tp "PRIMARY (DESC)" to see the latest entries at the top of the page. alt text

ACCESSING IMPORTANT FILES

  1. blog/views.py- Contains the functions responsible for execution of Client scripts- under functions "runbutton1", "stopbutton1", "runbutton2", "stopbutton2", "runbutton3". It also contains initialization of execution of commands into the MySQL Database.
  2. blog/templates/blog/home.html"- Contains the frontend functionality to the Web Interface.
  3. django_project/urls.py- Contains access to all URLs, where they would be redirected to, and functions to be executed upon redirecting.
  4. blog/templates/blog/base.html"- A base template from which other .html files inherit.
  5. django_project/settings.py- Contains basic configurations and additions based on apps included.

About

Embedded Systems Lab, Dept. of ESE, IISc Bangalore

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published