Skip to content

Commit afb78a8

Browse files
Merge pull request #48 from Xylopyrographer/version2-development
STAC Version 2
2 parents fc33a1f + c60e8f2 commit afb78a8

22 files changed

+552
-913
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*/.DS_Store
2+
.DS_Store
3+
Documentation/.DS_Store
4+
Documentation/manual/.DS_Store
5+
.DS_Store
6+
Documentation/manual/.DS_Store
7+
.DS_Store
+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
### Creating the STAC Software Build Number
2+
3+
If you're not modifying the STAC software, you can ignore this document.
4+
5+
When in the throws of development and working with multiple ATOM units, sometimes I get lost as to which version of software is actually running on which unit. I could increment the `swVer` variable in the `STAC.ino` file every time I change something there or in any file in the `STACLib` folder but that means remembering to keep some other log file or such. So here's something new I'm trying out to hopefully deconfuse what version of software is actually running on the STAC.
6+
7+
In the `STAC.ino` file there is this line:
8+
9+
```
10+
String swVer = "2.0 (1a2b3c)"; // version and (build number) of this software. Shows up on the web config page, serial monitor startup data dump & is stored in NVS
11+
```
12+
13+
The string of six characters between the brackets is the build number. (`1a2b3c` is an example build number.)
14+
15+
It is generated by doing an MD5 hash of all the contents of the `STAC` folder and using the last six characters of that hash for the build number.
16+
17+
The utility that creates the hash is `hashdir`. Found on GitHub at:
18+
19+
`https://github.com/ultimateanu/hashdir`
20+
21+
and installed using Homebrew by:
22+
23+
`brew install ultimateanu/software/hashdir`
24+
25+
26+
To generate the build number, from Terminal run:
27+
28+
`hashdir -a md5 <folder>`
29+
30+
Where `<folder>` is the folder that contains only the `STAC.ino` file and the `STACLib` folder.
31+
32+
For example:
33+
34+
`hashdir -a md5 ~/Documents/SmartTallyAtomClient/STAC`
35+
36+
will produce something like:
37+
38+
`9c5d0c5114fab7a3f6b0770bd10bbefe /STAC`
39+
40+
In this example, `0bbefe` would be the build number for this version of STAC.
41+
42+
**BUT** before you generate the hash, first edit the line:
43+
44+
`String swVer = "2.0 (1a2b3c)"; // version and (build number) of this software. Shows up on the web config page, serial monitor startup data dump & is stored in NVS`
45+
46+
to remove the old build number so that it looks like this:
47+
48+
`String swVer = "2.0 ()"; // version and (build number) of this software. Shows up on the web config page, serial monitor startup data dump & is stored in NVS`
49+
50+
Then save the `STAC.ino` file and any other file that might be open from the `STACLib` foder.
51+
52+
Now create and save the new build number:
53+
54+
1. Generate the hash
55+
1. Copy the last six characters of the hash from the Terminal window - this is the new build number
56+
1. Open the `STAC.ino` file
57+
1. Paste the new build number in between the brackets on the line:
58+
59+
```
60+
String swVer = "2.0 ()"; // version and (build number) of this software. Shows up on the web config page, serial monitor startup data dump & is stored in NVS
61+
```
62+
63+
so it now looks like:
64+
65+
```
66+
String swVer = "2.0 (0bbefe)"; // version and (build number) of this software. Shows up on the web config page, serial monitor startup data dump & is stored in NVS
67+
```
68+
69+
5. Save the STAC.ino file
70+
6. Safe now to upload to the ATOM Matrix
71+
72+
*Why delete the old build number before doing the hash?*
73+
74+
By making note of the existing build number in the `STAC.ino` file, deleting the build number and then generating the hash, a quick check can be made if this version of the `STAC.ino` file and its associated `STACLib` `.h` files are the same as a version running on an ATOM. Delete the existing build number from the `STAC.ino` file, generate the hash, look at and compare the last six digits of the hash to the build number reported by the serial data dump from the STAC. If they match, odds are strong you're good.
75+
76+
**Xylopyrographer**<br>
77+
2022-08-05

Documentation/Detailed Change Log.md

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
2+
## Detailed Change Log
3+
4+
Intended for developers and others interested in the nitty gritty.
5+
6+
### Version 2.0
7+
8+
* Require arduino-esp32 core 2.0.3 or greater
9+
* there are irreconcilable breaking changes in WiFiClient from core 1.0.6
10+
11+
* Replace M5Stack ATOM libraries:
12+
* M5Stack are making library changes that are not backward compatible.
13+
* use JC_Button library for the display button;
14+
* use I2C_MPU6886 library for the IMU;
15+
* use FastLED library for the display;
16+
* replace "M5.dis.X" functions with bespoke display drawing routines.
17+
* directly initialize Serial.
18+
19+
* Break code into separate `.h` files by function group into a new STACLib folder.
20+
* add appropriate `#include` statements to `STAC.ino`.
21+
22+
* Rewrite of the `loop()` tally display code to better facilitate error handling.
23+
* error handling should now be done in `loop()`.
24+
25+
* Add user configurable polling interval via the web config page.
26+
* add polling interval as an NVS item.
27+
* increment the NVS `NOM_PREFS_VERSION`.
28+
29+
* Correct improper use of the `Preferences` library.
30+
31+
* No longer reformats the NVS when doing a factory reset.
32+
* clears all `Preferences` name spaces instead.
33+
34+
* Change layout of the startup data dump.
35+
* display the arduino-esp32 core version used.
36+
* display the ESP-IDF SDK version used.
37+
* show the polling interval.
38+
* items above the "`-----`" line are hard coded.
39+
* items above the "`=-=-=`" line are web config items.
40+
* items below the "`=-=-=`" line are run-time configurable.
41+
42+
* Add macros for setting the tally state on the GROVE connector.
43+
44+
* Set WiFi hostname to the STAC ID.
45+
46+
* Set the normal operating mode default polling interval to 300 ms.
47+
48+
* Set the Peripheral Mode polling interval to 0 ms.
49+
50+
* Remove left over debug code in `parseForm()`.
51+
52+
* Change all `drawGlyph()` `colors[]` parameter data type to `const int`.
53+
54+
* Remove `buttonClicked()` function in favour of native `JC_Button` library calls.
55+
* remove all references to `btnWas` & `btnNow`.
56+
57+
* Change `stIP` to use data type `IPAddress` instead of `char[]`.
58+
59+
* Fix the "set" order in `STACWiFi.h` so setting the hostname works with core v2.0.3.
60+
61+
* Fix a coding error in `getCreds()` in `STACWeb.h` that greatly improves error handling.
62+
63+
* Add `fetchInfo()` function to `STACUtil.h`.
64+
* interesting for debugging; not used in normal operation.
65+
66+
* With core v2.0.3 & greater, the default WiFi authentication/encryption
67+
mode of the STAC when being provisioned is now WAP2-PSK (AES).
68+
69+
* Rework of the error handling in `loop()`.
70+
71+
* Add "BigOrangeX" display error as notification that there is no STS connection at all (Camera operator mode only).
72+
73+
* Add filtering for erroneous `stClient` connection cases.
74+
* require eight consecutive errors of the same type before the glyph for that error type is displayed.
75+
* exception is when there is no connection at all to the STS (aka "BigOrangeX"), for which the error glyph is always displayed immediately.
76+
* all error counters are reset after an error glyph is displayed,
77+
78+
* Add setting of STS re-poll interval on errors by error type, independent of the re-poll interval; currently set as:
79+
* 1500 ms for "BigOrangeX"
80+
* 1000 ms for unknown "BigRedX"
81+
* 50 ms for all other errors
82+
83+
* Add `stClient.stop()` if we have an STS connection but the STS response timed out.
84+
85+
* Display the arduino-esp32 core version used on the STAC web config form.
86+
87+
* Display the ESP-IDF SDK version used on the STAC web config form.
88+
89+
* Add STAC software build number.
90+
* displayed in brackets after the software number on the Serial data dump and on the STAC web config form.
91+
* see `Documentation/Creating the build number.md` for details.

Documentation/Peripheral Mode Application Note.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ In Peripheral Mode, the STAC continually monitors the state of G26 and G32 on it
4242

4343
Here's the cool part. This allows the opportunity for developers to use a STAC set in Peripheral Mode as a tally indicator driven by an external piece of gear. Simply connect a cable to the GROVE port, apply power and drive pins G26 and G32 as needed.
4444

45-
**Be aware that the ATOM Matrix GPIO pins use 3.3V logic levels and are not 5V tolerant.<br>Driving any GPIO pin beyond 3.3 V will irreparably damage the device.**
45+
**Be aware that the ATOM Matrix GPIO pins use 3.3V logic levels and are not 5V tolerant.<br>Driving any GPIO pin beyond 3.3V will irreparably damage the device.**
4646
<br><br>
4747

4848
### Normal State (Controller) Output Signals
@@ -66,7 +66,7 @@ Starting with software v1.10, a STAC running it its normal operating state (not
6666

6767
This allows the opportunity for developers to use a STAC running in its normal state to provide tally information to another piece of gear.
6868

69-
To do this, connect a cable to the GROVE port, apply power and monitor the state of pins G26 and G32.
69+
To do this, connect a cable to the GROVE port, power up the STAC and monitor the state of pins G26 and G32.
7070

7171
This could allow the STAC to:
7272

@@ -76,7 +76,11 @@ This could allow the STAC to:
7676

7777
The "UNSELECTED" state is useful as it indicates normal operation and communication of the controller STAC with the Roland (or emulated) device being monitored even if that channel is not active in either PGM or PVW.
7878

79+
<<<<<<< HEAD
80+
With proper cabling, multiple STACs operating in Peripheral Mode could be connected in parallel to a STAC operating in its normal state. No testing has been done to confirm how many STACs could be driven in this manner. Power supply would be an issue to consider as well.
81+
=======
7982
With proper cabling, multiple STACS operating in Peripheral Mode could be connected in parallel to a STAC operating in its normal state. No testing has been done to confirm how many STACs could be driven in this manner. Power supply would be an issue to consider as well.
83+
>>>>>>> main
8084
8185
**Note**: Apply power to the STAC either via its USB port or via a cable connected to its GROVE connector. Do one or the other only, *never* both.
8286
<br><br>
@@ -105,5 +109,6 @@ To disable Peripheral Mode and return the STAC it to its normal operating state:
105109

106110
### Document Revision History
107111

112+
**2022-08-06:** Cleaned up a few more things.<br>
108113
**2022-06-27:** Cleaned up a few things.<br>
109114
**2022-01-04:** First release.<br>

Documentation/Release Notes.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,31 @@ __New Features__
66
* _Configurable Polling Interval_
77

88
* The amount of time, in milliseconds, between polls of the Smart Tally Server can now be set when configuring the STAC.
9+
* As a result, if an older version of STAC is running, the STAC will need to be reconfigured using a web browser after installing this update. Refer to the *STAC Users Guide*.
910

10-
__Internal Improvements__
11+
__Improvements__
1112

1213
* The STAC ID is now used as the WiFi hostname, making each STAC uniquely identifiable in the attached devices table of the WiFi router.
1314

1415
* The WiFi authentication/encryption mode of the STAC when it is being provisioned is now WAP2-PSK (AES).
1516

16-
* When operating in busy networks, the "Big Purple X" won't flicker, only activating when there is a number of consecutive communications errors with the Smart Tally Server.
17+
* When operating in busy networks, the "Big Purple X" won't flicker, only activating when there is a number of consecutive communication errors with the Smart Tally Server.
1718

18-
* Added a "Big Orange X" display error when the STAC cannot connect to the Smart Tally Server. Helps with troubleshooting to distinguish between "Big Purple X" and "Purple Question Mark" type errors.
19+
* Added a "Big Orange X" display error when the STAC cannot connect to the Smart Tally Server. Helps with troubleshooting to distinguish between "Big Purple X" and "Purple Question Mark" type errors. More info in the *STAC Users Guide*.
1920

2021
* Revised the format of the information dump sent to the serial port on startup.
2122

2223
* A bunch of house cleaning and other tweaks to speed things up and what not. You know, the usual stuff developers do when realizing they shouldn't have done something a certain way to begin with.
2324

2425
* Now based on arduino-esp32 core v2.0.3 or greater.
26+
* To compile the code, arduino-esp32 core v2.0.3 as a minimum is required. Core v1.0.6 is no longer supported.
27+
28+
* No longer requires modified core or M5Stack libraries.
29+
* But does require new libraries as per the `README.md` file.
2530

26-
* A new "_Detailed Release Notes_" document intended for developers is in the `STAC/Code` folder.
31+
* A new "*Detailed Change Log*" document intended for developers in the `Documentation` folder. It's the TLDR; version of this document.
32+
33+
* A new "*Creating the build number*" document intended for developers in the `Documentation` folder.
2734

2835

2936
## v1.10

Documentation/STAC_README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# To Compile the STAC Sketch...
2+
3+
Make sure the `STACLib` folder is located in the same folder as the `STAC.ino` file.

Documentation/Using screen for STAC Information.md

+49-20
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,31 @@ In the Terminal window, you should see the STAC startup information.
2323
Something like:
2424

2525
```
26-
=======================================
26+
=========================================
2727
STAC
2828
A Smart Tally ATOM Matrix Client
2929
by: Team STAC
30-
https://github.com/Xylopyrographer/STAC
30+
https://github.com/Xylopyrographer/STAC
31+
32+
Version: 2.0 (53cb81)
33+
Core: 2.0.4
34+
SDK: v4.4.1-472-gc9140caf8c
35+
MAC: 24:A1:60:46:06:3C
3136
32-
Software Version: 2.0
33-
Configuration SSID: STAC-78B5927E
34-
Configuration IP: 192.168.6.14
35-
-------------------------------
37+
Configuration SSID: STAC-3C064660
38+
Configuration IP: 192.168.6.14
39+
-------------------------------
3640
WiFi Network SSID: StreamNet
37-
Smart Tally IP: 192.168.1.13
41+
Smart Tally IP: 192.168.22.31
3842
Port #: 80
3943
Max Tally Channel: 8
40-
Polling Interval: 300 ms
41-
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
42-
Auto start: Disabled
44+
Polling Interval: 299 ms
45+
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
46+
Auto start: Enabled
4347
Operating Mode: Camera Operator
44-
Active Tally Channel: 5
48+
Active Tally Channel: 2
4549
Brightness Level: 1
46-
======================================
50+
=========================================
4751
```
4852
Items above the "`=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=`" line are set when configuring the STAC via a web browser. Items below that line are set using the STAC display button.
4953

@@ -56,16 +60,19 @@ If it is operating in Peripheral Mode, it'll send that info out, something like.
5660
STAC
5761
A Smart Tally ATOM Matrix Client
5862
by: Team STAC
59-
https://github.com/Xylopyrographer/STAC
63+
https://github.com/Xylopyrographer/STAC
6064
61-
Software Version: 2.0
62-
Configuration SSID: STAC-78B5927E
63-
Configuration IP: 192.168.6.14
64-
-------------------------------
65-
OPERATING IN PERIPHERAL MODE
65+
Version: 2.0 (53cb81)
66+
Core: 2.0.4
67+
SDK: v4.4.1-472-gc9140caf8c
68+
MAC: 24:A1:60:46:06:3C
69+
70+
Configuration SSID: STAC-3C064660
71+
Configuration IP: 192.168.6.14
72+
--------------------------------
73+
OPERATING IN PERIPHERAL MODE
6674
Brightness Level: 1
6775
=======================================
68-
6976
```
7077
In Peripheral Mode, only the display brightness level can be set, using the display button.
7178

@@ -92,4 +99,26 @@ Computers are fussy that way.
9299

93100
The `screen` app is also available on most *nix distributions. The serial communications port descriptor is different, but once you discover that, use it on the command line and things should function as described above.
94101

95-
Windows systems have a number of options for serial communications programs. Consult the documentation for the connection syntax. The STAC only communicates at 115200 baud.
102+
Windows systems have a number of options for serial communications programs. Consult the documentation for the connection syntax. The STAC only communicates at 115200 baud.
103+
104+
### Geek Info
105+
106+
If you're curious, part of the info dump looks like:
107+
108+
```
109+
Version: 2.0 (53cb81)
110+
Core: 2.0.4
111+
SDK: v4.4.1-472-gc9140caf8c
112+
MAC: 24:A1:60:46:06:3C
113+
```
114+
Here:
115+
116+
`Version` is the version number of the STAC software. The characters in brackets are the "build number" of this version.
117+
118+
`Core` is the arduino-esp32 core version used by the STAC software version.
119+
120+
`SDK` is the espressif ESP-IDF software development kit version used by the arduino-esp32 core.
121+
122+
`MAC` is the network interface MAC address.
123+
124+
Useful info if you're interested in tweaking the STAC software. File it in the trivia bucket otherwise.

Documentation/manual/STAC Users Guide.md

+23-2
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,27 @@ The SSID and Password fields stop accepting input after their limits are reached
177177

178178
Taping the "Reset" button on the browser form will clear all information entered and set the port number, number of channels and the polling interval to their defaults, leaving the form open.
179179

180-
At the bottom of the form, the version number of the STAC software is shown as a bit of trivia.
180+
At the bottom of the form some info about the STAC is shown as a bit of trivia.
181+
182+
Unit ID is the unique identifier for this STAC. It is SSID of the STAC when being configured and the label you'd see in the WiFi router client table for this STAC when it is operating.
183+
184+
Version is the version number of the STAC software. The characters in brackets are the "build number" of this version.
185+
186+
Core is the arduino-esp32 core version used by the STAC software version.
187+
188+
SDK is the espressif ESP-IDF software development kit version used by the arduino-esp32 core.
189+
190+
MAC is the network interface MAC address. Skip ahead a couple of paragraphs for why you might need that.
191+
192+
Totally geeky stuff but that's where it is if we ask for it if you contact us with a question.
193+
194+
One last point regarding the WiFi network. Configuring the STAC with a static IP address is not supported. Therefore, when the STAC negotiates a connection to the specified network, the network must supply an IP address via DHCP. If a static STAC IP address is desired, the STAC MAC can be used to assign the IP from the router. The MAC address of the STAC can be found:
195+
196+
* via the WiFi router client table after the STAC has an address assigned from the DHCP pool;
197+
* on the web configuration form;
198+
* from the STAC startup serial data information dump (refer to the *Using screen for STAC Information* document).
199+
200+
Egads. That was a lot of jargon. Find a friend that knows networks if you need a hand with this.
181201

182202
**Some advice:** If you are configuring multiple STACs in one go, it is quite important to close the Confirmation browser window each time before moving onto the next one. Using a desktop or laptop computer and browser is recommend. Some browsers, notably the mobile variety, get hung up when connecting to the IP address of the STAC (as each one is the same) even though the STAC and its WiFi SSID are unique.
183203
<br><br>
@@ -766,8 +786,9 @@ No warranties are given. The license may not give you all of the permissions nec
766786
### Revision History
767787
<br>
768788

769-
**2022-07-02**<br>
789+
**2022-08-09**<br>
770790
&nbsp;&nbsp;&nbsp;&nbsp;- Revise for STAC software version 2.0.<br>
791+
&nbsp;&nbsp;&nbsp;&nbsp;- Add note about IP addressing under *First Time Configuration*.<br>
771792
&nbsp;&nbsp;&nbsp;&nbsp;- Add "Orange X" error description section.<br>
772793
&nbsp;&nbsp;&nbsp;&nbsp;- Add "Polling Interval" configuration option.<br>
773794
&nbsp;&nbsp;&nbsp;&nbsp;- Revise configuration screen images.
-7.49 KB
Binary file not shown.
-11.9 KB
Loading
-1.43 KB
Loading
Binary file not shown.

0 commit comments

Comments
 (0)