1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-23 16:16:13 +01:00

Compare commits

...

3 Commits

Author SHA1 Message Date
chatelao
cb4acf4404
Merge 53f598192c into 28d60d4984 2024-02-18 04:30:13 -07:00
Peter Akers
28d60d4984 Update README.md 2024-02-16 18:02:40 +10:00
chatelao
53f598192c Add - Firmware packeage & firmware on Wokwi
The GitHub action is changed:
- Newer version of Checkout Action
- Caching of PlatformIO files
- All build firmwares (.bin / .hex) are bundles into a files
- All firmwares runnable on Wokwi are run as simulation

n.b.: To run on Wokwi a secret credetial has to be stored on the account.
2024-01-06 19:54:52 +01:00
10 changed files with 183 additions and 71 deletions

View File

@ -1,19 +1,82 @@
name: CI
name: PlatformIO CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Python Wheel
run: pip install wheel
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PlatformIO Core
run: pip install -U platformio
- name: Copy generic config over
run: cp config.example.h config.h
- name: Compile Command Station (AVR)
run: python -m platformio run
run: pip install --upgrade platformio
- name: Use sample "config.example.h" for compilations
run: mv $GITHUB_WORKSPACE/config.example.h $GITHUB_WORKSPACE/config.h
- name: Build PlatformIO Project
run: pio run
- name: Copy all firmwares for for packaging
run: |
mkdir downloads
cd .pio/build
find . -name '*.bin' | cpio -pdm ../../downloads
find . -name '*.hex' | cpio -pdm ../../downloads
find . -name '*.uf2' | cpio -pdm ../../downloads
cd ../..
- name: Package and upload all firmwares for download
uses: actions/upload-artifact@v3
with:
name: all-firmwares-for-download
path: downloads
- name: Test on Arduino MEGA with Wokwi
uses: wokwi/wokwi-ci-action@v1
with:
token: ${{ secrets.WOKWI_CLI_TOKEN }}
path: /wokwi/mega # directory with wokwi.toml, relative to repo's root
timeout: 10000
expect_text: '<* LCD3:Free RAM='
fail_text: 'Error'
# scenario: 'test-hello-world.yaml' # optional
- name: Test on Arduino UNO with Wokwi
uses: wokwi/wokwi-ci-action@v1
with:
token: ${{ secrets.WOKWI_CLI_TOKEN }}
path: /wokwi/uno # directory with wokwi.toml, relative to repo's root
timeout: 10000
expect_text: '<* LCD3:Free RAM='
fail_text: 'Error'
# scenario: 'test-hello-world.yaml' # optional
- name: Test on Arduino NANO with Wokwi
uses: wokwi/wokwi-ci-action@v1
with:
token: ${{ secrets.WOKWI_CLI_TOKEN }}
path: /wokwi/nano # directory with wokwi.toml, relative to repo's root
timeout: 10000
expect_text: '<* LCD3:Free RAM='
fail_text: 'Error'
# scenario: 'test-hello-world.yaml' # optional
- name: Test on ESP32 with Wokwi
uses: wokwi/wokwi-ci-action@v1
with:
token: ${{ secrets.WOKWI_CLI_TOKEN }}
path: /wokwi/esp32 # directory with wokwi.toml, relative to repo's root
timeout: 10000
expect_text: 'ESP32 / STANDARD_MOTOR_SHIELD'
fail_text: 'Error'
# scenario: 'test-hello-world.yaml' # optional

View File

@ -1,77 +1,39 @@
# What is DCC++ EX?
DCC++ EX is the organization maintaining several codebases that together represent a fully open source DCC system. Currently, this includes the following:
# What is DCC-EX?
DCC-EX is a team of dedicated enthusiasts producing open source DCC & DC solutions for you to run your complete model railroad layout. Our easy to use, do-it-yourself, and free open source products run on off-the-shelf Arduino technology and are supported by numerous third party hardware and apps like JMRI, Engine Driver, wiThrottle, Rocrail and more.
* [CommandStation-EX](https://github.com/DCC-EX/CommandStation-EX/releases) - the latest take on the DCC++ command station for controlling your trains. Runs on an Arduino board, and includes advanced features such as a WiThrottle server implementation, turnout operation, general purpose inputs and outputs (I/O), and JMRI integration.
* [exWebThrottle](https://github.com/DCC-EX/exWebThrottle) - a simple web based controller for your DCC++ command station.
* [BaseStation-installer](https://github.com/DCC-EX/BaseStation-Installer) - an installer executable that takes care of downloading and installing DCC++ firmware onto your hardware setup.
* [BaseStation-Classic](https://github.com/DCC-EX/BaseStation-Classic) - the original DCC++ software, packaged in a stable release. No active development, bug fixes only.
Currently, our products include the following:
A basic DCC++ EX hardware setup can use easy to find, widely avalable Arduino boards that you can assemble yourself.
Both CommandStation-EX and BaseStation-Classic support much of the NMRA Digital Command Control (DCC) [standards](http://www.nmra.org/dcc-working-group "NMRA DCC Working Group"), including:
* simultaneous control of multiple locomotives
* 2-byte and 4-byte locomotive addressing
* 28 or 128-step speed throttling
* Activate/de-activate all accessory function addresses 0-2048
* Control of all cab functions F0-F28 and F29-F68
* Main Track: Write configuration variable bytes and set/clear specific configuration variable (CV) bits (aka Programming on Main or POM)
* Programming Track: Same as the main track with the addition of reading configuration variable bytes
* And many more custom features. see [What's new in CommandStation-EX?](#whats-new-in-commandstation-ex)
* [EX-CommandStation](https://github.com/DCC-EX/CommandStation-EX/releases)
* [EX-WebThrottle](https://github.com/DCC-EX/exWebThrottle)
* [EX-Installer](https://github.com/DCC-EX/EX-Installer)
* [EX-MotoShield8874](https://dcc-ex.com/reference/hardware/motorboards/ex-motor-shield-8874.html#gsc.tab=0)
* [EX-DCCInspector](https://github.com/DCC-EX/DCCInspector-EX)
* [EX-Toolbox](https://github.com/DCC-EX/EX-Toolbox)
* [EX-Turntable](https://github.com/DCC-EX/EX-Turntable)
* [EX-IOExpander](https://github.com/DCC-EX/EX-IOExpander)
* [EX-FastClock](https://github.com/DCC-EX/EX-FastClock)
* [DCCEXProtocol](https://github.com/DCC-EX/DCCEXProtocol)
Details of these projects can be found on [our web site](https://dcc-ex.com/).
# Whats in this Repository?
This repository, CommandStation-EX, contains a complete DCC++ EX Commmand Station sketch designed for compiling and uploading into an Arduino Uno, Mega, or Nano.
This repository, CommandStation-EX, contains a complete DCC-EX *EX-CommmandStation* sketch designed for compiling and uploading into an Arduino Uno, Mega, or Nano.
To utilize this sketch, you can use the following:
1. (beginner) our [automated installer](https://github.com/DCC-EX/BaseStation-Installer)
1. (recommended for all levels of user) our [automated installer](https://github.com/DCC-EX/EX-Installer)
2. (intermediate) download the latest version from the [releases page](https://github.com/DCC-EX/CommandStation-EX/releases)
3. (advanced) use git clone on this repository
Not using the installer? Open the file "CommandStation-EX.ino" in the
Arduino IDE. Please do not rename the folder containing the sketch
code, nor add any files in that folder. The Arduino IDE relies on the
structure and name of the folder to properly display and compile the
code. Rename or copy config.example.h to config.h. If you do not have
the standard setup, you must edit config.h according to the help texts
in config.h.
Refer to [our web site](https://https://dcc-ex.com/ex-commandstation/get-started/index.html#/) for the hardware required for this project.
## What's new in CommandStation-EX?
**We seriously recommend using the EX-Installer**, however if you choose not to use the installer...
* WiThrottle server built in. Connect Engine Driver or WiThrottle clients directly to your Command Station (or through JMRI as before)
* WiFi and Ethernet shield support
* No more jumpers or soldering!
* Direct support for all the most popular motor control boards including single pin (Arduino) or dual pin (IBT_2) type PWM inputs without the need for an adapter circuit
* I2C Display support (LCD and OLED)
* Improved short circuit detection and automatic reset from an overload
* Current reading, sensing and ACK detection settings in milliAmps instead of just pin readings
* Improved adherence to the NMRA DCC specification
* Complete support for all the old commands and front ends like JMRI
* Railcom cutout (beta)
* Simpler, modular, faster code with an API Library for developers for easy expansion
* New features and functions in JMRI
* Ability to join MAIN and PROG tracks into one MAIN track to run your locos
* "Drive-Away" feature - Throttles with support, like Engine Driver, can allow a loco to be programmed on a usable, electrically isolated programming track and then drive off onto the main track
* Diagnostic commands to test decoders that aren't reading or writing correctly
* Support for Uno, Nano, Mega, Nano Every and Teensy microcontrollers
* User Functions: Filter regular commands (like a turnout or output command) and pass it to your own function or accessory
* Support for LCN (layout control nodes)
* mySetup.h file that acts like an Autoexec.Bat command to send startup commands to the CS
* High Accuracty Waveform option for rock steady DCC signals
* New current response outputs current in mA, overlimit current, and maximum board capable current. Support for new current meter in JMRI
* USB Browser based EX-WebThrottle
* New, simpler, function control command
* Number of locos discovery command `<#>`
* Emergency stop command <!>
* Release cabs from memory command <-> all cabs, <- CAB> for just one loco address
* Automatic slot (register) management
* Automation (coming soon)
NOTE: DCC-EX is a major rewrite to the code. We started over and rebuilt it from the ground up! For what that means, you can read [HERE](https://dcc-ex.com/about/rewrite.html).
* Open the file ``CommandStation-EX.ino`` in the Arduino IDE or Visual Studio Code (VSC). Please do not rename the folder containing the sketch code, nor add any files in that folder. The Arduino IDE relies on the structure and name of the folder to properly display and compile the code.
* Rename or copy ``config.example.h`` to ``config.h``.
* You must edit ``config.h`` according to the help texts in ``config.h``.
# More information
You can learn more at the [DCC++ EX website](https://dcc-ex.com/)
You can learn more at the [DCC-EX website](https://dcc-ex.com/)
- November 14, 2020

8
wokwi/esp32/diagram.json Normal file
View File

@ -0,0 +1,8 @@
{
"version": 1,
"author": "Olivier Chatelain",
"editor": "wokwi",
"parts": [ { "type": "board-esp32-devkit-c-v4", "id": "esp", "top": 0, "left": 0, "attrs": {} } ],
"connections": [ [ "esp:TX", "$serialMonitor:RX", "", [] ], [ "esp:RX", "$serialMonitor:TX", "", [] ] ],
"dependencies": {}
}

4
wokwi/esp32/wokwi.toml Normal file
View File

@ -0,0 +1,4 @@
[wokwi]
version = 1
firmware = '../../.pio/build/ESP32/firmware.bin'
elf = '../../.pio/build/ESP32/firmware.elf'

47
wokwi/mega/diagram.json Normal file
View File

@ -0,0 +1,47 @@
{
"version": 1,
"author": "Olivier Chatelain",
"editor": "wokwi",
"parts": [
{ "type": "wokwi-arduino-mega", "id": "mega", "top": -249, "left": -147.6, "attrs": {} },
{ "type": "wokwi-logic-analyzer", "id": "logic1", "top": -374.05, "left": 355.2, "attrs": {} },
{
"type": "board-ssd1306",
"id": "oled1",
"top": -409.66,
"left": 57.83,
"attrs": { "i2cAddress": "0x3c" }
},
{ "type": "wokwi-gnd", "id": "gnd1", "top": -268.8, "left": 335.4, "attrs": {} },
{ "type": "wokwi-gnd", "id": "gnd2", "top": -57.6, "left": 239.4, "attrs": {} },
{
"type": "wokwi-resistor",
"id": "r1",
"top": -476.6,
"left": 152.75,
"rotate": 270,
"attrs": { "value": "1000" }
},
{
"type": "wokwi-resistor",
"id": "r2",
"top": -476.6,
"left": 75.95,
"rotate": 270,
"attrs": { "value": "1000" }
}
],
"connections": [
[ "mega:GND.1", "oled1:GND", "black", [ "v0" ] ],
[ "mega:5V", "oled1:VCC", "red", [ "v-348.3", "h88.55" ] ],
[ "gnd1:GND", "logic1:GND", "black", [ "v0" ] ],
[ "mega:GND.5", "gnd2:GND", "black", [ "v0" ] ],
[ "oled1:SCL", "r2:1", "green", [ "v0" ] ],
[ "oled1:SDA", "r1:1", "green", [ "v0" ] ],
[ "r2:2", "oled1:VCC", "green", [ "h38.4", "v87.6", "h-38.4" ] ],
[ "r2:2", "r1:2", "green", [ "h0" ] ],
[ "mega:SCL", "oled1:SCL", "green", [ "v-144", "h172.5" ] ],
[ "mega:SDA", "oled1:SDA", "green", [ "v-134.4", "h162.8" ] ]
],
"dependencies": {}
}

4
wokwi/mega/wokwi.toml Normal file
View File

@ -0,0 +1,4 @@
[wokwi]
version = 1
firmware = '../../.pio/build/mega2560/firmware.hex'
elf = '../../.pio/build/mega2560/firmware.elf'

8
wokwi/nano/diagram.json Normal file
View File

@ -0,0 +1,8 @@
{
"version": 1,
"author": "Olivier Chatelain",
"editor": "wokwi",
"parts": [ { "type": "wokwi-arduino-nano", "id": "nano", "top": 0, "left": 0, "attrs": {} } ],
"connections": [],
"dependencies": {}
}

4
wokwi/nano/wokwi.toml Normal file
View File

@ -0,0 +1,4 @@
[wokwi]
version = 1
firmware = '../../.pio/build/nano/firmware.hex'
elf = '../../.pio/build/nano/firmware.elf'

8
wokwi/uno/diagram.json Normal file
View File

@ -0,0 +1,8 @@
{
"version": 1,
"author": "Olivier Chatelain",
"editor": "wokwi",
"parts": [ { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} } ],
"connections": [],
"dependencies": {}
}

4
wokwi/uno/wokwi.toml Normal file
View File

@ -0,0 +1,4 @@
[wokwi]
version = 1
firmware = '../../.pio/build/uno/firmware.hex'
elf = '../../.pio/build/uno/firmware.elf'