From b1f5e9f48c0262f758ab17b3d58f4d0cf1b4f958 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Tue, 21 Jun 2022 15:04:45 +0200 Subject: [PATCH 01/55] Initial version --- log2lrc.py | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 log2lrc.py diff --git a/log2lrc.py b/log2lrc.py new file mode 100755 index 0000000..1f24338 --- /dev/null +++ b/log2lrc.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 +# +# Copyright 2022 Harald Barth +# +# This converts serial logs with timestamps from the +# Arduino IDE to LRC format. +# +# This is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# It is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with CommandStation. If not, see . + +# Usage: log2lrc.py HH:MM:SS HH:MM:SS filename +# logtime videotime +# The resulting timestamps will be adjusted by logtime - videotime. +# logtime > videotime + +import sys +import datetime +import fileinput +import re + +timediff = datetime.datetime.strptime('00:00:00','%H:%M:%S') + +def convert(timestr): + times=timestr.split('.',1) # remove fractions of second + timestamp_obj=datetime.datetime.strptime(times[0],'%H:%M:%S') + timestamp_obj=timestamp_obj-timediff # calculate offset + timestr='{0:%H:%M:%S}'.format(timestamp_obj) + timestr='%s.%s' % (timestr, times[1][0:2]) # add fractions of second, 2 digits + return timestr + +def main(argv): + global timediff + fromtime_str=sys.argv[1] + fromtime_obj=datetime.datetime.strptime(fromtime_str,'%H:%M:%S') + totime_str=sys.argv[2] + totime_obj=datetime.datetime.strptime(totime_str,'%H:%M:%S') + sys.argv=sys.argv[2:] + + + timediff = fromtime_obj - totime_obj + + for line in fileinput.input(): + line = re.split('\s+', line, 1) + if (len(line) > 1 and len(line[1]) > 1): + l = line[1].replace('\n','') + l = l.replace('\r','') + l = re.sub('^-> ','',l) + print("[%s]%s" % (convert(line[0]),l)) + +if __name__ == "__main__": + main(sys.argv) + From a80b16acba66194475b2923479f8f43fe1170692 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Tue, 21 Jun 2022 19:46:59 +0200 Subject: [PATCH 02/55] HH not supported --- log2lrc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log2lrc.py b/log2lrc.py index 1f24338..046cb8f 100755 --- a/log2lrc.py +++ b/log2lrc.py @@ -34,7 +34,7 @@ def convert(timestr): times=timestr.split('.',1) # remove fractions of second timestamp_obj=datetime.datetime.strptime(times[0],'%H:%M:%S') timestamp_obj=timestamp_obj-timediff # calculate offset - timestr='{0:%H:%M:%S}'.format(timestamp_obj) + timestr='{0:%M:%S}'.format(timestamp_obj) timestr='%s.%s' % (timestr, times[1][0:2]) # add fractions of second, 2 digits return timestr From f2eb64fd2156e7ae742bed96fbdc15d6587eb186 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sun, 31 Jul 2022 23:07:19 +0200 Subject: [PATCH 03/55] make service start to be outside the DONT_TOUCH_WIFI_CONF area --- WifiInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WifiInterface.cpp b/WifiInterface.cpp index 0120074..7d8b8bb 100644 --- a/WifiInterface.cpp +++ b/WifiInterface.cpp @@ -276,6 +276,7 @@ wifiSerialState WifiInterface::setup2(const FSH* SSid, const FSH* password, checkForOK(2000, true); } } +#endif //DONT_TOUCH_WIFI_CONF StringFormatter::send(wifiStream, F("AT+CIPSERVER=0\r\n")); // turn off tcp server (to clean connections before CIPMUX=1) checkForOK(1000, true); // ignore result in case it already was off @@ -291,7 +292,6 @@ wifiSerialState WifiInterface::setup2(const FSH* SSid, const FSH* password, StringFormatter::send(wifiStream, F("AT+CIPSERVER=1,%d\r\n"), port); // turn on server on port if (!checkForOK(1000, true)) return WIFI_DISCONNECTED; -#endif //DONT_TOUCH_WIFI_CONF StringFormatter::send(wifiStream, F("AT+CIFSR\r\n")); // Display ip addresses to the DIAG if (!checkForOK(1000, F("IP,\"") , true, false)) return WIFI_DISCONNECTED; From 34c3d1076795e53941b6b06f0770910c8ab62bf3 Mon Sep 17 00:00:00 2001 From: Bruno Crivelari Sanches Date: Sat, 3 Sep 2022 17:16:33 -0300 Subject: [PATCH 04/55] Keep Ethernet singleton "alive" until connection is established. --- EthernetInterface.cpp | 70 +++++++++++++++++++++---------------------- EthernetInterface.h | 3 ++ 2 files changed, 38 insertions(+), 35 deletions(-) diff --git a/EthernetInterface.cpp b/EthernetInterface.cpp index f691f45..9d04423 100644 --- a/EthernetInterface.cpp +++ b/EthernetInterface.cpp @@ -36,7 +36,15 @@ EthernetInterface * EthernetInterface::singleton=NULL; void EthernetInterface::setup() { singleton=new EthernetInterface(); - if (!singleton->connected) singleton=NULL; + + DIAG(F("Ethernet begin OK.")); + if (Ethernet.hardwareStatus() == EthernetNoHardware) { + DIAG(F("Ethernet shield not found")); + + singleton=NULL; + + return; + } }; @@ -60,38 +68,7 @@ EthernetInterface::EthernetInterface() DIAG(F("Ethernet.begin FAILED")); return; } - #endif - DIAG(F("begin OK.")); - if (Ethernet.hardwareStatus() == EthernetNoHardware) { - DIAG(F("Ethernet shield not found")); - return; - } - - unsigned long startmilli = millis(); - while ((millis() - startmilli) < 5500) // Loop to give time to check for cable connection - { - if (Ethernet.linkStatus() == LinkON) - break; - DIAG(F("Ethernet waiting for link (1sec) ")); - delay(1000); - } - - if (Ethernet.linkStatus() == LinkOFF) { - DIAG(F("Ethernet cable not connected")); - return; - } - - connected=true; - - IPAddress ip = Ethernet.localIP(); // reassign the obtained ip address - - server = new EthernetServer(IP_PORT); // Ethernet Server listening on default port IP_PORT - server->begin(); - - LCD(4,F("IP: %d.%d.%d.%d"), ip[0], ip[1], ip[2], ip[3]); - LCD(5,F("Port:%d"), IP_PORT); - - outboundRing=new RingStream(OUTBOUND_RING_SIZE); + #endif } /** @@ -99,8 +76,9 @@ EthernetInterface::EthernetInterface() * */ void EthernetInterface::loop() -{ - if (!singleton) return; +{ + if(!singleton || ((!singleton->connected) && (!singleton->checkLink()))) + return; switch (Ethernet.maintain()) { @@ -125,6 +103,28 @@ void EthernetInterface::loop() } +bool EthernetInterface::checkLink() +{ + if (Ethernet.linkStatus() != LinkON) + return false; + + DIAG(F("Ethernet cable connected")); + + connected=true; + + IPAddress ip = Ethernet.localIP(); // reassign the obtained ip address + + server = new EthernetServer(IP_PORT); // Ethernet Server listening on default port IP_PORT + server->begin(); + + LCD(4,F("IP: %d.%d.%d.%d"), ip[0], ip[1], ip[2], ip[3]); + LCD(5,F("Port:%d"), IP_PORT); + + outboundRing=new RingStream(OUTBOUND_RING_SIZE); + + return true; +} + void EthernetInterface::loop2() { // get client from the server diff --git a/EthernetInterface.h b/EthernetInterface.h index 2a94ac6..ff673c1 100644 --- a/EthernetInterface.h +++ b/EthernetInterface.h @@ -60,6 +60,9 @@ class EthernetInterface { bool connected; EthernetInterface(); void loop2(); + + bool checkLink(); + EthernetServer * server; EthernetClient clients[MAX_SOCK_NUM]; // accept up to MAX_SOCK_NUM client connections at the same time; This depends on the chipset used on the Shield uint8_t buffer[MAX_ETH_BUFFER+1]; // buffer used by TCP for the recv From 64b1de08be6e1e78d8858c43dddfbed08d0a3097 Mon Sep 17 00:00:00 2001 From: Bruno Crivelari Sanches Date: Mon, 5 Sep 2022 14:23:54 -0300 Subject: [PATCH 05/55] Detects when ethernet cable is connected and is disconnected, also correctly handles EthernetServer tead down on such situations --- EthernetInterface.cpp | 74 ++++++++++++++++++++++++++++++++++--------- EthernetInterface.h | 5 +-- 2 files changed, 62 insertions(+), 17 deletions(-) diff --git a/EthernetInterface.cpp b/EthernetInterface.cpp index 9d04423..ddd762c 100644 --- a/EthernetInterface.cpp +++ b/EthernetInterface.cpp @@ -41,6 +41,7 @@ void EthernetInterface::setup() if (Ethernet.hardwareStatus() == EthernetNoHardware) { DIAG(F("Ethernet shield not found")); + delete singleton; singleton=NULL; return; @@ -71,13 +72,24 @@ EthernetInterface::EthernetInterface() #endif } +/** + * @brief Cleanup any resources + * + * @return none + */ +EthernetInterface::~EthernetInterface() +{ + delete server; + delete outboundRing; +} + /** * @brief Main loop for the EthernetInterface * */ void EthernetInterface::loop() { - if(!singleton || ((!singleton->connected) && (!singleton->checkLink()))) + if(!singleton || (!singleton->checkLink())) return; switch (Ethernet.maintain()) @@ -103,26 +115,58 @@ void EthernetInterface::loop() } +/** + * @brief Checks ethernet link cable status and detects when it connects / disconnects + * + * @return true when cable is connected, false otherwise + */ bool EthernetInterface::checkLink() { - if (Ethernet.linkStatus() != LinkON) - return false; - - DIAG(F("Ethernet cable connected")); + if (Ethernet.linkStatus() == LinkON) + { + //if we are not connected yet, setup a new server + if(!connected) + { + DIAG(F("Ethernet cable connected")); - connected=true; - - IPAddress ip = Ethernet.localIP(); // reassign the obtained ip address + connected=true; + + IPAddress ip = Ethernet.localIP(); // reassign the obtained ip address - server = new EthernetServer(IP_PORT); // Ethernet Server listening on default port IP_PORT - server->begin(); - - LCD(4,F("IP: %d.%d.%d.%d"), ip[0], ip[1], ip[2], ip[3]); - LCD(5,F("Port:%d"), IP_PORT); + server = new EthernetServer(IP_PORT); // Ethernet Server listening on default port IP_PORT + server->begin(); + + LCD(4,F("IP: %d.%d.%d.%d"), ip[0], ip[1], ip[2], ip[3]); + LCD(5,F("Port:%d"), IP_PORT); - outboundRing=new RingStream(OUTBOUND_RING_SIZE); + // + //only create a outboundRing it none exists, this may happen if the cable gets disconnected and connected again + if(!outboundRing) + outboundRing=new RingStream(OUTBOUND_RING_SIZE); + } - return true; + return true; + } + else if(connected) + { + DIAG(F("Ethernet cable disconnected")); + connected=false; + + //clean up any client + for (byte socket = 0; socket < MAX_SOCK_NUM; socket++) + { + if(clients[socket].connected()) + clients[socket].stop(); + } + + /* tear down server */ + delete server; + server = nullptr; + + LCD(4,F("IP: None")); + } + + return false; } void EthernetInterface::loop2() diff --git a/EthernetInterface.h b/EthernetInterface.h index ff673c1..ce5bbd9 100644 --- a/EthernetInterface.h +++ b/EthernetInterface.h @@ -59,14 +59,15 @@ class EthernetInterface { static EthernetInterface * singleton; bool connected; EthernetInterface(); + ~EthernetInterface(); void loop2(); bool checkLink(); - EthernetServer * server; + EthernetServer * server = nullptr; EthernetClient clients[MAX_SOCK_NUM]; // accept up to MAX_SOCK_NUM client connections at the same time; This depends on the chipset used on the Shield uint8_t buffer[MAX_ETH_BUFFER+1]; // buffer used by TCP for the recv - RingStream * outboundRing; + RingStream * outboundRing = nullptr; }; From 23d015880443db9dc776d1172ee461bcc2850814 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Mon, 5 Sep 2022 22:19:18 +0200 Subject: [PATCH 06/55] simplify EthernetInterface::setup, make code shorter and format according to our overall style --- EthernetInterface.cpp | 149 +++++++++++++++++------------------------- EthernetInterface.h | 34 +++++----- 2 files changed, 77 insertions(+), 106 deletions(-) diff --git a/EthernetInterface.cpp b/EthernetInterface.cpp index ddd762c..7d8fed8 100644 --- a/EthernetInterface.cpp +++ b/EthernetInterface.cpp @@ -1,6 +1,7 @@ /* + * © 2022 Bruno Sanches * © 2021 Fred Decker - * © 2020-2021 Harald Barth + * © 2020-2022 Harald Barth * © 2020-2021 Chris Harlow * © 2020 Gregor Baues * All rights reserved. @@ -35,17 +36,13 @@ EthernetInterface * EthernetInterface::singleton=NULL; */ void EthernetInterface::setup() { + if (Ethernet.hardwareStatus() == EthernetNoHardware) { + if (singleton!=NULL) + DIAG(F("Prog Error!")); + } else { singleton=new EthernetInterface(); - - DIAG(F("Ethernet begin OK.")); - if (Ethernet.hardwareStatus() == EthernetNoHardware) { - DIAG(F("Ethernet shield not found")); - - delete singleton; - singleton=NULL; - - return; - } + } + DIAG(F("Ethernet shield %sfound"), singleton==NULL ? "not " : ""); }; @@ -77,42 +74,35 @@ EthernetInterface::EthernetInterface() * * @return none */ -EthernetInterface::~EthernetInterface() -{ - delete server; - delete outboundRing; +EthernetInterface::~EthernetInterface() { + delete server; + delete outboundRing; } /** * @brief Main loop for the EthernetInterface * */ -void EthernetInterface::loop() -{ - if(!singleton || (!singleton->checkLink())) - return; - - switch (Ethernet.maintain()) - { - case 1: - //renewed fail - DIAG(F("Ethernet Error: renewed fail")); - singleton=NULL; - return; - - case 3: - //rebind fail - DIAG(F("Ethernet Error: rebind fail")); - singleton=NULL; - return; - - default: - //nothing happened - break; - } - - singleton->loop2(); +void EthernetInterface::loop() { + if(!singleton || (!singleton->checkLink())) + return; + switch (Ethernet.maintain()) { + case 1: + //renewed fail + DIAG(F("Ethernet Error: renewed fail")); + singleton=NULL; + return; + case 3: + //rebind fail + DIAG(F("Ethernet Error: rebind fail")); + singleton=NULL; + return; + default: + //nothing happened + break; + } + singleton->loop2(); } /** @@ -120,57 +110,40 @@ void EthernetInterface::loop() * * @return true when cable is connected, false otherwise */ -bool EthernetInterface::checkLink() -{ - if (Ethernet.linkStatus() == LinkON) - { - //if we are not connected yet, setup a new server - if(!connected) - { - DIAG(F("Ethernet cable connected")); - - connected=true; - - IPAddress ip = Ethernet.localIP(); // reassign the obtained ip address - - server = new EthernetServer(IP_PORT); // Ethernet Server listening on default port IP_PORT - server->begin(); - - LCD(4,F("IP: %d.%d.%d.%d"), ip[0], ip[1], ip[2], ip[3]); - LCD(5,F("Port:%d"), IP_PORT); - - // - //only create a outboundRing it none exists, this may happen if the cable gets disconnected and connected again - if(!outboundRing) - outboundRing=new RingStream(OUTBOUND_RING_SIZE); - } - - return true; - } - else if(connected) - { - DIAG(F("Ethernet cable disconnected")); - connected=false; - - //clean up any client - for (byte socket = 0; socket < MAX_SOCK_NUM; socket++) - { - if(clients[socket].connected()) - clients[socket].stop(); - } - - /* tear down server */ - delete server; - server = nullptr; - - LCD(4,F("IP: None")); +bool EthernetInterface::checkLink() { + if (Ethernet.linkStatus() == LinkON) { + //if we are not connected yet, setup a new server + if(!connected) { + DIAG(F("Ethernet cable connected")); + connected=true; + IPAddress ip = Ethernet.localIP(); // reassign the obtained ip address + server = new EthernetServer(IP_PORT); // Ethernet Server listening on default port IP_PORT + server->begin(); + LCD(4,F("IP: %d.%d.%d.%d"), ip[0], ip[1], ip[2], ip[3]); + LCD(5,F("Port:%d"), IP_PORT); + // only create a outboundRing it none exists, this may happen if the cable + // gets disconnected and connected again + if(!outboundRing) + outboundRing=new RingStream(OUTBOUND_RING_SIZE); } - - return false; + return true; + } else { // connected + DIAG(F("Ethernet cable disconnected")); + connected=false; + //clean up any client + for (byte socket = 0; socket < MAX_SOCK_NUM; socket++) { + if(clients[socket].connected()) + clients[socket].stop(); + } + // tear down server + delete server; + server = nullptr; + LCD(4,F("IP: None")); + } + return false; } - void EthernetInterface::loop2() -{ +void EthernetInterface::loop2() { // get client from the server EthernetClient client = server->accept(); diff --git a/EthernetInterface.h b/EthernetInterface.h index ce5bbd9..a4544c6 100644 --- a/EthernetInterface.h +++ b/EthernetInterface.h @@ -50,25 +50,23 @@ class EthernetInterface { - public: - - static void setup(); - static void loop(); - - private: - static EthernetInterface * singleton; - bool connected; - EthernetInterface(); - ~EthernetInterface(); - void loop2(); - - bool checkLink(); - - EthernetServer * server = nullptr; - EthernetClient clients[MAX_SOCK_NUM]; // accept up to MAX_SOCK_NUM client connections at the same time; This depends on the chipset used on the Shield - uint8_t buffer[MAX_ETH_BUFFER+1]; // buffer used by TCP for the recv - RingStream * outboundRing = nullptr; +public: + static void setup(); + static void loop(); +private: + static EthernetInterface * singleton; + bool connected; + EthernetInterface(); + ~EthernetInterface(); + void loop2(); + bool checkLink(); + + EthernetServer *server = nullptr; + EthernetClient clients[MAX_SOCK_NUM]; // accept up to MAX_SOCK_NUM client connections at the same time + // This depends on the chipset used on the Shield + uint8_t buffer[MAX_ETH_BUFFER+1]; // buffer used by TCP for the recv + RingStream * outboundRing = nullptr; }; #endif From cd15eed0056ae115397fe54dc415e7b2f301fc64 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Tue, 13 Sep 2022 22:42:38 +0200 Subject: [PATCH 07/55] EX-RAIL bugfix: Could not read long loco addrs --- EXRAIL2.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index 541e2fb..a6afa2d 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -551,7 +551,15 @@ bool RMFT2::skipIfBlock() { /* static */ void RMFT2::readLocoCallback(int16_t cv) { - progtrackLocoId=cv; + if (cv & LONG_ADDR_MARKER) { // maker bit indicates long addr + progtrackLocoId = cv ^ LONG_ADDR_MARKER; // remove marker bit to get real long addr + if (progtrackLocoId <= HIGHEST_SHORT_ADDR ) { // out of range for long addr + DIAG(F("Long addr %d <= %d unsupported\n"), progtrackLocoId, HIGHEST_SHORT_ADDR); + progtrackLocoId = -1; + } + } else { + progtrackLocoId=cv; + } } void RMFT2::loop() { From 06bd80438e92089364f3c5b3c0cbd69cf7c917eb Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Tue, 13 Sep 2022 22:46:43 +0200 Subject: [PATCH 08/55] new version --- version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.h b/version.h index 846ad3a..fc73a4b 100644 --- a/version.h +++ b/version.h @@ -3,11 +3,11 @@ #include "StringFormatter.h" - -#define VERSION "4.1.1 rc3" +#define VERSION "4.1.1 rc4" // 4.1.1 Bugfix: preserve turnout format // Bugfix: parse multiple commands in one buffer string correct // Bugfix: command signal status in Exrail +// Bugfix: EX-RAIL read long loco addr // 4.1.0 ... // // 4.0.2 EXRAIL additions: From 2da28ad2db24f6896a92974803b27c0bfefde189 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sun, 18 Sep 2022 22:23:18 +0200 Subject: [PATCH 09/55] version --- version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.h b/version.h index fc73a4b..4a65046 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,7 @@ #include "StringFormatter.h" -#define VERSION "4.1.1 rc4" +#define VERSION "4.1.1" // 4.1.1 Bugfix: preserve turnout format // Bugfix: parse multiple commands in one buffer string correct // Bugfix: command signal status in Exrail From 7388d14bab7f3eb05a6035cd818162008c53ddc5 Mon Sep 17 00:00:00 2001 From: Fred Date: Thu, 20 Oct 2022 16:08:40 -0400 Subject: [PATCH 10/55] Update release_notes.md --- release_notes.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/release_notes.md b/release_notes.md index e5b06ed..98cd5d1 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,4 +1,4 @@ -The DCC-EX Team is pleased to release CommandStation-EX-v4.0.0 as a Production Release. Release v4.0.0 is a Major release that adds significant new product design, plus Automation features and bug fixes. The team continues improving the architecture of DCC++EX to make it more flexible and optimizing the code so as to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v3.2.0 to v3.2.0 rc13. +The DCC-EX Team is pleased to release CommandStation-EX-v4.1.1 as a Production Release. Release v4.0.0 is a Minor release though it does add significant new automation features to EX-RAIL in addition to some small changes and bug fixes. The team continues improving the architecture of DCC++EX to make it more flexible and optimizing the code so as to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v4.0.1 to v4.1.1 rc13. **Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.** @@ -8,6 +8,39 @@ The DCC-EX Team is pleased to release CommandStation-EX-v4.0.0 as a Production R [CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v0.0.0-Prod/CommandStation-EX.tar.gz) +**EX-RAIL New Features** + + - ACK defaults set to 50mA LIMIT, 2000uS MIN, 20000uS MAX for more compatibility with non NMRA compliant decoders + - Automatically detect and run a myFilter add-on (no need to call setFilter) + - Add commands + - Add "if" signal detection with IFRED(signal_id), IFAMBER(signal_id), IFGREEN(signal_id) + - New command to obtain current throttle settings + - New JA, JR, JT commands to obtain route, roster and turnout descriptions + - Add ability for HIDDEN turnouts (hide a REAL turnout and create a VIRTUAL turnout to handle actions that happen BEFORE a turnout is thrown) + - Add VIRTUAL_TURNOUT definition + - New PARSE <> commands in EXRAIL allows sending of command station commands from EX-RAIL + - New and KILLALL command to stop all tasks + - Add FORGET command. Forgets the current loco in DCC reminder tables saving memory and wasted packets sent to the track + - Add Servo signals (SERVO_SIGNAL) + - Add High-On signal pins (SIGNALH) (Arduino normally handles active LOW signals. This allows for active HIGH) + - Add Wait for analog value (ATGTE, ATLT)... (At greater than or Equal and At less than a certain value) + +**EX-RAIL Updates** + + - EXRAIL BROADCAST("msg") sends any message to all throttles/JMRI via serial and WiFi + - EXRAIL POWERON turns on power to both tracks from EX-RAIL (the equivalent of sending the <1> command) + + +**4.1.1 Bug Fixes** + +- Preserve the turnout format +- Parse multiple commands in one buffer string currectly +- Fix command signal status in EX-RAIL +- Read long loco addresses in EX-RAIL +- FIX negative route IDs in WIthrottle + +See the version.h file for notes about which of the 4.1.1 features were added/changed by point release. + **Known Issues** - **Wi-Fi** - Requires sending `` commands from a serial monitor if you want to switch between AP mode and STA station mode after initial setup From 1901d9547eb8cea2438b486415c833c25c0297bb Mon Sep 17 00:00:00 2001 From: Fred Date: Thu, 20 Oct 2022 16:23:13 -0400 Subject: [PATCH 11/55] Update release_notes.md --- release_notes.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/release_notes.md b/release_notes.md index 98cd5d1..7943f42 100644 --- a/release_notes.md +++ b/release_notes.md @@ -252,7 +252,7 @@ See the version.h file for notes about which of the 4.1.1 features were added/ch - Fred Decker - Holly Springs, North Carolina, USA (FlightRisk) -**CommandStation-EX Developers** +**EX-CommandStation Developers** - Chris Harlow - Bournemouth, UK (UKBloke) - Harald Barth - Stockholm, Sweden (Haba) @@ -267,7 +267,7 @@ See the version.h file for notes about which of the 4.1.1 features were added/ch - M Steve Todd -**exInstaller Software** +**EX-Installer Software** - Anthony W - Dayton, Ohio, USA (Dex, Dex++) @@ -280,12 +280,22 @@ See the version.h file for notes about which of the 4.1.1 features were added/ch - Keith Ledbetter - Chicago, Illinois, USA (Keith Ledbetter) - Kevin Smith - Rochester Hills, Michigan USA (KC Smith) - Colin Grabham - Central NSW, Australia (Kebbin) +- Peter Cole - Brisbane, QLD, Australia (peteGSX) +- Peter Akers - Brisbane, QLD, Australia (flash62au) -**WebThrotle-EX** +**EX-WebThrottle** - Fred Decker - Holly Springs, NC (FlightRisk/FrightRisk) - Mani Kumar - Bangalor, India (Mani /Mani Kumar) - Matt H - Somewhere in Europe + +**Hardware / Electronics** + +- Harald Barth - Stockholm, Sweden (Haba) +- Paul Antoine, Western Australia +- Neil McKechnie - Worcestershire, UK +- Fred Decker - Holly Springs NC, USA +- Herb Morton - Kingwood Texas, USA (Ash++) **Beta Testing / Release Management / Support** From dcab5a0e7268818f39d6330cac001c13606a3b6d Mon Sep 17 00:00:00 2001 From: Fred Date: Thu, 20 Oct 2022 16:25:10 -0400 Subject: [PATCH 12/55] Create release_notes_v4.1.1.md --- Release_Notes/release_notes_v4.1.1.md | 325 ++++++++++++++++++++++++++ 1 file changed, 325 insertions(+) create mode 100644 Release_Notes/release_notes_v4.1.1.md diff --git a/Release_Notes/release_notes_v4.1.1.md b/Release_Notes/release_notes_v4.1.1.md new file mode 100644 index 0000000..7943f42 --- /dev/null +++ b/Release_Notes/release_notes_v4.1.1.md @@ -0,0 +1,325 @@ +The DCC-EX Team is pleased to release CommandStation-EX-v4.1.1 as a Production Release. Release v4.0.0 is a Minor release though it does add significant new automation features to EX-RAIL in addition to some small changes and bug fixes. The team continues improving the architecture of DCC++EX to make it more flexible and optimizing the code so as to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v4.0.1 to v4.1.1 rc13. + +**Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.** + +[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.0.0-Prod/CommandStation-EX.zip) + + + +[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v0.0.0-Prod/CommandStation-EX.tar.gz) + +**EX-RAIL New Features** + + - ACK defaults set to 50mA LIMIT, 2000uS MIN, 20000uS MAX for more compatibility with non NMRA compliant decoders + - Automatically detect and run a myFilter add-on (no need to call setFilter) + - Add commands + - Add "if" signal detection with IFRED(signal_id), IFAMBER(signal_id), IFGREEN(signal_id) + - New command to obtain current throttle settings + - New JA, JR, JT commands to obtain route, roster and turnout descriptions + - Add ability for HIDDEN turnouts (hide a REAL turnout and create a VIRTUAL turnout to handle actions that happen BEFORE a turnout is thrown) + - Add VIRTUAL_TURNOUT definition + - New PARSE <> commands in EXRAIL allows sending of command station commands from EX-RAIL + - New and KILLALL command to stop all tasks + - Add FORGET command. Forgets the current loco in DCC reminder tables saving memory and wasted packets sent to the track + - Add Servo signals (SERVO_SIGNAL) + - Add High-On signal pins (SIGNALH) (Arduino normally handles active LOW signals. This allows for active HIGH) + - Add Wait for analog value (ATGTE, ATLT)... (At greater than or Equal and At less than a certain value) + +**EX-RAIL Updates** + + - EXRAIL BROADCAST("msg") sends any message to all throttles/JMRI via serial and WiFi + - EXRAIL POWERON turns on power to both tracks from EX-RAIL (the equivalent of sending the <1> command) + + +**4.1.1 Bug Fixes** + +- Preserve the turnout format +- Parse multiple commands in one buffer string currectly +- Fix command signal status in EX-RAIL +- Read long loco addresses in EX-RAIL +- FIX negative route IDs in WIthrottle + +See the version.h file for notes about which of the 4.1.1 features were added/changed by point release. + +**Known Issues** + +- **Wi-Fi** - Requires sending `` commands from a serial monitor if you want to switch between AP mode and STA station mode after initial setup +- **Pololu Motor Shield** - is supported with this release, but the user may have to adjust timings to enable programming mode due to limitations in its current sensing circuitry + +**All New Major DCC++EX 4.0.0 features** + +- **New HAL Hardware Abstraction Layer API** that automatically detects and greatly simplifies interfacing to many predefined accessory boards for servos, signals & sensors and added I/O (digital and analog inputs and outputs, servos etc). +- HAL Support for; + - MCP23008, MCP23017 and PCF9584 I2C GPIO Extender modules. + - PCA9685 PWM (servo & signal) control modules. + - Analogue inputs on Arduino pins and on ADS111x I2C modules. + - MP3 sound playback via DFPlayer module. + - HC-SR04 Ultrasonic range sensor module. + - VL53L0X Laser range sensor module (Time-Of-Flight). + - A new `` command to list the HAL devices attached to the command station + +**New Command Station Broadcast throttle logic** + +- Synchronizes multiple WiThrottles and PC based JMRI Throttles for direction, speed and F-key updates + +**New ‘Discovered Servers’ on WiFi Throttles** + +- Our New multicast Dynamic Network Server (mDNS) enhancement allows us to display the available WiFi server connections to a DCC++EX Command Station. Selecting it allows your WiThrottle App to connect to and load Server Rosters and function keys to your throttle from the new DCC++EX Command Station Server Roster. + +**New DCC++EX 4.0.0 with EX-RAIL Extended Railroad Automation Instruction Language** + +- Use to control your entire layout or as a separate accessory/animation controller +- Awesome, cleverly powerful yet simple user friendly scripting language for user built Automation & Routing scripts. +- You can control Engines, Sensors, Turnouts, Signals, Outputs and Accessories that are entered into your new myAutomation.h file, then uploaded into the DCC++EX Command Station. +- EX-RAIL scripts are automatically displayed as Automation {Handoff} and Route {Set} buttons on supported WiFi Throttle Apps. + +**New EX-RAIL ‘Roster’ Feature** + +- List and store user defined engine roster & function keys inside the command station, and automatically load them in WiFi Throttle Apps. +- When choosing “DCC++EX” from discovered servers an Engine Driver or WiThrottle is directly connected to the Command Station. +- The EX-RAIL ’ROSTER’ command allows all the engine numbers, names and function keys you’ve listed in your myAutomation.h file to automatically upload the Command Station's ‘Server Roster’ into your Engine Driver and WiThrottle Apps. + +**New JMRI 4.99.2 and above specific DCC++EX 4.0 features** + +- Enhanced JMRI DCC++ Configure Base Station pane for building and maintaining Sensor, Turnout and Output devices, or these can automatically be populated from the DCC++EX Command Station's mySetup.h file into JMRI. + +- JMRI now supports multiple serial connected DCC++EX Command Stations, to display and track separate "Send DCC++ Command" and "DCC++ Traffic" Monitors for each Command Station at the same time. + For example: Use an Uno DCC++EX DecoderPro Programming Station {DCC++Prg} on a desktop programming track and a second Mega DCC++EX EX-RAIL Command Station for Operations {DCC++Ops} on the layout with an additional `` programming spur or siding track for acquiring an engine and ‘Drive Away’ onto the mainline (see the DriveAway feature for more information). + +**DCC++EX 4.0.0 additional product enhancements** + +- Additional Motor Shields and Motor Board {boosters) supported +- Additional Accessory boards supported for GPIO expansion, Sensors, Servos & Signals +- Additional diagnostic commands like ‘D ACK RETRY’ and ‘D EXRAIL ON’ events, ‘D HAL SHOW’ devices and ‘D SERVO’ positions, and ‘D RESET’ the command station while maintaining the serial connection with JMRI +- Automatic retry on failed ACK detection to give decoders another chance +- New EX-RAIL ’/’ slash command allows JMRI to directly communicate with many EX-RAIL scripts +- Turnout class revised to expand turnout capabilities and allow turnout names/descriptors to display in WiThrottle Apps. +- Build turnouts through either or both mySetup.h and myAutomation.h files, and have them automatically passed to, and populate, JMRI Turnout Tables +- Turnout user names display in Engine Driver & WiThrottles +- Output class now allows ID > 255. +- Configuration options to globally flip polarity of DCC Accessory states when driven from `` command and `` command. +- Increased use of display for showing loco decoder programming information. +- Can disable EEPROM memory code to allow room for DCC++EX 4.0 to fit on a Uno Command Station +- Can define border between long and short addresses +- Native non-blocking I2C drivers for AVR and Nano architectures (fallback to blocking Wire library for other platforms). +- EEPROM layout change - deletes EEPROM contents on first start following upgrade. + +**4.0.0 Bug Fixes** + +- Compiles on Nano Every +- Diagnostic display of ack pulses >32ms +- Current read from wrong ADC during interrupt +- AT(+) Command Pass Through +- CiDAP WiFi Drop out and the WiThrottle F-key looping error corrected +- One-off error in CIPSEND drop +- Common Fault Pin Error +- Uno Memory Utilization optimized + +#### Summary of Release 3.1.0 key features and/or bug fixes by Point Release + +**Summary of the key new features added to CommandStation-EX V3.0.16** + +- Ignore CV1 bit 7 read if rejected by a non NMRA compliant decoder when identifying loco id + +**Summary of the key new features added to CommandStation-EX V3.0.15** + +- Send function commands just once instead of repeating them 4 times + +**Summary of the key new features added to CommandStation-EX V3.0.14** + +- Add feature to tolerate decoders that incorrectly have gaps in their ACK pulse +- Provide proper track power management when joining and unjoining tracks with <1 JOIN> + +**Summary of the key new features added to CommandStation-EX V3.0.13** + +- Fix for CAB Functions greater than 127 + +**Summary of the key new features added to CommandStation-EX V3.0.12** + +- Fixed clear screen issue for nanoEvery and nanoWifi + +**Summary of the key new features added to CommandStation-EX V3.0.11** + +- Reorganized files for support of 128 speed steps + +**Summary of the key new features added to CommandStation-EX V3.0.10** + +- Added Support for the Teensy 3.2, 3.5, 3.6, 4.0 and 4.1 MCUs +- No functional change just changes to avoid complier warnings for Teensy/nanoEvery + +**Summary of the key new features added to CommandStation-EX V3.0.9** + +- Rearranges serial newlines for the benefit of JMRI +- Major update for efficiencies in displays (LCD, OLED) +- Add I2C Support functions + +**Summary of the key new features added to CommandStation-EX V3.0.8** + +- Wraps <* *> around DIAGS for the benefit of JMRI + +**Summary of the key new features added to CommandStation-EX V3.0.7** + +- Implemented support for older 28 apeed step decoders - Option to turn on 28 step speed decoders in addition to 128. If set, all locos will use 28 steps. +- Improved overload messages with raw values (relative to offset) + +**Summary of the key new features added to CommandStation-EX V3.0.6** + +- Prevent compiler warning about deprecated B constants +- Fix Bug that did not let us transmit 5 byte sized packets - 5 Byte commands like PoM (programming on main) were not being sent correctly +- Support for Huge function numbers (DCC BinaryStateControl) - Support Functions beyond F28 +- ESTOP all - New command to emergency stop all locos on the main track +- <- [cab]> estop and forget cab/all cabs - Stop and remove loco from the CS. Stops the repeating throttle messages +- `` command to reboot Arduino +- Automatic sensor offset detect +- Improved startup msgs from Motor Drivers (accuracy and auto sense factors) +- Drop post-write verify - No need to double check CV writes. Writes are now even faster. +- Allow current sense pin set to UNUSED_PIN - No need to ground an unused analog current pin. Produce startup warning and callback -2 for prog track cmds. + +**Summary of the key new features added to CommandStation-EX V3.0.5** + +- Fix Fn Key startup with loco ID and fix state change for F16-28 +- Removed ethernet mac config and made it automatic +- Show wifi ip and port on lcd +- Auto load config.example.h with warning +- Dropped example .ino files +- Corrected .ino comments +- Add Pololu fault pin handling +- Waveform speed/simplicity improvements +- Improved pin speed in waveform +- Portability to nanoEvery and UnoWifiRev2 CPUs +- Analog read speed improvements +- Drop need for DIO2 library +- Improved current check code +- Linear command +- Removed need for ArduinoTimers files +- Removed option to choose different timer +- Added EX-RAIL hooks for automation in future version +- Fixed Turnout list +- Allow command keywords in mixed case +- Dropped unused memstream +- PWM pin accuracy if requirements met + +**Summary of the key new features added to CommandStation-EX V3.0.4** + +- "Drive-Away" Feature - added so that throttles 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 +- WiFi Startup Fixes + +**Summary of the key new features added to CommandStation-EX V3.0.3** + +- Command to write loco address and clear consist +- Command will allow for consist address +- Startup commands implemented + +**Summary of the key new features added to CommandStation-EX V3.0.2:** + +- Create new output for current in mA for `` command - New current response outputs current in mA, overlimit current, and maximum board capable current +- Simultaneously update JMRI to handle new current meter + +**Summary of the key new features added to CommandStation-EX V3.0.1:** + +- Add back fix for jitter +- Add Turnouts, Outputs and Sensors to `` command output + +**CommandStation-EX V3.0.0:** + +**Release v3.0.0 was a major rewrite if earlier versions of DCC++. The code base was re-architeced and core changes were made to the Waveform generator to reduce overhead and make better use of Arduino.** **Summary of the key new features added in Release v3.0.0 include:** + +- **New USB Browser Based Throttle** - WebThrottle-EX is a full front-end to controller to control the CS to run trains. +- **WiFi Support** - AP and station modes supported. Auto-detection of an ESP8266 WiFi module with AT firmware on a Mega's serial port. Connection to JMRI and WiThrottle clients. +- **Withrottle Integrations** - Act as a host for up to four WiThrottle clients concurrently. +- **Add LCD/OLED support** - OLED supported on Mega only +- **Improved CV programming routines** - checks for length of CV pulse, and breaks out of the wait state once it has received an ACK, now reading one CV per second. +- **Improved current sensing** - rewrote current sensing routines for safer operation. Current thresholds based on milliamps, not magic numbers +- **Individual track power control** - Ability to toggle power on either or both tracks, and to "JOIN" the tracks and make them output the same waveform for multiple power districts. +- **Single or Dual-Pin PWM output** - Allows control of H-bridges with PH/EN or dual PWM inputs +- **New, simpler function command** - `` command allows setting functions based on their number, not based on a code as in `` +- **Function reminders** - Function reminders are sent in addition to speed reminders +- **Functions to F28** - All NMRA functions are now supported +- **Filters and user functions** - Ability to filter commands in the parser and execute custom code based on them. (ex: Redirect Turnout commands via NRF24) +- **Diagnostic `` commands** - See documentation for a full list of new diagnostic commands +- **Rewrote DCC++ Parser** - more efficient operation, accepts multi-char input and uses less RAM +- **Rewritten waveform generator** - capable of using any pin for DCC waveform out, eliminating the need for jumpers +- **Rewritten packet generator** - Simplify and make smaller, remove idea of "registers" from original code +- **Add free RAM messages** - Free RAM messages are now printed whenever there is a decerase in available RAM +- **Fix EEPROM bugs** +- **Number of locos discovery command** - `<#>` command +- **Support for more locomotives** - 20 locomotives on an UNO and 50 an a Mega. +- **Automatic slot management** - slot variable in throttle/function commands are ignored and slot management is taken care of automatically. `<->` and `<- CAB>` commands added to release locos from memory and stop packets to the track. + +**Key Contributors** + +**Project Lead** + +- Fred Decker - Holly Springs, North Carolina, USA (FlightRisk) + +**EX-CommandStation Developers** + +- Chris Harlow - Bournemouth, UK (UKBloke) +- Harald Barth - Stockholm, Sweden (Haba) +- Neil McKechnie - Worcestershire, UK (NeilMck) +- Fred Decker - Holly Springs, North Carolina, USA (FlightRisk) +- Dave Cutting - Logan, Utah, USA (Dave Cutting/ David Cutting) +- M Steve Todd - Oregon, USA (MSteveTodd) +- Scott Catalano - Pennsylvania +- Gregor Baues - Île-de-France, France (grbba) + +**Engine Driver and JMRI Interface** + +- M Steve Todd + +**EX-Installer Software** + +- Anthony W - Dayton, Ohio, USA (Dex, Dex++) + +**Website and Documentation** + +- Mani Kumar - Bangalor, India (Mani / Mani Kumar) +- Fred Decker - Holly Springs, North Carolina, USA (FlightRisk) +- Dave Cutting - Logan, Utah, USA (Dave Cutting/ David Cutting) +- Roger Beschizza - Dorset, UK (Roger Beschizza) +- Keith Ledbetter - Chicago, Illinois, USA (Keith Ledbetter) +- Kevin Smith - Rochester Hills, Michigan USA (KC Smith) +- Colin Grabham - Central NSW, Australia (Kebbin) +- Peter Cole - Brisbane, QLD, Australia (peteGSX) +- Peter Akers - Brisbane, QLD, Australia (flash62au) + +**EX-WebThrottle** + +- Fred Decker - Holly Springs, NC (FlightRisk/FrightRisk) +- Mani Kumar - Bangalor, India (Mani /Mani Kumar) +- Matt H - Somewhere in Europe + +**Hardware / Electronics** + +- Harald Barth - Stockholm, Sweden (Haba) +- Paul Antoine, Western Australia +- Neil McKechnie - Worcestershire, UK +- Fred Decker - Holly Springs NC, USA +- Herb Morton - Kingwood Texas, USA (Ash++) + +**Beta Testing / Release Management / Support** + +- Larry Dribin - Release Management +- Kevin Smith - Rochester Hills, Michigan USA (KC Smith) +- Herb Morton - Kingwood Texas, USA (Ash++) +- Keith Ledbetter +- Brad Van der Elst +- Andrew Pye +- Mike Bowers +- Randy McKenzie +- Roberto Bravin +- Sam Brigden +- Alan Lautenslager +- Martin Bafver +- Mário André Silva +- Anthony Kochevar +- Gajanatha Kobbekaduwe +- Sumner Patterson +- Paul - Virginia, USA + +**Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.** + +[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.0.0-Prod/CommandStation-EX.zip) + + +[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.0.0-Prod/CommandStation-EX.tar.gz) From e618b91900cfeed72ef1857d3c546577e068f1fd Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 21 Oct 2022 11:57:55 -0400 Subject: [PATCH 13/55] Update version.h --- version.h | 55 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/version.h b/version.h index 4a65046..c2bb135 100644 --- a/version.h +++ b/version.h @@ -5,30 +5,55 @@ #define VERSION "4.1.1" // 4.1.1 Bugfix: preserve turnout format -// Bugfix: parse multiple commands in one buffer string correct +// Bugfix: parse multiple commands in one buffer string correctly (ex: ) // Bugfix: command signal status in Exrail // Bugfix: EX-RAIL read long loco addr +// Bugfix: Add space character after version string 4.1.1 for JMRI parsing. +// Improved display and loop time for signalsmake service start to be outside the DONT_TOUCH_WIFI_CONF area +// Improve WiFi startup by making service start to be outside the DONT_TOUCH_WIFI_CONF area // 4.1.0 ... // // 4.0.2 EXRAIL additions: -// ACK defaults set to 50mA LIMIT, 2000uS MIN, 20000uS MAX +// Code: struct TurnoutData to enable EEPROM in v 4.0 format +// Code: Fix weak reference to myFilter +// Updated CV read command . Equivalent to . Uses the verify callback. +// Allow WRITE CV on PROG commands -// command to obtain current throttle settings -// JA, JR, JT commands to obtain route, roster and turnout descriptions -// HIDDEN turnouts -// PARSE <> commands in EXRAIL -// VIRTUAL_TURNOUT -// and KILLALL command to stop all tasks. +// FIX negative route ids in WIthrottle problem by allowing them +// Add IFRED(signal_id), IFAMBER(signal_id), IFGREEN(signal_id) +// Add commands +// Add command to obtain current throttle settings +// Add JA, JR, JT commands to obtain route, roster and turnout descriptions +// Add HIDDEN turnouts +// Add PARSE <> commands in EXRAIL +// Add VIRTUAL_TURNOUT +// Add and KILLALL command to stop all tasks +// Add Diagnostic messages when KILL is used // FORGET forgets the current loco in DCC reminder tables. -// Servo signals (SERVO_SIGNAL) -// High-On signal pins (SIGNALH) -// Wait for analog value (ATGTE, ATLT) +// Add Servo signals (SERVO_SIGNAL) +// Add High-On signal pins (SIGNALH) +// Add Wait for analog value (ATGTE, ATLT) +// Allow underscore in keywords ex: MY_KEYWORD +// Automatically assign a name with ALIAS(name) without having to define it first +// README.md: removed misleading "folder/subforlders" (#218) +// README.md: fix dead link to rewrite (#217) in notes/rewrite.md +// Incoming LCN turnout throw +// Broadcast jopin after DriveAway +// Corrections to I2C code: +// 1) I2CManager_Mega4809.h: Correct bitwise 'and' to logical 'and' - no impact. +// 2) I2CManager_Wire.h: Ensure that error codes from Wire subsystem are passed back to caller in queueRequest(). +// Save memory on the Uno // 4.0.1 Small EXRAIL updates // EXRAIL BROADCAST("msg") -// EXRAIL POWERON +// EXRAIL POWERON (only turns on MAIN) +// Remove EXRAIL/ENDEXRAIL from myAutomation.example.h (#215) +// Use "startup sequence" to describe the initial instructions +// Add description of display scroll modes +// restructure GetLocoCallback() for better readability and put broadcastPower() at right place // 4.0.0 Major functional and non-functional changes. // Engine Driver "DriveAway" feature enhancement // 'Discovered Server' multicast Dynamic Network Server (mDNS) displays available WiFi connections to a DCC++EX Command Station From 941e74beaf1a974f01e0b2176ddec9919fd11234 Mon Sep 17 00:00:00 2001 From: Kcsmith0708 Date: Fri, 21 Oct 2022 13:45:54 -0400 Subject: [PATCH 14/55] Realese Document Edit & Enhancements (#262) * Realese Document Edit & Enhancements Edited Intro and Rearranged EXRAIL Enhancements * Update release_notes_v4.1.1.md edited indents * Update release_notes_v4.1.1.md Fomating --- Release_Notes/release_notes_v4.1.1.md | 46 ++++++++++++++++----------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/Release_Notes/release_notes_v4.1.1.md b/Release_Notes/release_notes_v4.1.1.md index 7943f42..875243a 100644 --- a/Release_Notes/release_notes_v4.1.1.md +++ b/Release_Notes/release_notes_v4.1.1.md @@ -1,4 +1,6 @@ -The DCC-EX Team is pleased to release CommandStation-EX-v4.1.1 as a Production Release. Release v4.0.0 is a Minor release though it does add significant new automation features to EX-RAIL in addition to some small changes and bug fixes. The team continues improving the architecture of DCC++EX to make it more flexible and optimizing the code so as to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v4.0.1 to v4.1.1 rc13. +The DCC-EX Team is pleased to release CommandStation-EX v4.1.1 as a Production Release for the general public. +This release is a Minor release with many significant EX-RAIL enhancements and new automation features in addition to some bug fixes. +The team continues improving the architecture of DCC++EX to make it more flexible and optimizing the code to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v4.0.1 to v4.1.1 rc13. **Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.** @@ -8,28 +10,36 @@ The DCC-EX Team is pleased to release CommandStation-EX-v4.1.1 as a Production R [CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v0.0.0-Prod/CommandStation-EX.tar.gz) -**EX-RAIL New Features** - - - ACK defaults set to 50mA LIMIT, 2000uS MIN, 20000uS MAX for more compatibility with non NMRA compliant decoders +**New Command Station & EX-RAIL Features** + - ACK defaults are now set to LIMIT 50mA, MIN 2000uS, MAX 2000uS for more compatibility with non NMRA compliant decoders - Automatically detect and run a myFilter add-on (no need to call setFilter) - - Add commands - - Add "if" signal detection with IFRED(signal_id), IFAMBER(signal_id), IFGREEN(signal_id) - - New command to obtain current throttle settings - - New JA, JR, JT commands to obtain route, roster and turnout descriptions - - Add ability for HIDDEN turnouts (hide a REAL turnout and create a VIRTUAL turnout to handle actions that happen BEFORE a turnout is thrown) - - Add VIRTUAL_TURNOUT definition - - New PARSE <> commands in EXRAIL allows sending of command station commands from EX-RAIL - - New and KILLALL command to stop all tasks - - Add FORGET command. Forgets the current loco in DCC reminder tables saving memory and wasted packets sent to the track - - Add Servo signals (SERVO_SIGNAL) - - Add High-On signal pins (SIGNALH) (Arduino normally handles active LOW signals. This allows for active HIGH) - - Add Wait for analog value (ATGTE, ATLT)... (At greater than or Equal and At less than a certain value) - -**EX-RAIL Updates** + - New Commands for the Arduino IDE Serial Monitor and JMRI DCC++ Traffic Monitor + - commands + - and KILLALL command to stop all tasks + - command to obtain current throttle settings + + - New JA, JR, JT commands availabe for Throttle Developers to obtain Route, Roster and Turnout descriptions for communications + + - New EX-RAIL Functions to use in Automation(n), ROUTE(N) & SEQUENCE(N) Scripts + - ATGTE & ATLT wait for analog value, (At Greater Than or Equal and At Less Than a certain value) + - FADE command now works for LEDs connected on PCA9685 Servo/Signal board Output vpins + - FORGET Forgets the current loco in DCC reminder tables saving memory and wasted packets sent to the track + - "IF" signal detection with IFRED(signal_id), IFAMBER(signal_id), IFGREEN(signal_id) + - PARSE <> commands in EXRAIL allows sending of DCC-EX commands from EX-RAIL + - SERVO_SIGNAL Servo signals assigned to a specific servo turnout + - SIGNALH High-On signal pins (Arduino normally handles active LOW signals. This allows for active HIGH) + - HIDDEN turnouts (hide a REAL turnout and create a VIRTUAL turnout to handle actions that happen BEFORE a turnout is thrown) + - VIRTUAL_TURNOUT definition + +**EX-RAIL Updates** - EXRAIL BROADCAST("msg") sends any message to all throttles/JMRI via serial and WiFi - EXRAIL POWERON turns on power to both tracks from EX-RAIL (the equivalent of sending the <1> command) +** Other Enhancements** + - UNO Progmem is optimize to allow for small EXRAIL Automation scipts to run within the limited space for testing purposes. + - PCA9685 Servo Signal board supports 'Nopoweroffleds', servo pins stay powered on after position reached, otherwise the new FADE would always turn off. + - Position servo can use spare servo pin as a GPIO pin. **4.1.1 Bug Fixes** From d72474cd8f7b8132fd31347a4dcd527f2954d50e Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 21 Oct 2022 20:03:00 -0400 Subject: [PATCH 15/55] Update release_notes_v4.1.1.md --- Release_Notes/release_notes_v4.1.1.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Release_Notes/release_notes_v4.1.1.md b/Release_Notes/release_notes_v4.1.1.md index 875243a..03a9a45 100644 --- a/Release_Notes/release_notes_v4.1.1.md +++ b/Release_Notes/release_notes_v4.1.1.md @@ -4,11 +4,11 @@ The team continues improving the architecture of DCC++EX to make it more flexibl **Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.** -[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.0.0-Prod/CommandStation-EX.zip) +[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.1-Prod/CommandStation-EX.zip) -[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v0.0.0-Prod/CommandStation-EX.tar.gz) +[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.1-Prod/CommandStation-EX.tar.gz) **New Command Station & EX-RAIL Features** - ACK defaults are now set to LIMIT 50mA, MIN 2000uS, MAX 2000uS for more compatibility with non NMRA compliant decoders @@ -329,7 +329,7 @@ See the version.h file for notes about which of the 4.1.1 features were added/ch **Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.** -[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.0.0-Prod/CommandStation-EX.zip) +[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.1-Prod/CommandStation-EX.zip) -[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.0.0-Prod/CommandStation-EX.tar.gz) +[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.1-Prod/CommandStation-EX.tar.gz) From 39a85903cec643814254d7b52f5d486490f87e46 Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 21 Oct 2022 20:04:05 -0400 Subject: [PATCH 16/55] Update release_notes.md --- release_notes.md | 54 ++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/release_notes.md b/release_notes.md index 7943f42..03a9a45 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,35 +1,45 @@ -The DCC-EX Team is pleased to release CommandStation-EX-v4.1.1 as a Production Release. Release v4.0.0 is a Minor release though it does add significant new automation features to EX-RAIL in addition to some small changes and bug fixes. The team continues improving the architecture of DCC++EX to make it more flexible and optimizing the code so as to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v4.0.1 to v4.1.1 rc13. +The DCC-EX Team is pleased to release CommandStation-EX v4.1.1 as a Production Release for the general public. +This release is a Minor release with many significant EX-RAIL enhancements and new automation features in addition to some bug fixes. +The team continues improving the architecture of DCC++EX to make it more flexible and optimizing the code to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v4.0.1 to v4.1.1 rc13. **Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.** -[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.0.0-Prod/CommandStation-EX.zip) +[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.1-Prod/CommandStation-EX.zip) -[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v0.0.0-Prod/CommandStation-EX.tar.gz) +[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.1-Prod/CommandStation-EX.tar.gz) -**EX-RAIL New Features** - - - ACK defaults set to 50mA LIMIT, 2000uS MIN, 20000uS MAX for more compatibility with non NMRA compliant decoders +**New Command Station & EX-RAIL Features** + - ACK defaults are now set to LIMIT 50mA, MIN 2000uS, MAX 2000uS for more compatibility with non NMRA compliant decoders - Automatically detect and run a myFilter add-on (no need to call setFilter) - - Add commands - - Add "if" signal detection with IFRED(signal_id), IFAMBER(signal_id), IFGREEN(signal_id) - - New command to obtain current throttle settings - - New JA, JR, JT commands to obtain route, roster and turnout descriptions - - Add ability for HIDDEN turnouts (hide a REAL turnout and create a VIRTUAL turnout to handle actions that happen BEFORE a turnout is thrown) - - Add VIRTUAL_TURNOUT definition - - New PARSE <> commands in EXRAIL allows sending of command station commands from EX-RAIL - - New and KILLALL command to stop all tasks - - Add FORGET command. Forgets the current loco in DCC reminder tables saving memory and wasted packets sent to the track - - Add Servo signals (SERVO_SIGNAL) - - Add High-On signal pins (SIGNALH) (Arduino normally handles active LOW signals. This allows for active HIGH) - - Add Wait for analog value (ATGTE, ATLT)... (At greater than or Equal and At less than a certain value) - -**EX-RAIL Updates** + - New Commands for the Arduino IDE Serial Monitor and JMRI DCC++ Traffic Monitor + - commands + - and KILLALL command to stop all tasks + - command to obtain current throttle settings + + - New JA, JR, JT commands availabe for Throttle Developers to obtain Route, Roster and Turnout descriptions for communications + + - New EX-RAIL Functions to use in Automation(n), ROUTE(N) & SEQUENCE(N) Scripts + - ATGTE & ATLT wait for analog value, (At Greater Than or Equal and At Less Than a certain value) + - FADE command now works for LEDs connected on PCA9685 Servo/Signal board Output vpins + - FORGET Forgets the current loco in DCC reminder tables saving memory and wasted packets sent to the track + - "IF" signal detection with IFRED(signal_id), IFAMBER(signal_id), IFGREEN(signal_id) + - PARSE <> commands in EXRAIL allows sending of DCC-EX commands from EX-RAIL + - SERVO_SIGNAL Servo signals assigned to a specific servo turnout + - SIGNALH High-On signal pins (Arduino normally handles active LOW signals. This allows for active HIGH) + - HIDDEN turnouts (hide a REAL turnout and create a VIRTUAL turnout to handle actions that happen BEFORE a turnout is thrown) + - VIRTUAL_TURNOUT definition + +**EX-RAIL Updates** - EXRAIL BROADCAST("msg") sends any message to all throttles/JMRI via serial and WiFi - EXRAIL POWERON turns on power to both tracks from EX-RAIL (the equivalent of sending the <1> command) +** Other Enhancements** + - UNO Progmem is optimize to allow for small EXRAIL Automation scipts to run within the limited space for testing purposes. + - PCA9685 Servo Signal board supports 'Nopoweroffleds', servo pins stay powered on after position reached, otherwise the new FADE would always turn off. + - Position servo can use spare servo pin as a GPIO pin. **4.1.1 Bug Fixes** @@ -319,7 +329,7 @@ See the version.h file for notes about which of the 4.1.1 features were added/ch **Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.** -[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.0.0-Prod/CommandStation-EX.zip) +[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.1-Prod/CommandStation-EX.zip) -[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.0.0-Prod/CommandStation-EX.tar.gz) +[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.1-Prod/CommandStation-EX.tar.gz) From d1518b8af02a6306fc2c46be581b3158ee6f515d Mon Sep 17 00:00:00 2001 From: Kcsmith0708 Date: Sat, 22 Oct 2022 18:00:21 -0400 Subject: [PATCH 17/55] Update Release_notes_v4.1.1.md (#264) * Update release_notes_v4.1.1.md Edited etc., commands and added KILLALL function to EXRAIL list * Update release_notes_v4.1.1.md added back in * Update release_notes_v4.1.1.md fixed < t cab> so it would display --- Release_Notes/release_notes_v4.1.1.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Release_Notes/release_notes_v4.1.1.md b/Release_Notes/release_notes_v4.1.1.md index 03a9a45..cd9531b 100644 --- a/Release_Notes/release_notes_v4.1.1.md +++ b/Release_Notes/release_notes_v4.1.1.md @@ -14,11 +14,18 @@ The team continues improving the architecture of DCC++EX to make it more flexibl - ACK defaults are now set to LIMIT 50mA, MIN 2000uS, MAX 2000uS for more compatibility with non NMRA compliant decoders - Automatically detect and run a myFilter add-on (no need to call setFilter) - - New Commands for the Arduino IDE Serial Monitor and JMRI DCC++ Traffic Monitor - - commands - - and KILLALL command to stop all tasks - - command to obtain current throttle settings + - New Commands for the Arduino IDE Serial Monitor and JMRI DCC++ Traffic Monitor + - to turn a individual LED Signal On & Off + - " + - " + - command to stop all tasks, and Diagnostic messages when KILL is used + - < t cab> command to obtain current throttle setting + - Allow WRITE CV on PROG + - Updated CV read command . Equivalent to . Uses the verify callback. + - Allow WRITE CV on PROG commands in EXRAIL allows sending of DCC-EX commands from EX-RAIL - SERVO_SIGNAL Servo signals assigned to a specific servo turnout - SIGNALH High-On signal pins (Arduino normally handles active LOW signals. This allows for active HIGH) From b7a010f904d6cf66e57eaebe0efd9bdd237d67f3 Mon Sep 17 00:00:00 2001 From: Kcsmith0708 Date: Sat, 22 Oct 2022 18:01:37 -0400 Subject: [PATCH 18/55] Verion.h 4.1.1 (#263) Edited & Reformatted verify then ready for release --- version.h | 69 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/version.h b/version.h index c2bb135..e9b61bf 100644 --- a/version.h +++ b/version.h @@ -6,55 +6,58 @@ #define VERSION "4.1.1" // 4.1.1 Bugfix: preserve turnout format // Bugfix: parse multiple commands in one buffer string correctly (ex: ) -// Bugfix: command signal status in Exrail +// Bugfix: command signal status of EX-RAIL tasks or threads // Bugfix: EX-RAIL read long loco addr // Bugfix: Add space character after version string 4.1.1 for JMRI parsing. -// Improved display and loop time for signalsmake service start to be outside the DONT_TOUCH_WIFI_CONF area +// Improved display and loop time for signals make service start to be outside the DONT_TOUCH_WIFI_CONF area // Improve WiFi startup by making service start to be outside the DONT_TOUCH_WIFI_CONF area // 4.1.0 ... -// -// 4.0.2 EXRAIL additions: -// Code: struct TurnoutData to enable EEPROM in v 4.0 format -// Code: Fix weak reference to myFilter +// UNO Progmem optimized to allow for small EXRAIL Automation scipts +// 4.0.2 Command Station and EX-RAIL Ehancements & Additions: +// New JA, JR, JT commands availabe for Throttle Developers to obtain Route, Roster and Turnout descriptions for communications +// Change ACK defaults now set to LIMIT 50mA, MIN 2000uS, MAX 2000uS for more compatibility with non NMRA compliant decoders +// New Commands for the Arduino IDE Serial Monitor and JMRI DCC++ Traffic Monitor +// to turn a individual LED Signal On & Off +// " +// " +// command to stop all tasks, and Diagnostic messages when KILL is used +// command to obtain current throttle settings +// Allow WRITE CV on PROG // Updated CV read command . Equivalent to . Uses the verify callback. -// Allow WRITE CV on PROG commands -// Add command to obtain current throttle settings -// Add JA, JR, JT commands to obtain route, roster and turnout descriptions -// Add HIDDEN turnouts -// Add PARSE <> commands in EXRAIL -// Add VIRTUAL_TURNOUT -// Add and KILLALL command to stop all tasks -// Add Diagnostic messages when KILL is used -// FORGET forgets the current loco in DCC reminder tables. -// Add Servo signals (SERVO_SIGNAL) -// Add High-On signal pins (SIGNALH) -// Add Wait for analog value (ATGTE, ATLT) -// Allow underscore in keywords ex: MY_KEYWORD -// Automatically assign a name with ALIAS(name) without having to define it first -// README.md: removed misleading "folder/subforlders" (#218) -// README.md: fix dead link to rewrite (#217) in notes/rewrite.md +// Improved SIGNALs startup and diagnostics // Incoming LCN turnout throw +// Allow turnout ID of "0" +// Code: struct TurnoutData to enable EEPROM in v 4.0 format // Broadcast jopin after DriveAway // Corrections to I2C code: // 1) I2CManager_Mega4809.h: Correct bitwise 'and' to logical 'and' - no impact. // 2) I2CManager_Wire.h: Ensure that error codes from Wire subsystem are passed back to caller in queueRequest(). -// Save memory on the Uno -// 4.0.1 Small EXRAIL updates +// New EX-RAIL Functions to use in Automation(n), ROUTE(N) & SEQUENCE(N) scripts +// Automatically assign a name with ALIAS(name) without having to define it first +// ALIAS now has the aility to use Low underscore in keywords e.g., MY_KEYWORD +// ATGTE & ATLT wait for analog value, (At Greater Than or Equal and At Less Than a certain value) +// FADE command now works for LEDs connected on PCA9685 Servo/Signal board Output vpins +// FORGET Forgets the current loco in DCC reminder tables saving memory and wasted packets sent to the track +// "IF" signal detection with IFRED(signal_id), IFAMBER(signal_id), IFGREEN(signal_id) +// KILLALL command to stop all tasks, and Diagnostic messages when KILL is used +// PARSE <> commands in EXRAIL allows sending of DCC-EX commands from EX-RAIL +// SERVO_SIGNAL Servo signals assigned to a specific servo turnout +// SIGNALH High-On signal pins (Arduino normally handles active LOW signals. This allows for active HIGH) +// HIDDEN turnouts (hide a REAL turnout and create a VIRTUAL turnout to handle actions that happen BEFORE a turnout is thrown) +// VIRTUAL_TURNOUT definition +// README.md: removed misleading "folder/subforlders" (#218) +// README.md: fix dead link to rewrite (#217) in notes/rewrite.md +// 4.0.1 Additional EXRAIL updates // EXRAIL BROADCAST("msg") // EXRAIL POWERON (only turns on MAIN) -// Remove EXRAIL/ENDEXRAIL from myAutomation.example.h (#215) +// Remove optional EXRAIL/ENDEXRAIL from myAutomation.example.h (#215) // Use "startup sequence" to describe the initial instructions // Add description of display scroll modes -// restructure GetLocoCallback() for better readability and put broadcastPower() at right place -// 4.0.0 Major functional and non-functional changes. +// GetLocoCallback() restructured for better readability and put broadcastPower() at right place +// 4.0.0 Major Production Release with New Functional and non-functional changes. // Engine Driver "DriveAway" feature enhancement // 'Discovered Server' multicast Dynamic Network Server (mDNS) displays available WiFi connections to a DCC++EX Command Station // New EX-RAIL "Extended Railroad Automation Instruction Language" automation capability. From daf6799ac1ef1fbb07fe5ca836c12acd37ffed28 Mon Sep 17 00:00:00 2001 From: Fred Date: Sat, 22 Oct 2022 18:10:42 -0400 Subject: [PATCH 19/55] Update release_notes.md --- release_notes.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/release_notes.md b/release_notes.md index 03a9a45..cd9531b 100644 --- a/release_notes.md +++ b/release_notes.md @@ -14,11 +14,18 @@ The team continues improving the architecture of DCC++EX to make it more flexibl - ACK defaults are now set to LIMIT 50mA, MIN 2000uS, MAX 2000uS for more compatibility with non NMRA compliant decoders - Automatically detect and run a myFilter add-on (no need to call setFilter) - - New Commands for the Arduino IDE Serial Monitor and JMRI DCC++ Traffic Monitor - - commands - - and KILLALL command to stop all tasks - - command to obtain current throttle settings + - New Commands for the Arduino IDE Serial Monitor and JMRI DCC++ Traffic Monitor + - to turn a individual LED Signal On & Off + - " + - " + - command to stop all tasks, and Diagnostic messages when KILL is used + - < t cab> command to obtain current throttle setting + - Allow WRITE CV on PROG + - Updated CV read command . Equivalent to . Uses the verify callback. + - Allow WRITE CV on PROG commands in EXRAIL allows sending of DCC-EX commands from EX-RAIL - SERVO_SIGNAL Servo signals assigned to a specific servo turnout - SIGNALH High-On signal pins (Arduino normally handles active LOW signals. This allows for active HIGH) From f0d1909d9f7e487c30114e050f3f7f2ab7695189 Mon Sep 17 00:00:00 2001 From: Fred Date: Sun, 23 Oct 2022 08:21:36 -0400 Subject: [PATCH 20/55] Update release_notes.md --- release_notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_notes.md b/release_notes.md index cd9531b..1842565 100644 --- a/release_notes.md +++ b/release_notes.md @@ -11,7 +11,7 @@ The team continues improving the architecture of DCC++EX to make it more flexibl [CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.1-Prod/CommandStation-EX.tar.gz) **New Command Station & EX-RAIL Features** - - ACK defaults are now set to LIMIT 50mA, MIN 2000uS, MAX 2000uS for more compatibility with non NMRA compliant decoders + - ACK defaults are now set to LIMIT 50mA, MIN 2000uS, MAX 20000uS for more compatibility with non NMRA compliant decoders - Automatically detect and run a myFilter add-on (no need to call setFilter) - New Commands for the Arduino IDE Serial Monitor and JMRI DCC++ Traffic Monitor From 4a3f3d0f3483fa116cb873764358034b26a1f9b0 Mon Sep 17 00:00:00 2001 From: Fred Date: Sun, 23 Oct 2022 08:22:00 -0400 Subject: [PATCH 21/55] Update release_notes_v4.1.1.md --- Release_Notes/release_notes_v4.1.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Release_Notes/release_notes_v4.1.1.md b/Release_Notes/release_notes_v4.1.1.md index cd9531b..1842565 100644 --- a/Release_Notes/release_notes_v4.1.1.md +++ b/Release_Notes/release_notes_v4.1.1.md @@ -11,7 +11,7 @@ The team continues improving the architecture of DCC++EX to make it more flexibl [CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.1-Prod/CommandStation-EX.tar.gz) **New Command Station & EX-RAIL Features** - - ACK defaults are now set to LIMIT 50mA, MIN 2000uS, MAX 2000uS for more compatibility with non NMRA compliant decoders + - ACK defaults are now set to LIMIT 50mA, MIN 2000uS, MAX 20000uS for more compatibility with non NMRA compliant decoders - Automatically detect and run a myFilter add-on (no need to call setFilter) - New Commands for the Arduino IDE Serial Monitor and JMRI DCC++ Traffic Monitor From 4bfd4b1a124aaa35ec4c18999497e761a0f20025 Mon Sep 17 00:00:00 2001 From: peteGSX <97784652+peteGSX@users.noreply.github.com> Date: Thu, 27 Oct 2022 09:34:13 +1000 Subject: [PATCH 22/55] Add templates and project workflow (#258) * Add templates and project workflow * Fixed template typos --- .github/ISSUE_TEMPLATE/bug_report.yml | 80 ++++++++++ .github/ISSUE_TEMPLATE/config.yml | 12 ++ .../ISSUE_TEMPLATE/documentation_update.yml | 31 ++++ .github/ISSUE_TEMPLATE/feature_request.yml | 37 +++++ .github/ISSUE_TEMPLATE/support_request.yml | 39 +++++ .github/ISSUE_TEMPLATE/to_do.yml | 24 +++ .github/workflows/new-items.yml | 143 ++++++++++++++++++ 7 files changed, 366 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/documentation_update.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/ISSUE_TEMPLATE/support_request.yml create mode 100644 .github/ISSUE_TEMPLATE/to_do.yml create mode 100644 .github/workflows/new-items.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..457a075 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,80 @@ +# Bug report GitHub issue form +# +# This file needs to reside in the ".github/ISSUE_TEMPLATE/" folder. + +name: Bug Report +description: Submit a bug report +labels: + - Bug +title: "Bug Report: " +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to submit a bug report to the DCC-EX team! + + In order to help us to validate the bug and ascertain what's causing it, please provide as much information as possible in this form. + + - type: input + id: version + attributes: + label: Version + description: Please provide the version of EX-CommandStation in use. + validations: + required: true + + - type: textarea + id: description + attributes: + label: Bug description + description: Please provide a clear and concise description of what the symptoms of the bug are. + placeholder: | + When attempting to drive a locomotive on the main track, it runs forwards, backwards, spins around, jumps up and down, blows the horn, and then stops. + validations: + required: true + + - type: textarea + id: reproduction + attributes: + label: Steps to reproduce the bug + description: Please provide the steps to reproduce the behaviour. + placeholder: | + 1. Turn on the CommandStation and track power. + 2. Connect Engine Driver to the CommandStation. + 3. Select locomotive with address 123. + 4. Throttle up to half speed. + validations: + required: true + + - type: textarea + id: expectation + attributes: + label: Expected behaviour + description: Please provide a clear and concise description of what you expected to happen. + placeholder: | + The locomotive should accelerate smoothly to half speed in a forward direction. + validations: + required: true + + - type: textarea + id: screenshots + attributes: + label: Screenshots + description: If applicable, upload any screenshots here. + + - type: textarea + id: hardware + attributes: + label: Hardware in use + description: Please provide details of hardware in use including microcontroller, motor shield, and any other relevant information. + placeholder: | + Elegoo Mega2560 + Arduino R3 motor shield + validations: + required: true + + - type: textarea + id: extra-context + attributes: + label: Additional context + description: Please provide any other relevant information that could help us resolve this issue, for example a customised config.h file. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..21c2243 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,12 @@ +# Configuration file for the template chooser +# +# This file needs to exist in the https://github.com/DCC-EX/.github repository in the ".github/ISSUE_TEMPLATE/" folder. + +blank_issues_enabled: false +contact_links: + - name: DCC-EX Discord server + url: https://discord.gg/y2sB4Fp + about: For the best support experience, join our Discord server + - name: DCC-EX Contact and Support page + url: https://dcc-ex.com/support/index.html + about: For other support options, refer to our Contact & Support page \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/documentation_update.yml b/.github/ISSUE_TEMPLATE/documentation_update.yml new file mode 100644 index 0000000..2fc9405 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation_update.yml @@ -0,0 +1,31 @@ +# Documentation update GitHub issue form +# +# This file needs to reside in the ".github/ISSUE_TEMPLATE/" folder. + +name: Documentation Update +description: Submit a request for documentation updates, or to report broken links or inaccuracies +title: "[Documentation Update]: " +labels: + - Needs Documentation +body: + - type: markdown + attributes: + value: | + Use this template to submit a request for updates to our documentation. + + This can be used for general documentation requests if information is missing or lacking, or to correct issues with our existing documentation such as broken links, or inaccurate information. + + - type: textarea + id: details + attributes: + label: Documentation details + description: Provide the details of what needs to be documented or corrected. + validations: + required: true + + - type: input + id: page + attributes: + label: Page with issues + description: If reporting broken links or inaccuracies, please provide the link to the page here. + placeholder: https://dcc-ex.com/index.html \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..c1fae16 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,37 @@ +# Feature Request GitHub issue form +# +# This file needs to reside in the ".github/ISSUE_TEMPLATE/" folder. + +name: Feature Request +description: Suggest a new feature +title: "[Feature Request]: " +labels: + - Enhancement +body: + - type: markdown + attributes: + value: | + Use this template to suggest a new feature for EX-CommandStation. + + - type: textarea + id: description + attributes: + label: Problem/idea statement + description: Please provide the problem you're trying to solve, or share the idea you have. + placeholder: A clear and concise description of the problem you're trying to solve, or the idea you have. For example, I'm always frustrated when... + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: Alternatives or workarounds + description: Please provide any alternatives or workarounds you currently use. + validations: + required: true + + - type: textarea + id: context + attributes: + label: Additional context + description: Add any other context, screenshots, or files related to the feature request here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/support_request.yml b/.github/ISSUE_TEMPLATE/support_request.yml new file mode 100644 index 0000000..c53d2b7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.yml @@ -0,0 +1,39 @@ +# Support Request GitHub issue form +# +# This file needs to reside in the ".github/ISSUE_TEMPLATE/" folder. + +name: Support Request +description: Request support or assistance +title: "[Support Request]: " +labels: + - Support Request +body: + - type: markdown + attributes: + value: | + Use this template to request support or assistance with EX-CommandStation. + + - type: input + id: version + attributes: + label: Version + description: Please provide the version of the software in use. + validations: + required: true + + - type: textarea + id: description + attributes: + label: Issue description + description: Please describe the issue being encountered as accurately and detailed as possible. + validations: + required: true + + - type: textarea + id: hardware + attributes: + label: Hardware + description: If appropriate, please provide details of the hardware in use. + placeholder: | + Elegoo Mega2560 + Arduino Motor Shield R3 \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/to_do.yml b/.github/ISSUE_TEMPLATE/to_do.yml new file mode 100644 index 0000000..2905b8c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/to_do.yml @@ -0,0 +1,24 @@ +# General To Do item GitHub issue form +# +# This file needs to reside in the ".github/ISSUE_TEMPLATE/" folder. + +name: To Do +description: Create a general To Do item +title: "[To Do]: " +labels: + - To Do +body: + - type: markdown + attributes: + value: | + Use this template to create an issue for a general task that needs to be done. + + This is handy for capturing ad-hoc items that don't necessarily require code to be written or updated. + + - type: textarea + id: description + attributes: + label: Task description + description: Provide the details of what needs to be done. + validations: + required: true \ No newline at end of file diff --git a/.github/workflows/new-items.yml b/.github/workflows/new-items.yml new file mode 100644 index 0000000..b5f0a48 --- /dev/null +++ b/.github/workflows/new-items.yml @@ -0,0 +1,143 @@ +# This workflow is to be used for all repositories to integrate with the DCC++ EX Beta Project. +# It will add all issues and pull requests for a repository to the project, and put in the correct status. +# +# Ensure "REPO_LABEL" is updated with the correct label for the repo stream of work. +name: Add Issue or Pull Request to Project + +env: + REPO_LABEL: ${{ secrets.PROJECT_STREAM_LABEL }} + PROJECT_NUMBER: 7 + ORG: DCC-EX + +on: + issues: + types: + - opened + pull_request: + types: + - ready_for_review + - opened + - review_requested + +jobs: + add_to_project: + runs-on: ubuntu-latest + steps: + - name: Add labels + uses: andymckay/labeler@master + with: + add-labels: ${{ env.REPO_LABEL }} + + - name: Generate token + id: generate_token + uses: tibdex/github-app-token@36464acb844fc53b9b8b2401da68844f6b05ebb0 + with: + app_id: ${{ secrets.PROJECT_APP_ID }} + private_key: ${{ secrets. PROJECT_APP_KEY }} + + - name: Get project data + env: + GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} + run: | + gh api graphql -f query=' + query($org: String!, $number: Int!) { + organization(login: $org){ + projectNext(number: $number) { + id + fields(first:20) { + nodes { + id + name + settings + } + } + } + } + }' -f org=$ORG -F number=$PROJECT_NUMBER > project_data.json + + echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV + echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV + echo 'BACKLOG_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Backlog") |.id' project_data.json) >> $GITHUB_ENV + echo 'TO_DO_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="To Do") |.id' project_data.json) >> $GITHUB_ENV + echo 'NEEDS_REVIEW_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Needs Review") |.id' project_data.json) >> $GITHUB_ENV + echo 'IN_PROGRESS_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="In Progress") |.id' project_data.json) >> $GITHUB_ENV + + - name: Add issue to project + env: + GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} + ITEM_ID: ${{ github.event.issue.node_id }} + if: github.event_name == 'issues' + run: | + project_item_id="$( gh api graphql -f query=' + mutation($project:ID!, $item:ID!) { + addProjectNextItem(input: {projectId: $project, contentId: $item}) { + projectNextItem { + id + } + } + }' -f project=$PROJECT_ID -f item=$ITEM_ID --jq '.data.addProjectNextItem.projectNextItem.id')" + echo 'PROJECT_ITEM_ID='$project_item_id >> $GITHUB_ENV + + - name: Add PR to project + env: + GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} + ITEM_ID: ${{ github.event.pull_request.node_id }} + if: github.event_name == 'pull_request' + run: | + project_item_id="$( gh api graphql -f query=' + mutation($project:ID!, $item:ID!) { + addProjectNextItem(input: {projectId: $project, contentId: $item}) { + projectNextItem { + id + } + } + }' -f project=$PROJECT_ID -f item=$ITEM_ID --jq '.data.addProjectNextItem.projectNextItem.id')" + echo 'PROJECT_ITEM_ID='$project_item_id >> $GITHUB_ENV + + - name: Set status - To Do + env: + GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} + if: github.event_name == 'issues' && (contains(github.event.*.labels.*.name, 'Bug') || contains(github.event.*.labels.*.name, 'Support Request')) + run: | + gh api graphql -f query=' + mutation( + $project: ID! + $item: ID! + $status_field: ID! + $status_value: String! + ){ + set_status: updateProjectNextItemField(input: { + projectId: $project + itemId: $item + fieldId: $status_field + value: $status_value + }) { + projectNextItem { + id + } + } + }' -f project=$PROJECT_ID -f item=$PROJECT_ITEM_ID -f status_field=$STATUS_FIELD_ID -f status_value=${{ env.TO_DO_OPTION_ID }} --silent + + - name: Set status - Review + env: + GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} + if: github.event_name == 'issues' && (contains(github.event.*.labels.*.name, 'Unit Tested') || contains(github.event.*.labels.*.name, 'Regression Tested') || contains(github.event.*.labels.*.name, 'Needs Review')) || github.event_name == 'pull_request' + run: | + gh api graphql -f query=' + mutation( + $project: ID! + $item: ID! + $status_field: ID! + $status_value: String! + ){ + set_status: updateProjectNextItemField(input: { + projectId: $project + itemId: $item + fieldId: $status_field + value: $status_value + }) { + projectNextItem { + id + } + } + }' -f project=$PROJECT_ID -f item=$PROJECT_ITEM_ID -f status_field=$STATUS_FIELD_ID -f status_value=${{ env.NEEDS_REVIEW_OPTION_ID }} --silent From df6c511d1deb1b3f805fe8073064f7ff61339fe6 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Fri, 28 Oct 2022 13:24:12 +0200 Subject: [PATCH 23/55] Fix for W5100 ethernet shield which does not report as the W5200 or W5500 --- EthernetInterface.cpp | 16 ++++++++-------- version.h | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/EthernetInterface.cpp b/EthernetInterface.cpp index 7d8fed8..ddc71be 100644 --- a/EthernetInterface.cpp +++ b/EthernetInterface.cpp @@ -36,13 +36,13 @@ EthernetInterface * EthernetInterface::singleton=NULL; */ void EthernetInterface::setup() { - if (Ethernet.hardwareStatus() == EthernetNoHardware) { - if (singleton!=NULL) - DIAG(F("Prog Error!")); - } else { - singleton=new EthernetInterface(); - } - DIAG(F("Ethernet shield %sfound"), singleton==NULL ? "not " : ""); + if (Ethernet.hardwareStatus() == EthernetNoHardware) + DIAG(F("Ethernet shield not detected or is a W5100")); + if (singleton!=NULL) + DIAG(F("Prog Error!")); + if (singleton=new EthernetInterface()) + return; + DIAG(F("Ethernet not initialized")); }; @@ -111,7 +111,7 @@ void EthernetInterface::loop() { * @return true when cable is connected, false otherwise */ bool EthernetInterface::checkLink() { - if (Ethernet.linkStatus() == LinkON) { + if (Ethernet.linkStatus() != LinkOFF) { // check for not linkOFF instead of linkON as the W5100 does return LinkUnknown //if we are not connected yet, setup a new server if(!connected) { DIAG(F("Ethernet cable connected")); diff --git a/version.h b/version.h index e9b61bf..591084d 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "4.1.1" +#define VERSION "4.1.2" +// 4.2.1 Bugfix: Ethernet shield W5100 does not report HW or link level // 4.1.1 Bugfix: preserve turnout format // Bugfix: parse multiple commands in one buffer string correctly (ex: ) // Bugfix: command signal status of EX-RAIL tasks or threads From 5e50731a78a5fba7bd7c25a0f232f49f548102eb Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 28 Oct 2022 10:28:54 -0400 Subject: [PATCH 24/55] Update version.h Fix version number in notes from 4.2.1 to 4.1.2 --- version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.h b/version.h index 591084d..d821db0 100644 --- a/version.h +++ b/version.h @@ -4,7 +4,7 @@ #include "StringFormatter.h" #define VERSION "4.1.2" -// 4.2.1 Bugfix: Ethernet shield W5100 does not report HW or link level +// 4.1.2 Bugfix: Ethernet shield W5100 does not report HW or link level // 4.1.1 Bugfix: preserve turnout format // Bugfix: parse multiple commands in one buffer string correctly (ex: ) // Bugfix: command signal status of EX-RAIL tasks or threads From 7b9f3ae08d1cee90c96ec1e1f5a24bda23344f0d Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 28 Oct 2022 10:39:13 -0400 Subject: [PATCH 25/55] Update release_notes.md --- release_notes.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/release_notes.md b/release_notes.md index 1842565..025cda8 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,14 +1,14 @@ -The DCC-EX Team is pleased to release CommandStation-EX v4.1.1 as a Production Release for the general public. +The DCC-EX Team is pleased to release CommandStation-EX v4.1.2 as a Production Release for the general public. This release is a Minor release with many significant EX-RAIL enhancements and new automation features in addition to some bug fixes. -The team continues improving the architecture of DCC++EX to make it more flexible and optimizing the code to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v4.0.1 to v4.1.1 rc13. +The team continues improving the architecture of DCC++EX to make it more flexible and optimizing the code to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v4.0.1 to v4.1.2. **Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.** -[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.1-Prod/CommandStation-EX.zip) +[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.2-Prod/CommandStation-EX.zip) -[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.1-Prod/CommandStation-EX.tar.gz) +[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.2-Prod/CommandStation-EX.tar.gz) **New Command Station & EX-RAIL Features** - ACK defaults are now set to LIMIT 50mA, MIN 2000uS, MAX 20000uS for more compatibility with non NMRA compliant decoders @@ -47,7 +47,10 @@ The team continues improving the architecture of DCC++EX to make it more flexibl ** Other Enhancements** - UNO Progmem is optimize to allow for small EXRAIL Automation scipts to run within the limited space for testing purposes. - PCA9685 Servo Signal board supports 'Nopoweroffleds', servo pins stay powered on after position reached, otherwise the new FADE would always turn off. - - Position servo can use spare servo pin as a GPIO pin. + - Position servo can use spare servo pin as a GPIO pin. + +**4.1.2 Bug Fixes** +- Fixed Ethernet shield W5100 support since it does not report HW or link level like the W5200 and W5500 chips. **4.1.1 Bug Fixes** @@ -57,7 +60,7 @@ The team continues improving the architecture of DCC++EX to make it more flexibl - Read long loco addresses in EX-RAIL - FIX negative route IDs in WIthrottle -See the version.h file for notes about which of the 4.1.1 features were added/changed by point release. +See the version.h file for notes about which of the 4.1.2 features were added/changed by point release. **Known Issues** @@ -337,7 +340,7 @@ See the version.h file for notes about which of the 4.1.1 features were added/ch **Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.** -[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.1-Prod/CommandStation-EX.zip) +[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.2-Prod/CommandStation-EX.zip) -[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.1-Prod/CommandStation-EX.tar.gz) +[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.2-Prod/CommandStation-EX.tar.gz) From 0023ce33562d1c422c7a31d51630c6038dec1b23 Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 28 Oct 2022 10:48:40 -0400 Subject: [PATCH 26/55] Create release_notes_v4.1.2.md --- Release_Notes/release_notes_v4.1.2.md | 346 ++++++++++++++++++++++++++ 1 file changed, 346 insertions(+) create mode 100644 Release_Notes/release_notes_v4.1.2.md diff --git a/Release_Notes/release_notes_v4.1.2.md b/Release_Notes/release_notes_v4.1.2.md new file mode 100644 index 0000000..9bff53c --- /dev/null +++ b/Release_Notes/release_notes_v4.1.2.md @@ -0,0 +1,346 @@ +The DCC-EX Team is pleased to release CommandStation-EX v4.1.2 as a Production Release for the general public. +This release is a Bugfix release which fixes support for Ethernet Shields based on the W5100 chip that broke with the release of v4.1.1. This chip does not report HW and link status the way the W5200 and W5500 do, so the check routine needed to be changed. +The team continues improving the architecture of DCC++EX to make it more flexible and optimizing the code to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v4.0.1 to v4.1.2. + +**Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.** + +[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.2-Prod/CommandStation-EX.zip) + + + +[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.2-Prod/CommandStation-EX.tar.gz) + +**New Command Station & EX-RAIL Features** + - ACK defaults are now set to LIMIT 50mA, MIN 2000uS, MAX 20000uS for more compatibility with non NMRA compliant decoders + - Automatically detect and run a myFilter add-on (no need to call setFilter) + + - New Commands for the Arduino IDE Serial Monitor and JMRI DCC++ Traffic Monitor + - to turn a individual LED Signal On & Off + - " + - " + - command to stop all tasks, and Diagnostic messages when KILL is used + - < t cab> command to obtain current throttle setting + + - Allow WRITE CV on PROG + - Updated CV read command . Equivalent to . Uses the verify callback. + - Allow WRITE CV on PROG commands in EXRAIL allows sending of DCC-EX commands from EX-RAIL + - SERVO_SIGNAL Servo signals assigned to a specific servo turnout + - SIGNALH High-On signal pins (Arduino normally handles active LOW signals. This allows for active HIGH) + - HIDDEN turnouts (hide a REAL turnout and create a VIRTUAL turnout to handle actions that happen BEFORE a turnout is thrown) + - VIRTUAL_TURNOUT definition + +**EX-RAIL Updates** + - EXRAIL BROADCAST("msg") sends any message to all throttles/JMRI via serial and WiFi + - EXRAIL POWERON turns on power to both tracks from EX-RAIL (the equivalent of sending the <1> command) + +** Other Enhancements** + - UNO Progmem is optimize to allow for small EXRAIL Automation scipts to run within the limited space for testing purposes. + - PCA9685 Servo Signal board supports 'Nopoweroffleds', servo pins stay powered on after position reached, otherwise the new FADE would always turn off. + - Position servo can use spare servo pin as a GPIO pin. + +**4.1.2 Bug Fixes** +- Fixed Ethernet shield W5100 support since it does not report HW or link level like the W5200 and W5500 chips. + +**4.1.1 Bug Fixes** + +- Preserve the turnout format +- Parse multiple commands in one buffer string currectly +- Fix command signal status in EX-RAIL +- Read long loco addresses in EX-RAIL +- FIX negative route IDs in WIthrottle + +See the version.h file for notes about which of the 4.1.2 features were added/changed by point release. + +**Known Issues** + +- **Wi-Fi** - Requires sending `` commands from a serial monitor if you want to switch between AP mode and STA station mode after initial setup +- **Pololu Motor Shield** - is supported with this release, but the user may have to adjust timings to enable programming mode due to limitations in its current sensing circuitry + +**All New Major DCC++EX 4.0.0 features** + +- **New HAL Hardware Abstraction Layer API** that automatically detects and greatly simplifies interfacing to many predefined accessory boards for servos, signals & sensors and added I/O (digital and analog inputs and outputs, servos etc). +- HAL Support for; + - MCP23008, MCP23017 and PCF9584 I2C GPIO Extender modules. + - PCA9685 PWM (servo & signal) control modules. + - Analogue inputs on Arduino pins and on ADS111x I2C modules. + - MP3 sound playback via DFPlayer module. + - HC-SR04 Ultrasonic range sensor module. + - VL53L0X Laser range sensor module (Time-Of-Flight). + - A new `` command to list the HAL devices attached to the command station + +**New Command Station Broadcast throttle logic** + +- Synchronizes multiple WiThrottles and PC based JMRI Throttles for direction, speed and F-key updates + +**New ‘Discovered Servers’ on WiFi Throttles** + +- Our New multicast Dynamic Network Server (mDNS) enhancement allows us to display the available WiFi server connections to a DCC++EX Command Station. Selecting it allows your WiThrottle App to connect to and load Server Rosters and function keys to your throttle from the new DCC++EX Command Station Server Roster. + +**New DCC++EX 4.0.0 with EX-RAIL Extended Railroad Automation Instruction Language** + +- Use to control your entire layout or as a separate accessory/animation controller +- Awesome, cleverly powerful yet simple user friendly scripting language for user built Automation & Routing scripts. +- You can control Engines, Sensors, Turnouts, Signals, Outputs and Accessories that are entered into your new myAutomation.h file, then uploaded into the DCC++EX Command Station. +- EX-RAIL scripts are automatically displayed as Automation {Handoff} and Route {Set} buttons on supported WiFi Throttle Apps. + +**New EX-RAIL ‘Roster’ Feature** + +- List and store user defined engine roster & function keys inside the command station, and automatically load them in WiFi Throttle Apps. +- When choosing “DCC++EX” from discovered servers an Engine Driver or WiThrottle is directly connected to the Command Station. +- The EX-RAIL ’ROSTER’ command allows all the engine numbers, names and function keys you’ve listed in your myAutomation.h file to automatically upload the Command Station's ‘Server Roster’ into your Engine Driver and WiThrottle Apps. + +**New JMRI 4.99.2 and above specific DCC++EX 4.0 features** + +- Enhanced JMRI DCC++ Configure Base Station pane for building and maintaining Sensor, Turnout and Output devices, or these can automatically be populated from the DCC++EX Command Station's mySetup.h file into JMRI. + +- JMRI now supports multiple serial connected DCC++EX Command Stations, to display and track separate "Send DCC++ Command" and "DCC++ Traffic" Monitors for each Command Station at the same time. + For example: Use an Uno DCC++EX DecoderPro Programming Station {DCC++Prg} on a desktop programming track and a second Mega DCC++EX EX-RAIL Command Station for Operations {DCC++Ops} on the layout with an additional `` programming spur or siding track for acquiring an engine and ‘Drive Away’ onto the mainline (see the DriveAway feature for more information). + +**DCC++EX 4.0.0 additional product enhancements** + +- Additional Motor Shields and Motor Board {boosters) supported +- Additional Accessory boards supported for GPIO expansion, Sensors, Servos & Signals +- Additional diagnostic commands like ‘D ACK RETRY’ and ‘D EXRAIL ON’ events, ‘D HAL SHOW’ devices and ‘D SERVO’ positions, and ‘D RESET’ the command station while maintaining the serial connection with JMRI +- Automatic retry on failed ACK detection to give decoders another chance +- New EX-RAIL ’/’ slash command allows JMRI to directly communicate with many EX-RAIL scripts +- Turnout class revised to expand turnout capabilities and allow turnout names/descriptors to display in WiThrottle Apps. +- Build turnouts through either or both mySetup.h and myAutomation.h files, and have them automatically passed to, and populate, JMRI Turnout Tables +- Turnout user names display in Engine Driver & WiThrottles +- Output class now allows ID > 255. +- Configuration options to globally flip polarity of DCC Accessory states when driven from `` command and `` command. +- Increased use of display for showing loco decoder programming information. +- Can disable EEPROM memory code to allow room for DCC++EX 4.0 to fit on a Uno Command Station +- Can define border between long and short addresses +- Native non-blocking I2C drivers for AVR and Nano architectures (fallback to blocking Wire library for other platforms). +- EEPROM layout change - deletes EEPROM contents on first start following upgrade. + +**4.0.0 Bug Fixes** + +- Compiles on Nano Every +- Diagnostic display of ack pulses >32ms +- Current read from wrong ADC during interrupt +- AT(+) Command Pass Through +- CiDAP WiFi Drop out and the WiThrottle F-key looping error corrected +- One-off error in CIPSEND drop +- Common Fault Pin Error +- Uno Memory Utilization optimized + +#### Summary of Release 3.1.0 key features and/or bug fixes by Point Release + +**Summary of the key new features added to CommandStation-EX V3.0.16** + +- Ignore CV1 bit 7 read if rejected by a non NMRA compliant decoder when identifying loco id + +**Summary of the key new features added to CommandStation-EX V3.0.15** + +- Send function commands just once instead of repeating them 4 times + +**Summary of the key new features added to CommandStation-EX V3.0.14** + +- Add feature to tolerate decoders that incorrectly have gaps in their ACK pulse +- Provide proper track power management when joining and unjoining tracks with <1 JOIN> + +**Summary of the key new features added to CommandStation-EX V3.0.13** + +- Fix for CAB Functions greater than 127 + +**Summary of the key new features added to CommandStation-EX V3.0.12** + +- Fixed clear screen issue for nanoEvery and nanoWifi + +**Summary of the key new features added to CommandStation-EX V3.0.11** + +- Reorganized files for support of 128 speed steps + +**Summary of the key new features added to CommandStation-EX V3.0.10** + +- Added Support for the Teensy 3.2, 3.5, 3.6, 4.0 and 4.1 MCUs +- No functional change just changes to avoid complier warnings for Teensy/nanoEvery + +**Summary of the key new features added to CommandStation-EX V3.0.9** + +- Rearranges serial newlines for the benefit of JMRI +- Major update for efficiencies in displays (LCD, OLED) +- Add I2C Support functions + +**Summary of the key new features added to CommandStation-EX V3.0.8** + +- Wraps <* *> around DIAGS for the benefit of JMRI + +**Summary of the key new features added to CommandStation-EX V3.0.7** + +- Implemented support for older 28 apeed step decoders - Option to turn on 28 step speed decoders in addition to 128. If set, all locos will use 28 steps. +- Improved overload messages with raw values (relative to offset) + +**Summary of the key new features added to CommandStation-EX V3.0.6** + +- Prevent compiler warning about deprecated B constants +- Fix Bug that did not let us transmit 5 byte sized packets - 5 Byte commands like PoM (programming on main) were not being sent correctly +- Support for Huge function numbers (DCC BinaryStateControl) - Support Functions beyond F28 +- ESTOP all - New command to emergency stop all locos on the main track +- <- [cab]> estop and forget cab/all cabs - Stop and remove loco from the CS. Stops the repeating throttle messages +- `` command to reboot Arduino +- Automatic sensor offset detect +- Improved startup msgs from Motor Drivers (accuracy and auto sense factors) +- Drop post-write verify - No need to double check CV writes. Writes are now even faster. +- Allow current sense pin set to UNUSED_PIN - No need to ground an unused analog current pin. Produce startup warning and callback -2 for prog track cmds. + +**Summary of the key new features added to CommandStation-EX V3.0.5** + +- Fix Fn Key startup with loco ID and fix state change for F16-28 +- Removed ethernet mac config and made it automatic +- Show wifi ip and port on lcd +- Auto load config.example.h with warning +- Dropped example .ino files +- Corrected .ino comments +- Add Pololu fault pin handling +- Waveform speed/simplicity improvements +- Improved pin speed in waveform +- Portability to nanoEvery and UnoWifiRev2 CPUs +- Analog read speed improvements +- Drop need for DIO2 library +- Improved current check code +- Linear command +- Removed need for ArduinoTimers files +- Removed option to choose different timer +- Added EX-RAIL hooks for automation in future version +- Fixed Turnout list +- Allow command keywords in mixed case +- Dropped unused memstream +- PWM pin accuracy if requirements met + +**Summary of the key new features added to CommandStation-EX V3.0.4** + +- "Drive-Away" Feature - added so that throttles 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 +- WiFi Startup Fixes + +**Summary of the key new features added to CommandStation-EX V3.0.3** + +- Command to write loco address and clear consist +- Command will allow for consist address +- Startup commands implemented + +**Summary of the key new features added to CommandStation-EX V3.0.2:** + +- Create new output for current in mA for `` command - New current response outputs current in mA, overlimit current, and maximum board capable current +- Simultaneously update JMRI to handle new current meter + +**Summary of the key new features added to CommandStation-EX V3.0.1:** + +- Add back fix for jitter +- Add Turnouts, Outputs and Sensors to `` command output + +**CommandStation-EX V3.0.0:** + +**Release v3.0.0 was a major rewrite if earlier versions of DCC++. The code base was re-architeced and core changes were made to the Waveform generator to reduce overhead and make better use of Arduino.** **Summary of the key new features added in Release v3.0.0 include:** + +- **New USB Browser Based Throttle** - WebThrottle-EX is a full front-end to controller to control the CS to run trains. +- **WiFi Support** - AP and station modes supported. Auto-detection of an ESP8266 WiFi module with AT firmware on a Mega's serial port. Connection to JMRI and WiThrottle clients. +- **Withrottle Integrations** - Act as a host for up to four WiThrottle clients concurrently. +- **Add LCD/OLED support** - OLED supported on Mega only +- **Improved CV programming routines** - checks for length of CV pulse, and breaks out of the wait state once it has received an ACK, now reading one CV per second. +- **Improved current sensing** - rewrote current sensing routines for safer operation. Current thresholds based on milliamps, not magic numbers +- **Individual track power control** - Ability to toggle power on either or both tracks, and to "JOIN" the tracks and make them output the same waveform for multiple power districts. +- **Single or Dual-Pin PWM output** - Allows control of H-bridges with PH/EN or dual PWM inputs +- **New, simpler function command** - `` command allows setting functions based on their number, not based on a code as in `` +- **Function reminders** - Function reminders are sent in addition to speed reminders +- **Functions to F28** - All NMRA functions are now supported +- **Filters and user functions** - Ability to filter commands in the parser and execute custom code based on them. (ex: Redirect Turnout commands via NRF24) +- **Diagnostic `` commands** - See documentation for a full list of new diagnostic commands +- **Rewrote DCC++ Parser** - more efficient operation, accepts multi-char input and uses less RAM +- **Rewritten waveform generator** - capable of using any pin for DCC waveform out, eliminating the need for jumpers +- **Rewritten packet generator** - Simplify and make smaller, remove idea of "registers" from original code +- **Add free RAM messages** - Free RAM messages are now printed whenever there is a decerase in available RAM +- **Fix EEPROM bugs** +- **Number of locos discovery command** - `<#>` command +- **Support for more locomotives** - 20 locomotives on an UNO and 50 an a Mega. +- **Automatic slot management** - slot variable in throttle/function commands are ignored and slot management is taken care of automatically. `<->` and `<- CAB>` commands added to release locos from memory and stop packets to the track. + +**Key Contributors** + +**Project Lead** + +- Fred Decker - Holly Springs, North Carolina, USA (FlightRisk) + +**EX-CommandStation Developers** + +- Chris Harlow - Bournemouth, UK (UKBloke) +- Harald Barth - Stockholm, Sweden (Haba) +- Neil McKechnie - Worcestershire, UK (NeilMck) +- Fred Decker - Holly Springs, North Carolina, USA (FlightRisk) +- Dave Cutting - Logan, Utah, USA (Dave Cutting/ David Cutting) +- M Steve Todd - Oregon, USA (MSteveTodd) +- Scott Catalano - Pennsylvania +- Gregor Baues - Île-de-France, France (grbba) + +**Engine Driver and JMRI Interface** + +- M Steve Todd + +**EX-Installer Software** + +- Anthony W - Dayton, Ohio, USA (Dex, Dex++) + +**Website and Documentation** + +- Mani Kumar - Bangalor, India (Mani / Mani Kumar) +- Fred Decker - Holly Springs, North Carolina, USA (FlightRisk) +- Dave Cutting - Logan, Utah, USA (Dave Cutting/ David Cutting) +- Roger Beschizza - Dorset, UK (Roger Beschizza) +- Keith Ledbetter - Chicago, Illinois, USA (Keith Ledbetter) +- Kevin Smith - Rochester Hills, Michigan USA (KC Smith) +- Colin Grabham - Central NSW, Australia (Kebbin) +- Peter Cole - Brisbane, QLD, Australia (peteGSX) +- Peter Akers - Brisbane, QLD, Australia (flash62au) + +**EX-WebThrottle** + +- Fred Decker - Holly Springs, NC (FlightRisk/FrightRisk) +- Mani Kumar - Bangalor, India (Mani /Mani Kumar) +- Matt H - Somewhere in Europe + +**Hardware / Electronics** + +- Harald Barth - Stockholm, Sweden (Haba) +- Paul Antoine, Western Australia +- Neil McKechnie - Worcestershire, UK +- Fred Decker - Holly Springs NC, USA +- Herb Morton - Kingwood Texas, USA (Ash++) + +**Beta Testing / Release Management / Support** + +- Larry Dribin - Release Management +- Kevin Smith - Rochester Hills, Michigan USA (KC Smith) +- Herb Morton - Kingwood Texas, USA (Ash++) +- Keith Ledbetter +- Brad Van der Elst +- Andrew Pye +- Mike Bowers +- Randy McKenzie +- Roberto Bravin +- Sam Brigden +- Alan Lautenslager +- Martin Bafver +- Mário André Silva +- Anthony Kochevar +- Gajanatha Kobbekaduwe +- Sumner Patterson +- Paul - Virginia, USA + +**Downloads (zip and tar.gz) below. These are named without version number in the folder name to make the Arduino IDE happy.** + +[CommandStation-EX.zip](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.2-Prod/CommandStation-EX.zip) + + +[CommandStation-EX.tar.gz](https://github.com/DCC-EX/CommandStation-EX/releases/download/v4.1.2-Prod/CommandStation-EX.tar.gz) From 1827a11f83b1fe9675705a11fc290b5d67dd65c3 Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 28 Oct 2022 10:49:32 -0400 Subject: [PATCH 27/55] Update release_notes_v4.1.1.md --- Release_Notes/release_notes_v4.1.1.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Release_Notes/release_notes_v4.1.1.md b/Release_Notes/release_notes_v4.1.1.md index 1842565..654c42d 100644 --- a/Release_Notes/release_notes_v4.1.1.md +++ b/Release_Notes/release_notes_v4.1.1.md @@ -1,3 +1,6 @@ +Version 4.1.1 Release Notes +************************* + The DCC-EX Team is pleased to release CommandStation-EX v4.1.1 as a Production Release for the general public. This release is a Minor release with many significant EX-RAIL enhancements and new automation features in addition to some bug fixes. The team continues improving the architecture of DCC++EX to make it more flexible and optimizing the code to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v4.0.1 to v4.1.1 rc13. From 6f94cd71ab9540ee78e9e7650ef69ef025b9520b Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 28 Oct 2022 10:50:35 -0400 Subject: [PATCH 28/55] Update release_notes_v4.1.2.md --- Release_Notes/release_notes_v4.1.2.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Release_Notes/release_notes_v4.1.2.md b/Release_Notes/release_notes_v4.1.2.md index 9bff53c..687d0c9 100644 --- a/Release_Notes/release_notes_v4.1.2.md +++ b/Release_Notes/release_notes_v4.1.2.md @@ -1,3 +1,6 @@ +Version 4.1.2 Release Notes +************************* + The DCC-EX Team is pleased to release CommandStation-EX v4.1.2 as a Production Release for the general public. This release is a Bugfix release which fixes support for Ethernet Shields based on the W5100 chip that broke with the release of v4.1.1. This chip does not report HW and link status the way the W5200 and W5500 do, so the check routine needed to be changed. The team continues improving the architecture of DCC++EX to make it more flexible and optimizing the code to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v4.0.1 to v4.1.2. From aca9c9c941185a57bf1dd7d4a0c68ef199248083 Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 28 Oct 2022 10:52:12 -0400 Subject: [PATCH 29/55] Update release_notes.md --- release_notes.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release_notes.md b/release_notes.md index 025cda8..f38e22e 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,3 +1,6 @@ +Version 4.0 Release Notes +************************* + The DCC-EX Team is pleased to release CommandStation-EX v4.1.2 as a Production Release for the general public. This release is a Minor release with many significant EX-RAIL enhancements and new automation features in addition to some bug fixes. The team continues improving the architecture of DCC++EX to make it more flexible and optimizing the code to get more performance from the Arduino (and other) microprocessors. This release includes all of the Point Releases from v4.0.1 to v4.1.2. From 5b7801ca6c8f99e3f51218f038f18e22961ec4c0 Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 28 Oct 2022 14:05:35 -0400 Subject: [PATCH 30/55] Update version.h --- version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.h b/version.h index d821db0..537a44b 100644 --- a/version.h +++ b/version.h @@ -16,7 +16,7 @@ // UNO Progmem optimized to allow for small EXRAIL Automation scipts // 4.0.2 Command Station and EX-RAIL Ehancements & Additions: // New JA, JR, JT commands availabe for Throttle Developers to obtain Route, Roster and Turnout descriptions for communications -// Change ACK defaults now set to LIMIT 50mA, MIN 2000uS, MAX 2000uS for more compatibility with non NMRA compliant decoders +// Change ACK defaults now set to LIMIT 50mA, MIN 2000uS, MAX 20000uS for more compatibility with non NMRA compliant decoders // New Commands for the Arduino IDE Serial Monitor and JMRI DCC++ Traffic Monitor // to turn a individual LED Signal On & Off // " From b1d110ecbf262058268d0ddfd3a63dfc026797dd Mon Sep 17 00:00:00 2001 From: peteGSX Date: Thu, 3 Nov 2022 14:06:43 +1000 Subject: [PATCH 31/55] Fix project workflow --- .github/workflows/new-items.yml | 59 ++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/.github/workflows/new-items.yml b/.github/workflows/new-items.yml index b5f0a48..492a0f1 100644 --- a/.github/workflows/new-items.yml +++ b/.github/workflows/new-items.yml @@ -42,26 +42,35 @@ jobs: gh api graphql -f query=' query($org: String!, $number: Int!) { organization(login: $org){ - projectNext(number: $number) { + projectV2(number: $number) { id fields(first:20) { nodes { - id - name - settings + ... on ProjectV2Field { + id + name + } + ... on ProjectV2SingleSelectField { + id + name + options { + id + name + } + } } } } } }' -f org=$ORG -F number=$PROJECT_NUMBER > project_data.json - echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV - echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV - echo 'BACKLOG_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Backlog") |.id' project_data.json) >> $GITHUB_ENV - echo 'TO_DO_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="To Do") |.id' project_data.json) >> $GITHUB_ENV - echo 'NEEDS_REVIEW_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Needs Review") |.id' project_data.json) >> $GITHUB_ENV - echo 'IN_PROGRESS_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="In Progress") |.id' project_data.json) >> $GITHUB_ENV - + echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV + echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV + echo 'BACKLOG_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") |.options[] | select(.name=="Backlog") |.id' project_data.json) >> $GITHUB_ENV + echo 'TO_DO_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") |.options[] | select(.name=="To Do") |.id' project_data.json) >> $GITHUB_ENV + echo 'NEEDS_REVIEW_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") |.options[] | select(.name=="Needs Review") |.id' project_data.json) >> $GITHUB_ENV + echo 'IN_PROGRESS_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") |.options[] | select(.name=="In Progress") |.id' project_data.json) >> $GITHUB_ENV + - name: Add issue to project env: GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} @@ -70,12 +79,12 @@ jobs: run: | project_item_id="$( gh api graphql -f query=' mutation($project:ID!, $item:ID!) { - addProjectNextItem(input: {projectId: $project, contentId: $item}) { - projectNextItem { + addProjectV2ItemById(input: {projectId: $project, contentId: $item}) { + item { id } } - }' -f project=$PROJECT_ID -f item=$ITEM_ID --jq '.data.addProjectNextItem.projectNextItem.id')" + }' -f project=$PROJECT_ID -f item=$ITEM_ID --jq '.data.addProjectV2ItemById.item.id')" echo 'PROJECT_ITEM_ID='$project_item_id >> $GITHUB_ENV - name: Add PR to project @@ -86,12 +95,12 @@ jobs: run: | project_item_id="$( gh api graphql -f query=' mutation($project:ID!, $item:ID!) { - addProjectNextItem(input: {projectId: $project, contentId: $item}) { - projectNextItem { + addProjectV2ItemById(input: {projectId: $project, contentId: $item}) { + item { id } } - }' -f project=$PROJECT_ID -f item=$ITEM_ID --jq '.data.addProjectNextItem.projectNextItem.id')" + }' -f project=$PROJECT_ID -f item=$ITEM_ID --jq '.data.addProjectV2ItemById.item.id')" echo 'PROJECT_ITEM_ID='$project_item_id >> $GITHUB_ENV - name: Set status - To Do @@ -106,13 +115,15 @@ jobs: $status_field: ID! $status_value: String! ){ - set_status: updateProjectNextItemField(input: { + set_status: updateProjectV2ItemFieldValue(input: { projectId: $project itemId: $item fieldId: $status_field - value: $status_value + value: { + singleSelectOptionId: $status_value + } }) { - projectNextItem { + projectV2Item { id } } @@ -130,13 +141,15 @@ jobs: $status_field: ID! $status_value: String! ){ - set_status: updateProjectNextItemField(input: { + set_status: updateProjectV2ItemFieldValue(input: { projectId: $project itemId: $item fieldId: $status_field - value: $status_value + value: { + singleSelectOptionId: $status_value + } }) { - projectNextItem { + projectV2Item { id } } From 5376c9f410c71372a6ce6855aa8f6bfcc3e72b4f Mon Sep 17 00:00:00 2001 From: peteGSX Date: Fri, 4 Nov 2022 06:54:49 +1000 Subject: [PATCH 32/55] Update project workflow for forks --- .github/workflows/new-items.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/new-items.yml b/.github/workflows/new-items.yml index 492a0f1..1718730 100644 --- a/.github/workflows/new-items.yml +++ b/.github/workflows/new-items.yml @@ -13,7 +13,7 @@ on: issues: types: - opened - pull_request: + pull_request_target: types: - ready_for_review - opened From dd309a3705dde6de86b9d1ed46b757c7ea27e0ad Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Fri, 4 Nov 2022 15:39:35 +0100 Subject: [PATCH 33/55] Ethernet init order --- EthernetInterface.cpp | 18 ++++++++++++++---- version.h | 3 ++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/EthernetInterface.cpp b/EthernetInterface.cpp index ddc71be..fe780b7 100644 --- a/EthernetInterface.cpp +++ b/EthernetInterface.cpp @@ -36,11 +36,11 @@ EthernetInterface * EthernetInterface::singleton=NULL; */ void EthernetInterface::setup() { - if (Ethernet.hardwareStatus() == EthernetNoHardware) - DIAG(F("Ethernet shield not detected or is a W5100")); - if (singleton!=NULL) + if (singleton!=NULL) { DIAG(F("Prog Error!")); - if (singleton=new EthernetInterface()) + return; + } + if ((singleton=new EthernetInterface())) return; DIAG(F("Ethernet not initialized")); }; @@ -67,6 +67,16 @@ EthernetInterface::EthernetInterface() return; } #endif + if (Ethernet.hardwareStatus() == EthernetNoHardware) + DIAG(F("Ethernet shield not detected or is a W5100")); + + unsigned long startmilli = millis(); + while ((millis() - startmilli) < 5500) { // Loop to give time to check for cable connection + if (Ethernet.linkStatus() == LinkON) + break; + DIAG(F("Ethernet waiting for link (1sec) ")); + delay(1000); + } } /** diff --git a/version.h b/version.h index d821db0..4804870 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "4.1.2" +#define VERSION "4.1.3" +// 4.1.3 Bugfix: Ethernet init order // 4.1.2 Bugfix: Ethernet shield W5100 does not report HW or link level // 4.1.1 Bugfix: preserve turnout format // Bugfix: parse multiple commands in one buffer string correctly (ex: ) From 7e16ec70884e91b72d83ecb6ab190d842a487171 Mon Sep 17 00:00:00 2001 From: peteGSX Date: Sat, 5 Nov 2022 05:17:03 +1000 Subject: [PATCH 34/55] Fix support request issue template --- .github/ISSUE_TEMPLATE/support_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/support_request.yml b/.github/ISSUE_TEMPLATE/support_request.yml index c53d2b7..a8c7649 100644 --- a/.github/ISSUE_TEMPLATE/support_request.yml +++ b/.github/ISSUE_TEMPLATE/support_request.yml @@ -35,5 +35,5 @@ body: label: Hardware description: If appropriate, please provide details of the hardware in use. placeholder: | - Elegoo Mega2560 - Arduino Motor Shield R3 \ No newline at end of file + Elegoo Mega2560 + Arduino Motor Shield R3 \ No newline at end of file From 1f5eafbccac97e9ef5d1991417a1a2881b6bf7f9 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Fri, 27 Jan 2023 18:42:26 +0100 Subject: [PATCH 35/55] Bugfix for issue #299 TurnoutDescription NULL --- DCCEXParser.cpp | 19 ++++++++++++------- version.h | 3 ++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index b262600..2cfaafd 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -599,14 +599,19 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream) else { // Turnout * t=Turnout::get(id); if (!t || t->isHidden()) StringFormatter::send(stream, F(" %d X"),id); - else StringFormatter::send(stream, F(" %d %c \"%S\""), - id,t->isThrown()?'T':'C', + else { + const FSH *tdesc = NULL; #ifdef EXRAIL_ACTIVE - RMFT2::getTurnoutDescription(id) -#else - F("") -#endif - ); + tdesc = RMFT2::getTurnoutDescription(id); +#endif + if (tdesc == NULL) + StringFormatter::send(stream, F(" %d %c"), + id,t->isThrown()?'T':'C'); + else + StringFormatter::send(stream, F(" %d %c \"%S\""), + id,t->isThrown()?'T':'C', + tdesc); + } } StringFormatter::send(stream, F(">\n")); return; diff --git a/version.h b/version.h index 028999c..947b363 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "4.1.3" +#define VERSION "4.1.4" +// 4.1.4 Bugfix for issue #299 TurnoutDescription NULL // 4.1.3 Bugfix: Ethernet init order // 4.1.2 Bugfix: Ethernet shield W5100 does not report HW or link level // 4.1.1 Bugfix: preserve turnout format From 7e4f9eb0e18d0936094f4e5aaf4140913e350e7f Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sat, 28 Jan 2023 19:07:59 +0100 Subject: [PATCH 36/55] jT answer should contain empty string --- DCCEXParser.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index 2cfaafd..05b3005 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -605,12 +605,10 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream) tdesc = RMFT2::getTurnoutDescription(id); #endif if (tdesc == NULL) - StringFormatter::send(stream, F(" %d %c"), - id,t->isThrown()?'T':'C'); - else - StringFormatter::send(stream, F(" %d %c \"%S\""), - id,t->isThrown()?'T':'C', - tdesc); + tdesc = F(""); + StringFormatter::send(stream, F(" %d %c \"%S\""), + id,t->isThrown()?'T':'C', + tdesc); } } StringFormatter::send(stream, F(">\n")); From 7311f2ce64b66c0703859e786717df57d7cc1eb7 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sun, 12 Feb 2023 20:38:03 +0100 Subject: [PATCH 37/55] LCN bugfix --- LCN.cpp | 2 +- version.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/LCN.cpp b/LCN.cpp index efb49ff..d1e1228 100644 --- a/LCN.cpp +++ b/LCN.cpp @@ -43,7 +43,7 @@ void LCN::loop() { while (stream->available()) { int ch = stream->read(); - if (ch >= 0 && ch <= '9') { // accumulate id value + if (ch >= '0' && ch <= '9') { // accumulate id value id = 10 * id + ch - '0'; } else if (ch == 't' || ch == 'T') { // Turnout opcodes diff --git a/version.h b/version.h index 947b363..d340aa0 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "4.1.4" +#define VERSION "4.1.5" +// 4.1.5 Bugfix LCN number parsing // 4.1.4 Bugfix for issue #299 TurnoutDescription NULL // 4.1.3 Bugfix: Ethernet init order // 4.1.2 Bugfix: Ethernet shield W5100 does not report HW or link level From da8faa808bce6abbb51734db289f821126d0edef Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 3 Mar 2023 21:07:58 -0500 Subject: [PATCH 38/55] Update ThrottleAssists.md --- Release_Notes/ThrottleAssists.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Release_Notes/ThrottleAssists.md b/Release_Notes/ThrottleAssists.md index 9d979c9..c4b2b99 100644 --- a/Release_Notes/ThrottleAssists.md +++ b/Release_Notes/ThrottleAssists.md @@ -7,7 +7,7 @@ These commands are new and not overlapped with the existing commands which are p Turnouts: -The conventional turnout definition commands and the `````` responses do not contain information about the turnout description which may have been provided in an EXRAIL script. A turnout description is much more user friendly than T123 and having a list helps the throttle UI build a suitable set of buttons. +The conventional turnout definition commands and the `````` responses do not contain information about the turnout description which may have been provided in an EXRAIL script. A turnout description is much more user friendly than the cryptic "T123", and having a list helps the throttle UI build a suitable set of buttons. `````` command returns a list of turnout ids. The throttle should be uninterested in the turnout technology used but needs to know the ids it can throw/close and monitor the current state. e.g. response `````` From 0f5b8adb6b56b4b4a6162d30b06ec9705820a470 Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 3 Mar 2023 21:26:46 -0500 Subject: [PATCH 39/55] Update ThrottleAssists.md --- Release_Notes/ThrottleAssists.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Release_Notes/ThrottleAssists.md b/Release_Notes/ThrottleAssists.md index c4b2b99..5f4a68d 100644 --- a/Release_Notes/ThrottleAssists.md +++ b/Release_Notes/ThrottleAssists.md @@ -5,7 +5,8 @@ Chris Harlow April 2022 There are a number of additional throttle information commands that have been implemented to assist throttle authors to obtain information from the Command Station in order to implement turnout, route/automation and roster features which are already found in the Withrottle implementations. These commands are new and not overlapped with the existing commands which are probabaly due to be obsoleted as they are over complex and unfit for purpose. -Turnouts: +Turnouts +============ The conventional turnout definition commands and the `````` responses do not contain information about the turnout description which may have been provided in an EXRAIL script. A turnout description is much more user friendly than the cryptic "T123", and having a list helps the throttle UI build a suitable set of buttons. @@ -25,6 +26,7 @@ Note: It is still the throttles responsibility to monitor the status broadcasts. Automations/Routes + ==================== A throttle need to know which EXRAIL Automations and Routes it can show the user. @@ -64,6 +66,7 @@ Note: It is still the throttles responsibility to monitor the status broadcasts. COMMANDS TO AVOID + ====================== `````` Use `````` `````` Just drop the slot number From 79eaaa85fabd403ec46f925be8f5ee2fa1dbfa44 Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 3 Mar 2023 21:35:13 -0500 Subject: [PATCH 40/55] Update ThrottleAssists.md Fixing formatting --- Release_Notes/ThrottleAssists.md | 64 +++++++++++++++++--------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/Release_Notes/ThrottleAssists.md b/Release_Notes/ThrottleAssists.md index 5f4a68d..e704b42 100644 --- a/Release_Notes/ThrottleAssists.md +++ b/Release_Notes/ThrottleAssists.md @@ -10,40 +10,44 @@ Turnouts The conventional turnout definition commands and the `````` responses do not contain information about the turnout description which may have been provided in an EXRAIL script. A turnout description is much more user friendly than the cryptic "T123", and having a list helps the throttle UI build a suitable set of buttons. -`````` command returns a list of turnout ids. The throttle should be uninterested in the turnout technology used but needs to know the ids it can throw/close and monitor the current state. +`````` command returns a list of turnout ids. The throttle should be uninterested in the turnout technology used but needs to know the ids it can throw/close and monitor the current state. e.g. response `````` -````` requests info on turnout 17. -e.g. response `````` or `````` -(T=thrown, C=closed) -or `````` indicating turnout description not given. -or `````` indicating turnout unknown (or possibly hidden.) - -Note: It is still the throttles responsibility to monitor the status broadcasts. - (TBD I'm thinking that the existing broadcast is messy and needs cleaning up) - However, I'm not keen on dynamically created/deleted turnouts so I have no intention of providing a command that indicates the turnout list has been updated since the throttle started. - Also note that turnouts marked in EXRAIL with the HIDDEN keyword instead of a "description" will NOT show up in these commands. +````` requests info on turnout 17. +e.g. response `````` or ````` +(T=thrown, C=closed) +or `````` indicating turnout description not given. +or `````` indicating turnout unknown (or possibly hidden.) + +Note: It is still the throttles responsibility to monitor the status broadcasts. +(TBD I'm thinking that the existing broadcast is messy and needs cleaning up) +However, I'm not keen on dynamically created/deleted turnouts so I have no intention of providing a command that indicates the turnout list has been updated since the throttle started. +Also note that turnouts marked in EXRAIL with the HIDDEN keyword instead of a "description" will NOT show up in these commands. Automations/Routes ==================== - A throttle need to know which EXRAIL Automations and Routes it can show the user. - - `````` Returns a list of Automations/Routes - e.g. `````` - Indicates route/automation ids. - Information on each route needs to be obtained by - `````` - returns e.g. `````` for a route - or `````` for an automation. - or `````` for id not found - - Whats the difference: - A Route is just a call to an EXRAIL ROUTE, traditionally to set some turnouts or signals but can be used to perform any kind of EXRAIL function... but its not expecting to know the loco. - Thus a route can be triggered by sending in for example ``````. + A throttle need to know which EXRAIL Automations and Routes it can show the user. + + `````` Returns a list of Automations/Routes + e.g. `````` + Indicates route/automation ids. + Information on each route needs to be obtained by + `````` + returns e.g. `````` for a route + or `````` for an automation. + or `````` for id not found + + What's the difference? + ----------------------- + +A *Route* is just a call to an **EXRAIL ROUTE**, traditionally to set some turnouts or signals but can be used to perform any kind of EXRAIL function... but its not expecting to know the loco. + +Thus, a route can be triggered by sending in for example ``````. + + An *Automation* is a handoff of the last accessed loco id to an EXRAIL AUTOMATION which would typically drive the loco away. - An Automation is a handoff of the last accessed loco id to an EXRAIL AUTOMATION which would typically drive the loco away. Thus an Automation expects a start command with a cab id e.g. `````` @@ -68,10 +72,10 @@ Note: It is still the throttles responsibility to monitor the status broadcasts. COMMANDS TO AVOID ====================== - `````` Use `````` - `````` Just drop the slot number - `````` other than `````` - `````` + `````` Use `````` + `````` Just drop the slot number + `````` other than `````` + `````` `````` From d3eceb6d6c61e507304e5f85cb196405b99148f3 Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 3 Mar 2023 21:41:22 -0500 Subject: [PATCH 41/55] Update ThrottleAssists.md --- Release_Notes/ThrottleAssists.md | 46 +++++++++++++++++--------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/Release_Notes/ThrottleAssists.md b/Release_Notes/ThrottleAssists.md index e704b42..2055618 100644 --- a/Release_Notes/ThrottleAssists.md +++ b/Release_Notes/ThrottleAssists.md @@ -13,14 +13,14 @@ The conventional turnout definition commands and the `````` responses do not `````` command returns a list of turnout ids. The throttle should be uninterested in the turnout technology used but needs to know the ids it can throw/close and monitor the current state. e.g. response `````` -````` requests info on turnout 17. -e.g. response `````` or ````` -(T=thrown, C=closed) -or `````` indicating turnout description not given. +````` requests info on turnout 17.\ +e.g. response `````` or `````\ +(T=thrown, C=closed)\ +or `````` indicating turnout description not given.\ or `````` indicating turnout unknown (or possibly hidden.) -Note: It is still the throttles responsibility to monitor the status broadcasts. -(TBD I'm thinking that the existing broadcast is messy and needs cleaning up) +Note: It is still the throttles responsibility to monitor the status broadcasts.\ +(TBD I'm thinking that the existing broadcast is messy and needs cleaning up)\ However, I'm not keen on dynamically created/deleted turnouts so I have no intention of providing a command that indicates the turnout list has been updated since the throttle started. Also note that turnouts marked in EXRAIL with the HIDDEN keyword instead of a "description" will NOT show up in these commands. @@ -30,13 +30,13 @@ Also note that turnouts marked in EXRAIL with the HIDDEN keyword instead of a "d A throttle need to know which EXRAIL Automations and Routes it can show the user. - `````` Returns a list of Automations/Routes - e.g. `````` - Indicates route/automation ids. - Information on each route needs to be obtained by - `````` - returns e.g. `````` for a route - or `````` for an automation. + `````` Returns a list of Automations/Routes\ + e.g. ``````\ + Indicates route/automation ids.\ + Information on each route needs to be obtained by\ + ``````\ + returns e.g. `````` for a route\ + or `````` for an automation.\ or `````` for id not found What's the difference? @@ -45,14 +45,15 @@ Also note that turnouts marked in EXRAIL with the HIDDEN keyword instead of a "d A *Route* is just a call to an **EXRAIL ROUTE**, traditionally to set some turnouts or signals but can be used to perform any kind of EXRAIL function... but its not expecting to know the loco. Thus, a route can be triggered by sending in for example ``````. + +An *Automation* is a handoff of the last accessed loco id to an EXRAIL AUTOMATION which would typically drive the loco away. - An *Automation* is a handoff of the last accessed loco id to an EXRAIL AUTOMATION which would typically drive the loco away. - - Thus an Automation expects a start command with a cab id + Thus an Automation expects a start command with a cab id\ e.g. `````` - Roster Information: + Roster Information + ^^^^^^^^^^^^^^^^^^ The `````` command requests a list of cab ids from the roster. e.g. responding `````` or for none. @@ -63,7 +64,8 @@ Thus, a route can be triggered by sending in for example ``````. Refer to EXRAIL ROSTER command for function map format. - Obtaining throttle status. + Obtaining throttle status + ^^^^^^^^^^^^^^^^^^^^^^^^^^ `````` Requests a deliberate update on the cab speed/functions in the same format as the cab broadcast. `````` Note that a slot of -1 indicates that the cab is not in the reminders table and this comand will not reserve a slot until such time as the cab is throttled. @@ -72,10 +74,10 @@ Thus, a route can be triggered by sending in for example ``````. COMMANDS TO AVOID ====================== - `````` Use `````` - `````` Just drop the slot number - `````` other than `````` - `````` + `````` Use ``````\ + `````` Just drop the slot number\ + `````` other than ``````\ + ``````\ `````` From 98af5c45eda659ad48b5b29aeba173ec09897db7 Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 3 Mar 2023 21:46:07 -0500 Subject: [PATCH 42/55] Update ThrottleAssists.md --- Release_Notes/ThrottleAssists.md | 40 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Release_Notes/ThrottleAssists.md b/Release_Notes/ThrottleAssists.md index 2055618..56677ae 100644 --- a/Release_Notes/ThrottleAssists.md +++ b/Release_Notes/ThrottleAssists.md @@ -13,7 +13,7 @@ The conventional turnout definition commands and the `````` responses do not `````` command returns a list of turnout ids. The throttle should be uninterested in the turnout technology used but needs to know the ids it can throw/close and monitor the current state. e.g. response `````` -````` requests info on turnout 17.\ +````` requests info on turnout 17\ e.g. response `````` or `````\ (T=thrown, C=closed)\ or `````` indicating turnout description not given.\ @@ -24,7 +24,6 @@ Note: It is still the throttles responsibility to monitor the status broadcasts. However, I'm not keen on dynamically created/deleted turnouts so I have no intention of providing a command that indicates the turnout list has been updated since the throttle started. Also note that turnouts marked in EXRAIL with the HIDDEN keyword instead of a "description" will NOT show up in these commands. - Automations/Routes ==================== @@ -51,30 +50,31 @@ An *Automation* is a handoff of the last accessed loco id to an EXRAIL AUTOMATIO Thus an Automation expects a start command with a cab id\ e.g. `````` +Roster Information +^^^^^^^^^^^^^^^^^^ - Roster Information - ^^^^^^^^^^^^^^^^^^ - The `````` command requests a list of cab ids from the roster. - e.g. responding `````` - or for none. +The `````` command requests a list of cab ids from the roster. +e.g. responding `````` +or for none. - Each Roster entry had a name and function map obtained by: - `````` reply like ``` +Each Roster entry had a name and function map obtained by: +`````` reply like ``` - Refer to EXRAIL ROSTER command for function map format. +Refer to EXRAIL ROSTER command for function map format. + +Obtaining throttle status +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +`````` Requests a deliberate update on the cab speed/functions in the same format as the cab broadcast. +`````` + +Note that a slot of -1 indicates that the cab is not in the reminders table and this comand will not reserve a slot until such time as the cab is throttled. - Obtaining throttle status - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - `````` Requests a deliberate update on the cab speed/functions in the same format as the cab broadcast. - `````` - Note that a slot of -1 indicates that the cab is not in the reminders table and this comand will not reserve a slot until such time as the cab is throttled. +COMMANDS TO AVOID +====================== - - COMMANDS TO AVOID - ====================== - - `````` Use ``````\ + `````` - Instead Use ``````\ `````` Just drop the slot number\ `````` other than ``````\ ``````\ From 91d36ae909b21eb7cbd215f4f5b6a85ab1181d83 Mon Sep 17 00:00:00 2001 From: Fred Date: Fri, 3 Mar 2023 21:59:18 -0500 Subject: [PATCH 43/55] Update ThrottleAssists.md --- Release_Notes/ThrottleAssists.md | 35 +++++++++++++------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/Release_Notes/ThrottleAssists.md b/Release_Notes/ThrottleAssists.md index 56677ae..19622fd 100644 --- a/Release_Notes/ThrottleAssists.md +++ b/Release_Notes/ThrottleAssists.md @@ -3,18 +3,17 @@ Throttle Assist updates for versiuon 4.? Chris Harlow April 2022 There are a number of additional throttle information commands that have been implemented to assist throttle authors to obtain information from the Command Station in order to implement turnout, route/automation and roster features which are already found in the Withrottle implementations. -These commands are new and not overlapped with the existing commands which are probabaly due to be obsoleted as they are over complex and unfit for purpose. +These commands are new and not overlapped with the existing commands which are probabaly due to be obsoleted as they are over complex and unfit for purpose. -Turnouts -============ +# Turnouts The conventional turnout definition commands and the `````` responses do not contain information about the turnout description which may have been provided in an EXRAIL script. A turnout description is much more user friendly than the cryptic "T123", and having a list helps the throttle UI build a suitable set of buttons. `````` command returns a list of turnout ids. The throttle should be uninterested in the turnout technology used but needs to know the ids it can throw/close and monitor the current state. e.g. response `````` -````` requests info on turnout 17\ -e.g. response `````` or `````\ +`````` requests info on turnout 17\ +e.g. response `````` or ``````\ (T=thrown, C=closed)\ or `````` indicating turnout description not given.\ or `````` indicating turnout unknown (or possibly hidden.) @@ -24,8 +23,7 @@ Note: It is still the throttles responsibility to monitor the status broadcasts. However, I'm not keen on dynamically created/deleted turnouts so I have no intention of providing a command that indicates the turnout list has been updated since the throttle started. Also note that turnouts marked in EXRAIL with the HIDDEN keyword instead of a "description" will NOT show up in these commands. - Automations/Routes - ==================== + # Automations/Routes A throttle need to know which EXRAIL Automations and Routes it can show the user. @@ -38,8 +36,7 @@ Also note that turnouts marked in EXRAIL with the HIDDEN keyword instead of a "d or `````` for an automation.\ or `````` for id not found - What's the difference? - ----------------------- + ## What's the difference? A *Route* is just a call to an **EXRAIL ROUTE**, traditionally to set some turnouts or signals but can be used to perform any kind of EXRAIL function... but its not expecting to know the loco. @@ -50,31 +47,27 @@ An *Automation* is a handoff of the last accessed loco id to an EXRAIL AUTOMATIO Thus an Automation expects a start command with a cab id\ e.g. `````` -Roster Information -^^^^^^^^^^^^^^^^^^ +### Roster Information -The `````` command requests a list of cab ids from the roster. -e.g. responding `````` +The `````` command requests a list of cab ids from the roster\ +e.g. responding ``````\ or for none. -Each Roster entry had a name and function map obtained by: +Each Roster entry had a name and function map obtained by:\ `````` reply like ``` Refer to EXRAIL ROSTER command for function map format. -Obtaining throttle status -^^^^^^^^^^^^^^^^^^^^^^^^^^ +### Obtaining throttle status -`````` Requests a deliberate update on the cab speed/functions in the same format as the cab broadcast. +`````` Requests a deliberate update on the cab speed/functions in the same format as the cab broadcast\ `````` Note that a slot of -1 indicates that the cab is not in the reminders table and this comand will not reserve a slot until such time as the cab is throttled. +# COMMANDS TO AVOID -COMMANDS TO AVOID -====================== - - `````` - Instead Use ``````\ + `````` Instead Use ``````\ `````` Just drop the slot number\ `````` other than ``````\ ``````\ From cc3aba1febc310cb5d67afbef27ecd21c84e0611 Mon Sep 17 00:00:00 2001 From: stevet Date: Tue, 25 Apr 2023 16:02:42 -0400 Subject: [PATCH 44/55] Update WiThrottle.cpp Fix: turnout state should be 2/4, not T2/T4 --- WiThrottle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WiThrottle.cpp b/WiThrottle.cpp index 60bdf7d..f081270 100644 --- a/WiThrottle.cpp +++ b/WiThrottle.cpp @@ -127,7 +127,7 @@ void WiThrottle::parse(RingStream * stream, byte * cmdx) { #endif char tchar=Turnout::isClosed(id)?'2':'4'; if (tdesc==NULL) // turnout with no description - StringFormatter::send(stream,F("]\\[%d}|{T%d}|{T%c"), id,id,tchar); + StringFormatter::send(stream,F("]\\[%d}|{T%d}|{%c"), id,id,tchar); else StringFormatter::send(stream,F("]\\[%d}|{%S}|{%c"), id,tdesc,tchar); } From 99521f8a3fd5ac603f926e54243f9ecdf9fa16fc Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sat, 20 May 2023 17:35:09 +0200 Subject: [PATCH 45/55] Support DCC-EX shield --- MotorDrivers.h | 6 ++++++ config.example.h | 1 + version.h | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/MotorDrivers.h b/MotorDrivers.h index cfb0dd8..3b82858 100644 --- a/MotorDrivers.h +++ b/MotorDrivers.h @@ -50,6 +50,12 @@ new MotorDriver(3, 12, UNUSED_PIN, UNUSED_PIN, A0, 2.99, 2000, UNUSED_PIN), \ new MotorDriver(11, 13, UNUSED_PIN, UNUSED_PIN, A1, 2.99, 2000, UNUSED_PIN) +// DCC-EX TI DRV8874 based motor shield +// This motor shield has reverse sense fault pins thus the -A4 and -A5 pin values. +#define EX8874_SHIELD F("EX8874"), \ + new MotorDriver( 3, 12, UNUSED_PIN, 9, A0, 4.86, 5000, A4), \ + new MotorDriver(11, 13, UNUSED_PIN, 8, A1, 4.86, 5000, A5) + // Pololu Motor Shield #define POLOLU_MOTOR_SHIELD F("POLOLU_MOTOR_SHIELD"), \ new MotorDriver( 9, 7, UNUSED_PIN, -4, A0, 18, 3000, 12), \ diff --git a/config.example.h b/config.example.h index 3dac207..3c9610d 100644 --- a/config.example.h +++ b/config.example.h @@ -41,6 +41,7 @@ The configuration file for DCC-EX Command Station // FIREBOX_MK1 : The Firebox MK1 // FIREBOX_MK1S : The Firebox MK1S // IBT_2_WITH_ARDUINO : Arduino Motor Shield for PROG and IBT-2 for MAIN +// EX8874_SHIELD : DCC-EX TI DRV8874 based motor shield // | // +-----------------------v // diff --git a/version.h b/version.h index d340aa0..23b0a7c 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "4.1.5" +#define VERSION "4.1.6" +// 4.1.6 Support DCC-EX shield // 4.1.5 Bugfix LCN number parsing // 4.1.4 Bugfix for issue #299 TurnoutDescription NULL // 4.1.3 Bugfix: Ethernet init order From 2eb0f4899456e9e292442e4f37251aa18293ac5c Mon Sep 17 00:00:00 2001 From: Fred Date: Thu, 29 Jun 2023 14:24:51 -0400 Subject: [PATCH 46/55] Update .gitignore Updated .gitignore from the devel branch and used "my@.cpp" instead of listing the individual files so we can ignore anything that starts with "my" --- .gitignore | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 2bf0b5e..32e70d6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,12 +7,7 @@ Release/* .pio/ .vscode/ config.h -.vscode/* -mySetup.h -mySetup.cpp -myHal.cpp -myAutomation.h -myFilter.cpp -myAutomation.h -myFilter.cpp -myLayout.h +my*.cpp +my*.h +!my*.example.h +compile_commands.json From f754fe2fbfd726d2cdbf1462bd4caf376b59708c Mon Sep 17 00:00:00 2001 From: kempe63 <78020007+kempe63@users.noreply.github.com> Date: Sat, 29 Jul 2023 20:34:39 +0100 Subject: [PATCH 47/55] GPIO PCA9555 / TCA9555 support My 1st commit, be gentle --- IO_PCA9555.h | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 IO_PCA9555.h diff --git a/IO_PCA9555.h b/IO_PCA9555.h new file mode 100644 index 0000000..137e287 --- /dev/null +++ b/IO_PCA9555.h @@ -0,0 +1,112 @@ +/* + * © 2021, Neil McKechnie. All rights reserved. + * + * This file is part of DCC++EX API + * + * This is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * It is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with CommandStation. If not, see . + */ + +#ifndef io_pca9555_h +#define io_pca9555_h + +#include "IO_GPIOBase.h" +#include "FSH.h" + +///////////////////////////////////////////////////////////////////////////////////////////////////// +/* + * IODevice subclass for PCA9555 16-bit I/O expander (NXP & Texas Instruments). + */ + +class PCA9555 : public GPIOBase { +public: + static void create(VPIN vpin, int nPins, uint8_t I2CAddress, int interruptPin=-1) { + new PCA9555(vpin, min(nPins,16), I2CAddress, interruptPin); + } + + // Constructor + PCA9555(VPIN vpin, int nPins, uint8_t I2CAddress, int interruptPin=-1) + : GPIOBase((FSH *)F("PCA9555"), vpin, nPins, I2CAddress, interruptPin) + { + requestBlock.setRequestParams(_I2CAddress, inputBuffer, sizeof(inputBuffer), + outputBuffer, sizeof(outputBuffer)); + outputBuffer[0] = REG_INPUT_P0; + } + +private: + void _writeGpioPort() override { + I2CManager.write(_I2CAddress, 3, REG_OUTPUT_P0, _portOutputState, _portOutputState>>8); + } + void _writePullups() override { + // Do nothing, pull-ups are always in place for input ports + // This function is here for HAL GPIOBase API compatibilitiy + + } + void _writePortModes() override { + // Write 0 to REG_CONF_P0 & REG_CONF_P1 for in-use pins that are outputs, 1 for others. + // PCA9555 & TCA9555, Interrupt is always enabled for raising and falling edge + uint16_t temp = ~(_portMode & _portInUse); + I2CManager.write(_I2CAddress, 3, REG_CONF_P0, temp, temp>>8); + } + void _readGpioPort(bool immediate) override { + if (immediate) { + uint8_t buffer[2]; + I2CManager.read(_I2CAddress, buffer, 2, 1, REG_INPUT_P0); + _portInputState = ((uint16_t)buffer[1]<<8) | buffer[0]; + /* PCA9555 Int bug fix, from PCA9555 datasheet: "must change command byte to something besides 00h + * after a Read operation to the PCA9555 device or before reading from + * another device" + * Recommended solution, read from REG_OUTPUT_P0, then do nothing with the received data + * Issue not seen during testing, uncomment if needed + */ + //I2CManager.read(_I2CAddress, buffer, 2, 1, REG_OUTPUT_P0); + } else { + // Queue new request + requestBlock.wait(); // Wait for preceding operation to complete + // Issue new request to read GPIO register + I2CManager.queueRequest(&requestBlock); + } + } + // This function is invoked when an I/O operation on the requestBlock completes. + void _processCompletion(uint8_t status) override { + if (status == I2C_STATUS_OK) + _portInputState = ((uint16_t)inputBuffer[1]<<8) | inputBuffer[0]; + else + _portInputState = 0xffff; + } + + void _setupDevice() override { + // HAL API calls + _writePortModes(); + _writePullups(); + _writeGpioPort(); + } + + uint8_t inputBuffer[2]; + uint8_t outputBuffer[1]; + + + enum { + REG_INPUT_P0 = 0x00, + REG_INPUT_P1 = 0x01, + REG_OUTPUT_P0 = 0x02, + REG_OUTPUT_P1 = 0x03, + REG_POL_INV_P0 = 0x04, + REG_POL_INV_P1 = 0x05, + REG_CONF_P0 = 0x06, + REG_CONF_P1 = 0x07, + }; + +}; + +#endif From 415e756020707e1c0f1c145e0608d1493743d8dc Mon Sep 17 00:00:00 2001 From: pmantoine Date: Mon, 31 Jul 2023 16:51:25 +0800 Subject: [PATCH 48/55] More Nucleo variant defines --- DCCTimerSTM32.cpp | 4 ++-- WifiInterface.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/DCCTimerSTM32.cpp b/DCCTimerSTM32.cpp index cc60547..cffae40 100644 --- a/DCCTimerSTM32.cpp +++ b/DCCTimerSTM32.cpp @@ -35,7 +35,7 @@ #endif #include "DIAG.h" -#if defined(ARDUINO_NUCLEO_F411RE) +#if defined(ARDUINO_NUCLEO_F401RE) || defined(ARDUINO_NUCLEO_F411RE) // Nucleo-64 boards don't have additional serial ports defined by default HardwareSerial Serial1(PB7, PA15); // Rx=PB7, Tx=PA15 -- CN7 pins 17 and 21 - F411RE // Serial2 is defined to use USART2 by default, but is in fact used as the diag console @@ -52,7 +52,7 @@ HardwareSerial Serial6(PA12, PA11); // Rx=PA12, Tx=PA11 -- CN10 pins 12 and 14 HardwareSerial Serial3(PC11, PC10); // Rx=PC11, Tx=PC10 -- USART3 - F446RE HardwareSerial Serial5(PD2, PC12); // Rx=PC7, Tx=PC6 -- UART5 - F446RE // On the F446RE, Serial4 and Serial6 also use pins we can't readily map while using the Arduino pins -#elif defined(ARDUINO_NUCLEO_F412ZG) || defined(ARDUINO_NUCLEO_F429ZI) || defined(ARDUINO_NUCLEO_F446ZE) +#elif defined(ARDUINO_NUCLEO_F413ZH) || defined(ARDUINO_NUCLEO_F429ZI) || defined(ARDUINO_NUCLEO_F446ZE)|| defined(ARDUINO_NUCLEO_F412ZG) // Nucleo-144 boards don't have Serial1 defined by default HardwareSerial Serial6(PG9, PG14); // Rx=PG9, Tx=PG14 -- USART6 // Serial3 is defined to use USART3 by default, but is in fact used as the diag console diff --git a/WifiInterface.cpp b/WifiInterface.cpp index 20dc235..7511af6 100644 --- a/WifiInterface.cpp +++ b/WifiInterface.cpp @@ -60,7 +60,7 @@ Stream * WifiInterface::wifiStream; #if defined(ARDUINO_ARCH_STM32) // Handle serial ports availability on STM32 for variants! // #undef NUM_SERIAL -#if defined(ARDUINO_NUCLEO_F411RE) +#if defined(ARDUINO_NUCLEO_F401RE) || defined(ARDUINO_NUCLEO_F411RE) #define NUM_SERIAL 3 #define SERIAL1 Serial1 #define SERIAL3 Serial6 @@ -68,9 +68,11 @@ Stream * WifiInterface::wifiStream; #define NUM_SERIAL 3 #define SERIAL1 Serial3 #define SERIAL3 Serial5 -#elif defined(ARDUINO_NUCLEO_F412ZG) || defined(ARDUINO_NUCLEO_F429ZI) || defined(ARDUINO_NUCLEO_F446ZE) +#elif defined(ARDUINO_NUCLEO_F413ZH) || defined(ARDUINO_NUCLEO_F429ZI) || defined(ARDUINO_NUCLEO_F446ZE) || defined(ARDUINO_NUCLEO_F412ZG) #define NUM_SERIAL 2 #define SERIAL1 Serial6 +#else +#warning This variant of Nucleo not yet explicitly supported #endif #endif From e3ac3a8ddf5f434838b39545b4c2314e227093d4 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Wed, 2 Aug 2023 01:02:46 +0200 Subject: [PATCH 49/55] Protect Uno user from choosing DC(X) --- TrackManager.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/TrackManager.cpp b/TrackManager.cpp index 8588383..b786181 100644 --- a/TrackManager.cpp +++ b/TrackManager.cpp @@ -192,11 +192,16 @@ bool TrackManager::setTrackMode(byte trackToSet, TRACK_MODE mode, int16_t dcAddr //DIAG(F("Track=%c Mode=%d"),trackToSet+'A', mode); // DC tracks require a motorDriver that can set brake! - if ((mode==TRACK_MODE_DC || mode==TRACK_MODE_DCX) - && !track[trackToSet]->brakeCanPWM()) { - DIAG(F("Brake pin can't PWM: No DC")); - return false; - } + if (mode==TRACK_MODE_DC || mode==TRACK_MODE_DCX) { +#if defined(ARDUINO_AVR_UNO) + DIAG(F("Uno has no PWM timers available for DC")); + return false; +#endif + if (!track[trackToSet]->brakeCanPWM()) { + DIAG(F("Brake pin can't PWM: No DC")); + return false; + } + } #ifdef ARDUINO_ARCH_ESP32 // remove pin from MUX matrix and turn it off From 36d139268dacdc1128ca7a6c6ce956ca0eb3b11c Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Wed, 2 Aug 2023 01:05:31 +0200 Subject: [PATCH 50/55] AVR: Pin specific timer register seting for speed and mode when inrush throttling and for DC PWM --- MotorDriver.cpp | 66 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/MotorDriver.cpp b/MotorDriver.cpp index 5b51778..d5dca13 100644 --- a/MotorDriver.cpp +++ b/MotorDriver.cpp @@ -291,14 +291,39 @@ uint16_t taurustones[28] = { 165, 175, 196, 220, void MotorDriver::setDCSignal(byte speedcode) { if (brakePin == UNUSED_PIN) return; + switch(brakePin) { #if defined(ARDUINO_AVR_UNO) - TCCR2B = (TCCR2B & B11111000) | B00000110; // set divisor on timer 2 to result in (approx) 122.55Hz + // Not worth doin something here as: + // If we are on pin 9 or 10 we are on Timer1 and we can not touch Timer1 as that is our DCC source. + // If we are on pin 5 or 6 we are on Timer 0 ad we can not touch Timer0 as that is millis() etc. + // We are most likely not on pin 3 or 11 as no known motor shield has that as brake. #endif #if defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560) - TCCR2B = (TCCR2B & B11111000) | B00000110; // set divisor on timer 2 to result in (approx) 122.55Hz - TCCR4B = (TCCR4B & B11111000) | B00000100; // same for timer 4 but maxcount and thus divisor differs - TCCR5B = (TCCR5B & B11111000) | B00000100; // same for timer 5 which is like timer 4 + case 9: + case 10: + // Timer2 (is differnet) + TCCR2A = (TCCR2A & B11111100) | B00000001; // set WGM1=0 and WGM0=1 phase correct PWM + TCCR2B = (TCCR2B & B11110000) | B00000110; // set WGM2=0 ; set divisor on timer 2 to 1/256 for 122.55Hz + //DIAG(F("2 A=%x B=%x"), TCCR2A, TCCR2B); + break; + case 6: + case 7: + case 8: + // Timer4 + TCCR4A = (TCCR4A & B11111100) | B00000001; // set WGM0=1 and WGM1=0 for normal PWM 8-bit + TCCR4B = (TCCR4B & B11100000) | B00000100; // set WGM2=0 and WGM3=0 for normal PWM 8 bit and div 1/256 for 122.55Hz + break; + case 46: + case 45: + case 44: + // Timer5 + TCCR5A = (TCCR5A & B11111100) | B00000001; // set WGM0=1 and WGM1=0 for normal PWM 8-bit + TCCR5B = (TCCR5B & B11100000) | B00000100; // set WGM2=0 and WGM3=0 for normal PWM 8 bit and div 1/256 for 122.55Hz + break; #endif + default: + break; + } // spedcoode is a dcc speed & direction byte tSpeed=speedcode & 0x7F; // DCC Speed with 0,1 stop and speed steps 2 to 127 byte tDir=speedcode & 0x80; @@ -368,14 +393,39 @@ void MotorDriver::throttleInrush(bool on) { } #else if(on){ + switch(brakePin) { #if defined(ARDUINO_AVR_UNO) - TCCR2B = (TCCR2B & B11111000) | B00000001; // div 1 is max + // Not worth doin something here as: + // If we are on pin 9 or 10 we are on Timer1 and we can not touch Timer1 as that is our DCC source. + // If we are on pin 5 or 6 we are on Timer 0 ad we can not touch Timer0 as that is millis() etc. + // We are most likely not on pin 3 or 11 as no known motor shield has that as brake. #endif #if defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560) - TCCR2B = (TCCR2B & B11111000) | B00000001; // div 1 is max - TCCR4B = (TCCR4B & B11111000) | B00000001; // div 1 is max - TCCR5B = (TCCR5B & B11111000) | B00000001; // div 1 is max + case 9: + case 10: + // Timer2 (is different) + TCCR2A = (TCCR2A & B11111100) | B00000011; // set WGM0=1 and WGM1=1 for fast PWM + TCCR2B = (TCCR2B & B11110000) | B00000001; // set WGM2=0 and prescaler div=1 (max) + DIAG(F("2 A=%x B=%x"), TCCR2A, TCCR2B); + break; + case 6: + case 7: + case 8: + // Timer4 + TCCR4A = (TCCR4A & B11111100) | B00000001; // set WGM0=1 and WGM1=0 for fast PWM 8-bit + TCCR4B = (TCCR4B & B11100000) | B00001001; // set WGM2=1 and WGM3=0 for fast PWM 8 bit and div=1 (max) + break; + case 46: + case 45: + case 44: + // Timer5 + TCCR5A = (TCCR5A & B11111100) | B00000001; // set WGM0=1 and WGM1=0 for fast PWM 8-bit + TCCR5B = (TCCR5B & B11100000) | B00001001; // set WGM2=1 and WGM3=0 for fast PWM 8 bit and div=1 (max) + break; #endif + default: + break; + } } analogWrite(brakePin,duty); #endif From df2e6512174398b48314903fde2b6c891603c59d Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Wed, 2 Aug 2023 01:12:32 +0200 Subject: [PATCH 51/55] version, compile warning --- DCCEXParser.cpp | 3 +++ GITHUB_SHA.h | 2 +- version.h | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index aa635ae..aaf733c 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -219,6 +219,9 @@ void DCCEXParser::parse(Print *stream, byte *com, RingStream *ringStream) { void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream) { +#ifdef DISABLE_PROG + (void)ringStream; +#endif #ifndef DISABLE_EEPROM (void)EEPROM; // tell compiler not to warn this is unused #endif diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index 76dcf44..8150235 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202307250927Z" +#define GITHUB_SHA "devel-202308012308Z" diff --git a/version.h b/version.h index bfb3a0b..9323606 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,11 @@ #include "StringFormatter.h" -#define VERSION "4.2.66" +#define VERSION "4.2.67" +// 4.2.67 - AVR: Pin specific timer register seting +// - Protect Uno user from choosing DC(X) +// - More Nucleo variant defines +// - GPIO PCA9555 / TCA9555 support // 4.2.66 - Throttle inrush current by applying PWM to brake pin when // fault pin goes active // 4.2.65 - new config WIFI_FORCE_AP option From a74d85e895dab6e9816b9d1bd33203667a527da6 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Wed, 2 Aug 2023 10:00:43 +0200 Subject: [PATCH 52/55] Rename track mode OFF to NONE --- GITHUB_SHA.h | 2 +- MotorDriver.h | 4 ++-- TrackManager.cpp | 15 ++++++++------- version.h | 3 ++- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index 8150235..77a75c5 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202308012308Z" +#define GITHUB_SHA "devel-202308020800Z" diff --git a/MotorDriver.h b/MotorDriver.h index b8de0b0..21bceb6 100644 --- a/MotorDriver.h +++ b/MotorDriver.h @@ -28,7 +28,7 @@ #include "DCCTimer.h" // use powers of two so we can do logical and/or on the track modes in if clauses. -enum TRACK_MODE : byte {TRACK_MODE_OFF = 1, TRACK_MODE_MAIN = 2, TRACK_MODE_PROG = 4, +enum TRACK_MODE : byte {TRACK_MODE_NONE = 1, TRACK_MODE_MAIN = 2, TRACK_MODE_PROG = 4, TRACK_MODE_DC = 8, TRACK_MODE_DCX = 16, TRACK_MODE_EXT = 32}; #define setHIGH(fastpin) *fastpin.inout |= fastpin.maskHIGH @@ -290,7 +290,7 @@ class MotorDriver { static const int TRIP_CURRENT_PROG=250; unsigned long power_sample_overload_wait = POWER_SAMPLE_OVERLOAD_WAIT; unsigned int power_good_counter = 0; - TRACK_MODE trackMode = TRACK_MODE_OFF; // we assume off at startup + TRACK_MODE trackMode = TRACK_MODE_NONE; // we assume track not assigned at startup }; #endif diff --git a/TrackManager.cpp b/TrackManager.cpp index b786181..db5b6b9 100644 --- a/TrackManager.cpp +++ b/TrackManager.cpp @@ -38,6 +38,7 @@ const int16_t HASH_KEYWORD_PROG = -29718; #endif const int16_t HASH_KEYWORD_MAIN = 11339; const int16_t HASH_KEYWORD_OFF = 22479; +const int16_t HASH_KEYWORD_NONE = -26550; const int16_t HASH_KEYWORD_DC = 2183; const int16_t HASH_KEYWORD_DCX = 6463; // DC reversed polarity const int16_t HASH_KEYWORD_EXT = 8201; // External DCC signal @@ -140,7 +141,7 @@ void TrackManager::addTrack(byte t, MotorDriver* driver) { track[t]=driver; if (driver) { track[t]->setPower(POWERMODE::OFF); - track[t]->setMode(TRACK_MODE_OFF); + track[t]->setMode(TRACK_MODE_NONE); track[t]->setTrackLetter('A'+t); lastTrack=t; } @@ -224,7 +225,7 @@ bool TrackManager::setTrackMode(byte trackToSet, TRACK_MODE mode, int16_t dcAddr FOR_EACH_TRACK(t) if (track[t]->getMode()==TRACK_MODE_PROG && t != trackToSet) { track[t]->setPower(POWERMODE::OFF); - track[t]->setMode(TRACK_MODE_OFF); + track[t]->setMode(TRACK_MODE_NONE); track[t]->makeProgTrack(false); // revoke prog track special handling streamTrackState(NULL,t); } @@ -332,8 +333,8 @@ bool TrackManager::parseJ(Print *stream, int16_t params, int16_t p[]) return setTrackMode(p[0],TRACK_MODE_PROG); #endif - if (params==2 && p[1]==HASH_KEYWORD_OFF) // <= id OFF> - return setTrackMode(p[0],TRACK_MODE_OFF); + if (params==2 && (p[1]==HASH_KEYWORD_OFF || p[1]==HASH_KEYWORD_NONE)) // <= id OFF> <= id NONE> + return setTrackMode(p[0],TRACK_MODE_NONE); if (params==2 && p[1]==HASH_KEYWORD_EXT) // <= id EXT> return setTrackMode(p[0],TRACK_MODE_EXT); @@ -360,8 +361,8 @@ void TrackManager::streamTrackState(Print* stream, byte t) { format=F("<= %c PROG>\n"); break; #endif - case TRACK_MODE_OFF: - format=F("<= %c OFF>\n"); + case TRACK_MODE_NONE: + format=F("<= %c NONE>\n"); break; case TRACK_MODE_EXT: format=F("<= %c EXT>\n"); @@ -443,7 +444,7 @@ void TrackManager::setPower2(bool setProg,POWERMODE mode) { driver->setBrake(false); driver->setPower(mode); break; - case TRACK_MODE_OFF: + case TRACK_MODE_NONE: break; } } diff --git a/version.h b/version.h index 9323606..465f684 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "4.2.67" +#define VERSION "4.2.68" +// 4.2.68 - Rename track mode OFF to NONE // 4.2.67 - AVR: Pin specific timer register seting // - Protect Uno user from choosing DC(X) // - More Nucleo variant defines From f2be3aeac325a9ffbacf700c8b444d2693d2bdf5 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Fri, 4 Aug 2023 14:45:05 +0200 Subject: [PATCH 53/55] Make work in DC mode --- GITHUB_SHA.h | 2 +- TrackManager.cpp | 2 +- version.h | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index 77a75c5..a889ba7 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202308020800Z" +#define GITHUB_SHA "devel-202308041244Z" diff --git a/TrackManager.cpp b/TrackManager.cpp index db5b6b9..0f69235 100644 --- a/TrackManager.cpp +++ b/TrackManager.cpp @@ -182,7 +182,7 @@ void TrackManager::setPROGSignal( bool on) { // with interrupts turned off around the critical section void TrackManager::setDCSignal(int16_t cab, byte speedbyte) { FOR_EACH_TRACK(t) { - if (trackDCAddr[t]!=cab) continue; + if (trackDCAddr[t]!=cab && cab != 0) continue; if (track[t]->getMode()==TRACK_MODE_DC) track[t]->setDCSignal(speedbyte); else if (track[t]->getMode()==TRACK_MODE_DCX) track[t]->setDCSignal(speedbyte ^ 128); } diff --git a/version.h b/version.h index 465f684..eb2d068 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "4.2.68" +#define VERSION "4.2.69" +// 4.2.69 - Bugfix: Make work in DC mode // 4.2.68 - Rename track mode OFF to NONE // 4.2.67 - AVR: Pin specific timer register seting // - Protect Uno user from choosing DC(X) From 3bddf4dfd1cf54c78d299682e790cde2e4f5bad7 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Mon, 7 Aug 2023 19:45:45 +0200 Subject: [PATCH 54/55] Make 4.2.69 the 5.0.0 release --- GITHUB_SHA.h | 2 +- version.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index a889ba7..9d4f5f6 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202308041244Z" +#define GITHUB_SHA "master-202308071744Z" diff --git a/version.h b/version.h index eb2d068..3eafa76 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "4.2.69" +#define VERSION "5.0.0" +// 5.0.0 - Make 4.2.69 the 5.0.0 release // 4.2.69 - Bugfix: Make work in DC mode // 4.2.68 - Rename track mode OFF to NONE // 4.2.67 - AVR: Pin specific timer register seting From fd58a749ef2ac71b85539b2e9b18fecaa48c5441 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Mon, 7 Aug 2023 19:45:45 +0200 Subject: [PATCH 55/55] Committing a SHA --- GITHUB_SHA.h | 2 +- version.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index a889ba7..ae005b5 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202308041244Z" +#define GITHUB_SHA "3bddf4d" diff --git a/version.h b/version.h index eb2d068..3eafa76 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "4.2.69" +#define VERSION "5.0.0" +// 5.0.0 - Make 4.2.69 the 5.0.0 release // 4.2.69 - Bugfix: Make work in DC mode // 4.2.68 - Rename track mode OFF to NONE // 4.2.67 - AVR: Pin specific timer register seting