Skip to content

devices-lab/MakeDevice-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MakeDevice-backend

When given a custom device design by the MakeDevice frontend, this server performs PCB auto-routing between modules, and generates:

  • Gerber files & drill data for PCB manufacture
  • BOM and CPL files for PCB assembly
  • Device firmware for commissioning
image

Make sure to use up-to-date backend_module_data/ generated by MakeDevice modules

Setup (docker)

On each push to main, a github workflow builds a docker image. This can be downloaded to run the production server locally with no setup.

  1. Start the docker service sudo service docker start
  2. Pull the latest container package docker pull ghcr.io/devices-lab/makedevice-backend:latest
  3. Run the container docker run -p 3333:3333 ghcr.io/devices-lab/makedevice-backend:latest

Caution

To free up space by permanently deleting ALL docker containers, images, volumes (not just MakeDevice ones), you can run docker system prune --all --volumes --force

Setup (manual)

Alternatively, the python code can be run by following these steps

1. Install dependencies for objcopy and picotool

sudo apt-get install \
    binutils \
    build-essential \
    cmake \
    git \
    libusb-1.0-0-dev \
    pkg-config \
    gcc-arm-none-eabi \
    libnewlib-arm-none-eabi \
    libstdc++-arm-none-eabi-newlib

2. Install picotool to ./picotool/ (using temporary dependency pico-sdk)

git clone --depth=1 https://github.com/raspberrypi/pico-sdk.git pico-sdk && \
    git clone https://github.com/raspberrypi/picotool.git picotool && \
    cd picotool && mkdir build && cd build && \
    cmake .. -DPICO_SDK_PATH=../../pico-sdk && \
    make && \
    rm -rf ../../pico-sdk && cd ../..

3. Switch to python 3.11

You must use Python version 3.11, or lower, otherwise it won't work with some outdated dependencies (such as gerbonara). To control Python versions you may use the pyenv tool.

  1. brew install pyenv
  2. pyenv install 3.11.0
  3. pyenv global 3.11.0 to set globally or pyenv local 3.11.0 to set in the current directory.

In the case this tools doesn't change your Python version (happens on an M-chip Mac), add eval "$(pyenv init --path)" to your ~/.zshrc and re-open the terminal.

4. Install dependencies to a virtual python environment

  1. Create a virtual environment with python3 -m venv venv
  2. Activate it with source venv/bin/activate
  3. Install dependencies python3 -m pip install -r requirements.txt

Usage

Running an offline test-case (currently broken)

  1. Activate the virtual python environment with source venv/bin/activate
  2. Run an offline test case for a JSON from data/, such as python3 run.py office-vm_net_map_0.3
  • You could instead run python3 run.py office-vm_net_map_0.3 video to generate a video of the test case

Running as a server

  1. Activate the virtual python environment with source venv/bin/activate
  2. Run the Flask development server with python3 -u server.py
  • Alternatively, run the production server with gunicorn server:app --workers 4 --bind 0.0.0.0:3333 --capture-output --log-level debug

Other

Editing the data, i.e. configurations, modules, etc.

See the /data directory

Progress and updates

See CHANGELOG for latest updates and progress

There is a GitHub project (Kanban board) for MakeDevice planning, with features and their integration status.

Ideas in progress

JSON for each module

Each module available in MakeDevice should have a central JSON file with the following information

  • Name
  • Humam readable description
  • Version
  • Module size
  • Designer name
  • Functional name, i.e. rotary-button or RGB-ring
  • Number of functional components
  • MCU part number
  • Last update date
  • 3D file paths
  • Alternate 3D file paths
    • Kitten bot module floating on top
    • No components, just pads
  • Module type (programmer/target/connector)
  • Firmware descriptions
  • List of GerberSockets
  • Design rules - whether can extend to board edge, or not
  • Stack-up in a given module
  • Info about enclosure aperture (whether or not they are included in the GerberSockers layer)
  • List of functional substitutes using the functional naming scheme

Module annotator

When a PCB design has been yet designed with GerberSockets, you can import your current PCB and socketify it.

Front-end features

  • Collision detection
  • Alignment, centering, auto-alignment
  • AI prompt integration, possible with the JSON format for each module
  • Distinction between 2D/3D preview - with enclosures, components/KittenBot modules
  • Better UI and general flow of things
  • Eventually, follow the MakeCode/CreateAI UI theme
  • Add tex editor

Back-end features

  • Support multiple keep-out zones
  • Generate enclosures
  • Silkscreen text
  • More things...

About

Backend service for MakeDevice

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •