Skip to content

frg-fossee/eSim-Cloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

eSim and Arduino on Cloud


eSim on Cloud

This system allows the users to draw analog and digital circuits and simulate them. The users have a facility to drag and drop components from the left pane onto the schematic grid on the right pane. The components on the grid are connected using wires. The circuit can then be simulated using the different simulation parameters (DC Solver, DC Sweep, Transient analysis, and AC analysis). The basic ERC check enables the users to find out errors if any. The size of the schematic grid can be changed from A1 to A5 paper sizes along with portrait and landscape modes. The users can also print the circuit or save it in pdf format for documentation purposes. A demo is shown below.

eSim Demo

Arduino on Cloud

This system allows the users to drag and drop Arduino components from the left pane onto the working space on the right. The pins of the Arduino board can be connected to various input/output devices like LED, motor, push button, etc using wires. There is also a facility to change the color of wires, LEDs, and such components, so as to differentiate the easily. The users can then proceed to write their code in the code window which is then simulated. There is an option for the users to print or save it in pdf format for documentation purposes. The basic ERC check enables the users to find out errors if any. A demo is shown below.

Arduino Demo

Installation

  • This is only a one time process
  • Ubuntu (Requirements)
    • Install Docker
    • Install docker compose: sudo apt get install docker-compose
  • Windows (Requirements)
    • Install WSL (Windows Subsystem for Linux)
      • Open PowerShell or Windows Command Prompt in administrator mode by right-clicking and selecting "Run as administrator"
      • wsl --install
      • Restart your machine.
    • Install Docker
    • Start the docker desktop application
  • Mac (Requirements)
    • Install Docker
    • Start the docker desktop application
  • Setting up
    • Fork this repository. Make sure that you fork all the branches.
    • Windows users: Use the Ubuntu App to start the terminal and then proceed ahead. Do not user PowerShell.
    • Clone your forked repo on your machine: git clone https://github.com/<yourGitHubUserName>/eSim-Cloud.git
    • cd eSim-Cloud
    • git checkout develop: This will switch to the develop branch
    • /bin/bash first_run.dev.sh: This will set up and install all the necessary packages and docker images. Depending on your connection it would take around 40 to 45 minutes

Starting the system

  • Before proceeding ahead, start your Docker Desktop application (Windows and Mac users only)
  • Open (terminal - Ubuntu/Mac users) (WSL ubuntu app - Windows users)

Development Environment (for coders/developers)

  • docker-compose -f docker-compose.dev.yml --env-file .env up
  • eSim: Browse http://localhost/ and click the Launch button under eSim
  • Login credentials
    • Username: admin
    • Password: admin
  • Arduino: Browse http://localhost:4200/

Production Environment

  • cp .env .env.prod : Only for the first time
  • docker-compose -f docker-compose.prod.yml --env-file .env.prod up
  • Browse http://localhost/ and click the launch button for eSim and Arduino, respectively
  • Login credentials
    • Username: admin
    • Password: admin

Applying Migrations (Only if needed)

  • At times, while setting up the system, the database might not get set up as required. In such a case, when you visit the gallery of eSim or Arduino, you will not find the sample circuits. Moreover, in eSim, the components in the left pane will not be loaded. In such a case, do the following
    • Make sure that the dockers are running i.e. you have started either the development or production environment
    • Open up a new terminal.
    • docker ps This command displays the container ids of all running docker containers.
    • Look for Django's container ID. It would be something like 'c4ac75dd1937'
    • docker exec -it <ContainerID> /bin/bash
    • sh migrations.sh

Other Commands

  • To view Django admin panel
  • If port 80 is already being used on your system, due which nginx is unable to start for this system and throws an error, you can kill the existing process that uses port 80
    • sudo kill -9 $(sudo lsof -t -i:80)
  • To start dockers on the server
    • docker-compose -f docker-compose.prod.yml --env-file .env.prod up --scale django=2 --scale celery=3 -d
    • Note: -d option runs the dockers in the background. To view the logs in the terminal, remove this option
    • Scale django and celerey as required. Remove them, if the server is unable to take the load
  • Restart nginx
    • Development environment: docker-compose -f docker-compose.dev.yml --env-file .env restart nginx
    • Production environment: docker-compose -f docker-compose.prod.yml --env-file .env.prod restart nginx
  • Manually build containers
    • docker-compose -f docker-compose.dev.yml --env-file .env build
  • Run backend container only
    • docker-compose -f docker-compose.dev.yml --env-file .env up django
  • Run eSim along with backend
    • docker-compose -f docker-compose.dev.yml --env-file .env up eda-frontend
  • Run Arduino along with backend
    • docker-compose -f docker-compose.dev.yml --env-file .env up arduino-frontend

Documentation

The latest version of documentation for the project is maintained on esim-cloud.readthedocs.io

Tech stack

  • Simulation backend
    • ngspice (eSim)
    • Arduino compiler
  • Middleware
    • Django
    • REST APIs
    • Celery
    • Redis
  • Frontend
  • Database
    • MySQL
    • Postgres
    • MongoDB
  • Production
    • nginx
    • dockers
  • Testing
    • GitHub actions

Docker Containers

Docker Containers

Contributing

Want to contribute? See our contributing guidelines. Contributions in any form are welcome.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Darsh Patel

πŸ’» πŸ“– πŸš‡

Darshan Sudake

πŸ’» πŸ“– 🎨

felixfaisal

πŸ’» πŸ“– 🎨

rohitgeddam

πŸ’» πŸ“– 🎨

Navonil Das

πŸ’» πŸ“– 🎨

Meet10

πŸ’» πŸ“– 🎨

gupta-arpit

πŸ’» 🎨

Kartik Gautam

πŸ’» πŸ“– 🎨

Nikhil Kumar

πŸ’» πŸ“– 🎨

Kaustuv K Chattopadhyay

πŸ’» πŸ“– 🎨

Akshat Sharma

πŸ’» πŸ“– 🎨

Rugved Somwanshi

πŸ’» πŸ“– 🎨

Rajat Maheshwari

πŸ’» πŸ“– 🎨

This project follows the all-contributors specification. Contributions of any kind welcome!