1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-23 12:51:24 +01:00
Go to file
Fred 4861e592c7
Nano every2 (#129)
* Start adding back unowifi stuffz

* Uno Wifi compiling

* Fixes for compile arduino unowifi r2

* FlasString and Timers for Uno Wifi

ALL these changes should be portable back to master

* Remove extra timer that was already added

* Changed to EveryTimerB

* Add everytimerb.h

* Cleanup

* Linear address <a> cmd

* Allow lower case keywords

* Add the F define to be on safe side if it is not present in the library core code

* Clean simple Timer interface

Removes overkill files, puts all timer in a single small file. (DCCTimer)

* Timer port

* Timer working

And slow wave command removed

* Correcting non-portables merged from master

* Wave-state machine ( part 11)

* Microtuning waveform

Significant reduction in code paths and call overheads

* Current check cleanup

* Fix no-loco id

Has to handle -1 correctly

* fix wrong format letter

* redo flow through wifisetup again

* version++

* bugfixes wifi setup

* Retry harder for AP mode

* Remove unued if

* DIO2 replacement

Currently for writing signal pins during waveform.

* Drop analogReadFast (see DCCTimer)

AnalogRead speed set in DCCTimer for ease of porting.
Code tidy and diagnostics in MotorDriver

* UNTESTED fast power,brake,fault pins

* Distunguish between in/out of FASTPIN

* minor performance tweaks

* Config comments and example use

* Config/example loading

* IP/PORT on LCD

* Ethernet simulated mac

Plus fixed listening port

* Github SHA

* Committing a SHA

* Fix for nano compile

* Comments and a reliability fix.

* UnoRev2 protection

* PWM pin implementation

* fix wifi setup issue

* Reinstate IP_PORT

* Wifi channel and code cleaninga

* Reduce duplicated F() macros

Compiler isn't as clever as one might expect

* Committing a SHA

* Update config.example.h

Add comment to wifi channel section

* Committing a SHA

* Handle shields with common fault pins (Pololu)

* Committing a SHA

* remove warning

* Committing a SHA

* only do the sha generation on master

* yaml syntax

* Fast SSD1306 OLED driver

Incorporate code from SSD1306Ascii library to speed up OLED screen updates, reduce memory requirements and eliminate some library dependences.

* Fix auto-configure from cold boot.

Add call to Wire.begin().

* Update comment for OLED_DRIVER define.

* Update MotorDrivers.h

Add a motor board definition for using the IBT_2 board for a high current to the main track and keep the Arduino Motor Shield for operating the programming track.

* Committing a SHA

* Fix missing F  in motor drivers

* JOIN relay pin

* Swap Join Relay high/low

* Hide WIFI_CONNECT_TIMEOUT

This is not what the config suggests it is...  The timeout is in the ES and defaults to 15 seconds. Abandoning it early leads to confused setup.

* Enhance OLED/LCD speed

Write one character or position command per loop entry so as not to hold up the loop.  Add support for SH1106 OLED as 132x64 size option.

* Enhance OLED/LCD speed

* Delete comment about OLED on UNO.

* Trim unwanted code

* Handle display types correctly

* Update comments

* Speed up OLED writes

Add new flushDisplay() to end any in-progress I2C transaction.  Previously, an redundant command was sent that ended the in-progress transaction but also sent another complete, but unnecessary, transaction.

* Comments and copyright update

* Reduce RAM and flash requirement a few more bytes.

* Move statics into LCDDisplay class, and reduce RAM.

Some state variables were static in LCDDisplay.write().  Moved to class members.  Also, types of data items like row, column & character position changed to int8_t to save a few bytes of RAM.

* Type lcdCols and lcdRows to unsigned.

Since lcdCols is normally 128, it needs to be uint8_t, not int8_t.

* remove timeout from user config

* faultpin is common only if it exists ; make code prettier

* Rationalisation of SSD1306 driver

Merge SSD1306AsciiWire.cpp into SSD1306Ascii.cpp and rename SSD1306AsciiWire.h as SSD1306Ascii.h.
Merge allFonts.h into System5x7.h and rename as SSD1306font.h.
Move all SSD1306 files into root folder to facilitate compilation in Arduino IDE.

* Fix some font attributes as const.

* Remove unused initialisation sequences for tiny oled screens

* Add m_ to variables

* Bump up I2C speed

Speed was 100kHz (default).  Max for OLEDis 400kHz.

* Revert "Bump up I2C speed"

This reverts commit 1c1168f433.

* Bump up I2C speed

Speed was 100kHz (default). Max for OLEDis 400kHz.

* Drop duplicate DIAG

* ignore mySetup.h files

* Restore uno to default_envs

Restore uno (previously commented out) to default_envs.

* Update objdump.bat

Allows other editors as Notepad is very slow on large files

* Prog Track overload during cv read

* Faster LCD Driver

Extract LCD driver from library;
Trim unused functionality;
Reduce I2C communications to minimum;
Speed up I2C clock to 400kHz.

* Update config.example.h

Add IBT_2_WITH_ARDUINO to example config

* Update config.example.h

* Screen enhancements (#126)

* Add I2CManager to coordinate I2C shared parameters.

* Add use of I2CManager, and experimental scrolling strategies.

New scrolling capability by defining SCROLLMODE in Config.h to 0 (original), 1 (by page) or 2 (by line).  If not defined, defaults to 0.

* Scrolling updates

New scrolling capability by defining SCROLLMODE in Config.h to 0 (original), 1 (by page) or 2 (by line). If not defined, defaults to 0.
Reformat.

* Add I2CManager calls. Remove unnecessary delays.

* Add I2CManager calls, remove unnecessary I2C delays.

* SSD1306: Move methods from .h to .cpp and reformat.

* Fix compiler warning in LiquidCrystal_I2C

* Allow forcing of I2C clock speed.

New method forceClock allows the I2C speed to be overridden.  For example, if the I2C bus is long then the speed can be forced lower.  It can also be forced higher to gain performance if devices are capable.

* Make Config.h conditionally included.

Allow for non-existence of Config.h.

* Correct scrolling and allow longer messages

Correct the handling of scrolling in scrollmode 1 to avoid a blank page being displayed.  Also, allow MAX_MSG_SIZE to be optionally configured to override maximum message length on screens.

* compiler warning on uno

Co-authored-by: dexslab <dex35803@gmail.com>
Co-authored-by: Asbelos <asbelos@btinternet.com>
Co-authored-by: Harald Barth <haba@kth.se>
Co-authored-by: Neil McKechnie <neilmck999@gmail.com>
Co-authored-by: Neil McKechnie <75813993+Neil-McK@users.noreply.github.com>
2021-03-07 15:58:35 -05:00
.github/workflows yaml syntax 2021-02-15 10:52:19 +01:00
.vscode Add readme add back extensions and settings from Dave and fix gitignore 2020-07-01 09:06:03 -04:00
Release - Architecture Doc Update Prod-Release-Notes.md 2021-01-21 10:19:34 -05:00
.gitattributes do not touch CR or CRLF of svg files 2020-11-26 15:55:52 +01:00
.gitignore Nano every2 (#129) 2021-03-07 15:58:35 -05:00
.travis.yml Initial commit 2020-05-25 01:43:34 -06:00
CommandDistributor.cpp Passing Strteamer correctly 2020-10-26 13:58:25 +00:00
CommandDistributor.h Passing outbound Ring to Withrottle 2020-10-26 13:31:51 +00:00
CommandStation-EX.ino Nano every2 (#129) 2021-03-07 15:58:35 -05:00
config.example.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
CONTRIBUTING.md Create CONTRIBUTING.md 2020-12-08 07:34:59 -05:00
DCC.cpp Nano every2 (#129) 2021-03-07 15:58:35 -05:00
DCC.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
DCCEX.h RMFT Hooks (#112) 2021-01-05 13:05:17 -05:00
DCCEXParser.cpp Nano every2 (#129) 2021-03-07 15:58:35 -05:00
DCCEXParser.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
DCCTimer.cpp Nano every2 (#129) 2021-03-07 15:58:35 -05:00
DCCTimer.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
DCCWaveform.cpp Nano every2 (#129) 2021-03-07 15:58:35 -05:00
DCCWaveform.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
defines.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
DIAG.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
EEStore.cpp better isprint instead 2020-10-28 23:19:55 +01:00
EEStore.h D EEPROM command 2020-10-04 21:20:13 +02:00
EthernetInterface.cpp Nano every2 (#129) 2021-03-07 15:58:35 -05:00
EthernetInterface.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
freeMemory.cpp rewrite freeMemory code 2020-09-22 23:10:52 +02:00
freeMemory.h rewrite freeMemory code 2020-09-22 23:10:52 +02:00
FSH.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
GITHUB_SHA.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
I2CManager.cpp Nano every2 (#129) 2021-03-07 15:58:35 -05:00
I2CManager.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
LCD_Implementation.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
LCD_LCD.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
LCD_NONE.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
LCD_OLED.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
LCDDisplay.cpp Nano every2 (#129) 2021-03-07 15:58:35 -05:00
LCDDisplay.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
LICENSE Create LICENSE 2020-06-12 22:51:42 -06:00
LiquidCrystal_I2C.cpp Nano every2 (#129) 2021-03-07 15:58:35 -05:00
LiquidCrystal_I2C.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
MotorDriver.cpp Nano every2 (#129) 2021-03-07 15:58:35 -05:00
MotorDriver.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
MotorDrivers.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
objdump.bat Nano every2 (#129) 2021-03-07 15:58:35 -05:00
objdump.sh fix objdump.sh 2020-09-26 22:28:29 +02:00
Outputs.cpp add turnout, sensor and output states to 's'tatus message (#108) 2020-12-27 10:20:11 -05:00
Outputs.h add turnout, sensor and output states to 's'tatus message (#108) 2020-12-27 10:20:11 -05:00
platformio.ini Nano every2 (#129) 2021-03-07 15:58:35 -05:00
PWMServoDriver.cpp Nano every2 (#129) 2021-03-07 15:58:35 -05:00
PWMServoDriver.h Fix hanging turnouts 2020-07-23 12:48:38 +01:00
README.md Update README.md 2020-11-14 04:24:07 -07:00
release_notes.md Rename release-notes.md to release_notes.md 2021-02-07 12:43:15 -05:00
RingStream.cpp Ring count improvements 2020-10-27 10:38:30 +00:00
RingStream.h Ring count improvements 2020-10-27 10:38:30 +00:00
Sensors.cpp no float in Sensor no more 2020-10-26 09:10:45 +01:00
Sensors.h no float in Sensor no more 2020-10-26 09:10:45 +01:00
SSD1306Ascii.cpp Nano every2 (#129) 2021-03-07 15:58:35 -05:00
SSD1306Ascii.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
SSD1306font.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
SSD1306init.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
StringFormatter.cpp Nano every2 (#129) 2021-03-07 15:58:35 -05:00
StringFormatter.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
Turnouts.cpp <T> should send turnout definitions, not just states (#110) 2021-01-04 10:57:03 -05:00
Turnouts.h <T> should send turnout definitions, not just states (#110) 2021-01-04 10:57:03 -05:00
version.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
WifiInboundHandler.cpp Nano every2 (#129) 2021-03-07 15:58:35 -05:00
WifiInboundHandler.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
WifiInterface.cpp Nano every2 (#129) 2021-03-07 15:58:35 -05:00
WifiInterface.h Nano every2 (#129) 2021-03-07 15:58:35 -05:00
WiThrottle.cpp Nano every2 (#129) 2021-03-07 15:58:35 -05:00
WiThrottle.h Passing Strteamer correctly 2020-10-26 13:58:25 +00:00

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:

  • CommandStation-EX - 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 - a simple web based controller for your DCC++ command station.
  • BaseStation-installer - an installer executable that takes care of downloading and installing DCC++ firmware onto your hardware setup.
  • BaseStation-Classic - the original DCC++ software, packaged in a stable release. No active development, bug fixes only.

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, including:

  • simultaneous control of multiple locomotives
  • 2-byte and 4-byte locomotive addressing
  • 128-step speed throttling
  • Activate/de-activate all accessory function addresses 0-2048
  • Control of all cab functions F0-F28
  • 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

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. All sketch files are in the folder named CommandStation-EX and its subforlders.

To utilize this sketch, you can use the following:

  1. (beginner) our automated installer
  2. (intermediate) download the latest version from the releases page
  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.

What's new in CommandStation-EX?

  • WiThrottle server built in. Connect Engine Driver or WiThrottle clients directly to your Command Station
  • WiFi and Ethernet shield support
  • No more jumpers or soldering!
  • Direct support for all the most popular motor control boards
  • I2C Display support
  • 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
  • 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 to you, click HERE.

More information

You can learn more at the DCC++ EX website

  • November 14, 2020