Skip to content

A web-based system for designing and simulating electronic (eSim) and Arduino circuits.

License

Notifications You must be signed in to change notification settings

s-bray/eSim-Cloud

Β 
Β 

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

Documentation

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

Installation

Basic Setup

  • Docker and docker-compose will be required for production and development environments.
  • Make sure that you install both of them specific to your OS and version (Linux, Windows, Mac)
  • git clone https://github.com/frg-fossee/eSim-Cloud.git
  • cd eSim-Cloud

Production Environment

  • Setup env (Change default credentials)
    • cp .env .env.prod
  • Run docker (in background)
    • docker-compose -f docker-compose.prod.yml --env-file .env.prod up --scale django=2 --scale celery=3 -d
    • Note: -d option will run the process in the background.
    • Remove -d to view all logs and process in the terminal.
  • Migrations and seed eSim SVGs (after DB and django has finished initializing)
    • docker ps # Find docker id of django. It would be something like 'c4ac75dd1937'
    • docker exec -it ContainerID /bin/bash
    • sh migrations.sh

Development Environment

Open in Cloud Shell

  • Build and run migrations (First time only)
    • Pulls the latest dev image from GitHub
    • /bin/bash first_run.dev.sh
  • Run docker
    • docker-compose -f docker-compose.dev.yml --env-file .env up
    • It might take a while to initialize / throw some errors if they're initialized in the wrong order.
    • Running the command again will most likely fix the issue.

Other useful commands

  • These containers are only for dev environment. In production, the compiled files will be served by 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
  • Restart nginx
    • Dev env: docker-compose -f docker-compose.dev.yml --env-file .env restart nginx
    • Prod env: docker-compose -f docker-compose.prod.yml --env-file .env.prod restart nginx

Pulling docker images

  • Docker images can be directly pulled from GitHub instead of building on system
   $ echo $GITHUB_TOKEN | docker login docker.pkg.github.com --username [github_username] --password-stdin
   $ docker-compose -f docker-compose.dev.yml pull
   $ docker-compose -f docker-compose.dev.yml up --env-file .env -d db
   ----WAIT FOR DB TO FINISH INITIALIZING-----
   $ docker-compose -f docker-compose.dev.yml --env-file .env up

Ubuntu Installation Dump

  • These are all commands being executed to setup the project's development environment on a fresh ubuntu system with username ubuntu
  • If you notice ERROR: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. or Exited with code 137, it means that docker / host system ran out of memory
   $ git clone https://github.com/frg-fossee/eSim-Cloud/
   $ cd eSim-Cloud/
   $ git checkout develop
   $ sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
   $ sudo chmod +x /usr/local/bin/docker-compose
   $ sudo apt-get remove docker docker-engine docker.io containerd runc
   $ curl -fsSL https://get.docker.com -o get-docker.sh
   $ sudo sh get-docker.sh
   $ sudo usermod -aG docker ubuntu
   $ sudo systemctl start docker
   $ sudo systemctl status docker
   $ sudo docker ps
   $ sudo ./first_run.dev.sh

Tech stack

  • Simulation backend
    • ngspice (eSim)
    • Arduino compiler
  • Middleware
    • Django
    • REST APIs
    • Celery
    • Redis
  • Frontend
    • React
    • mxgraph
    • Angular
    • RaphaelJS
    • AVR8js simulator
  • 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

πŸ’» 🎨

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

About

A web-based system for designing and simulating electronic (eSim) and Arduino circuits.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 64.1%
  • TypeScript 24.3%
  • Python 6.6%
  • HTML 3.9%
  • CSS 0.8%
  • Shell 0.2%
  • Dockerfile 0.1%