Skip to content

open source hardware and software for airsoft mosfets

Notifications You must be signed in to change notification settings

openairsoft/openmosfet

Repository files navigation

Open Source? Yes! Maintenance GitHub tag (latest SemVer)


Logo

OpenMosfet

An high quality open source airsoft mosfet
based on arduino.



Explore the docs »

Report Bug · Request Feature · Discord

Table of Contents
  1. About The Project
  2. Getting Started
  3. Development
  4. Development
  5. Roadmap
  6. Contributing
  7. To-Do

About the project

OpenMosfet is an high quality open source airsoft mosfet based on arduino (currently esp32 board).

The software is meant to be modular and to allow different sensors configurations.

The hardware provides all the electronics needed and allows different boards to be created.

The web dashboard allows full and easy controls over every settings as well an update manager.

OpenMosfet Web Dashboard

The UI is now available in English

The team

The team is composed of two developers and two electronitians, all french airsofters.

Getting started

Installation and build

  • Install platformio
  • Clone the repo
  • Open it in your IDE (VSCode is suggested)
  • it is recommended that you create your custom platformio environements in a custom_env.ini (you can copy custom_env.example.ini file). This way you can assign different pins or use different boards types without messing with the git versionning and you can still inherit from envs defined in the platformio.ini file.
    • Note : don't forget to include the parent build flags if you inherhit an env
  • for building the ui (mandatory) :
    • install node.js
    • inside the ui folder, run npm install
    • Note : ui.h is recompiled by running the command npm run build inside the ui folder. this is done automaticaly before each platformio build (see UI Development section, platformio.ini and build_ui.py)
  • Note : OTA upload is enabled by default, if your board hasn't ota enabled or you want to upload with serial, you can :
    • QUICK AND DIRTY WAY : comment that following parameters in platformio.ini
      • upload_protocol
      • upload_port
    • PROPER WAY
      • use custom_env.ini and create an environement with redifined upload_protocol and upload_port (see custom_env.example.ini), ex :
        • upload_protocol = esptool
        • upload_port = *
  • default password for access point is "password"
  • I think thats about it...

UI Development

Local UI (without board)

To serve the UI locally on your computer, we provide a fake server to simulate the board behavior.

Install and serve

  • inside the /src/ui/ folder, run npm install or yarn install
  • run npm run watch or yarn watch
  • open http://localhost:3000/ in your browser
  • you can now edit src/ui/**/* without having to re-launch the server

Note: The configuration is loaded from defaultConf.json and can be updated as long as the server is running. Once it stops the updated configuration is lost

Replica interface types

Depending on your replica and the way you connect the mosfet, the signals received are not the same.

ex : the original input plate on the G&G TR 16 can be used but the signals are very specific.

  • You only know if the safety is disengaged (and mag not empty) when you get a signal from the trigger
  • You only know if selector is on full auto or not before firing

You have to choose which behavior you want by specify the value of the REPLICA_TYPE preprocessor flag (see platformio.ini).

Here is a table (work in progress) listing the different configuration available :

REPLICA_TYPE value pins behavior examples
1 OM_DEFAULT_FIRINGGROUP_PIN grounded when : trigger is pressed
OM_DEFAULT_CYCLE_PIN grounded when cutoff is pressed
OM_DEFAULT_SELECTOR_PIN grounded when selector is on full auto position
G&G tr16 original input plate
2 OM_DEFAULT_FIRINGGROUP_PIN grounded when : trigger is pressed
OM_DEFAULT_CYCLE_PIN grounded when when tappet plate is forwad (nozzle pressed against bucking)
OM_DEFAULT_SELECTOR_PIN cycle through firemodes and safety on falling edge
custom input plate with microswitch detecting tappet plate, simple press button as a selector
3 OM_DEFAULT_FIRINGGROUP_PIN grounded when : trigger is pressed
OM_DEFAULT_CYCLE_PIN grounded when cutoff is pressed
OM_DEFAULT_SELECTOR_PIN between 0v and vcc depending on selector position (needs calibration)

Custom replica interface pinout

For developpement reasons or other, you can change the default settings for the replica interface with the following flags :

  • OM_DEFAULT_MOTOR_PIN
  • OM_DEFAULT_FIRINGGROUP_PIN
  • OM_DEFAULT_CYCLE_PIN
  • OM_DEFAULT_SELECTOR_PIN

Note: it is not recommended that you change this value in the source file, but rather as a build flag in platformio.ini for example.
Note: for example, the ESP32DEVKIT V1 doesnt have the pin 10 exposed, which is the default pin used on the board for the selector input.

http rest-like API

Got to the API documentation.

Contributing

Don't hesitate to contact us via github, or your can come and talk with us on our discord server.

We are french but we can chat in english without problems.