Skip to content

Commit

Permalink
🚀 Added Static IP Template; 🚀 Stream and Recording indicators; 🧽 Clea…
Browse files Browse the repository at this point in the history
…ned up some log lines
  • Loading branch information
guido-visser committed Feb 24, 2021
1 parent 82e992f commit 0de8b91
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 6 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

- 🚀 Press on M5 button will toggle between 4 screens:
1. The actual status of the tally (a tally status change will default back to this screen)
2. Network screen, showing the current IP Address so you can access the Web UI
2. Network screen, showing the current IP Address so you can access the Web UI (+ a wifi strength indicator)
3. Show the actual tally input number that is set for the unit
4. The brightness screen. You can use BTN39 on this screen to toggle through the 9 different settings
- 🚀 Webserver for easy configuration
Expand All @@ -24,6 +24,7 @@
- 🚀 Set an interval to automatically reconnect to vMix after the interval has passed
- 🚀 Option to just show the LIVE state and ignore the PRE and SAFE states
- 🚀 Option to show the tally number instead of the SAFE, PRE and LIVE texts
- 🚀 Indicators for Streaming (STM) and Recording (REC)

---

Expand Down Expand Up @@ -152,15 +153,27 @@ NOTE: Obviously, the battery will drain faster when the brightness is set to a h
**Just Live**

`true`: The stick only lights up when the configured input(s) is/are live.

`false`: The stick shows when the configured input(s) is/are safe, are in preview or when it is live.

**Mode**

`Text (SAFE, PRE, LIVE)`: Show the textual representation of the status of the configured input(s).

`Tally Number`: Show the configured main tally number and only update the background color when the status changes.

---

## Static IP Address

**WARNING**: This is only for users that know what they're doing. If you are not familiar with ip addresses, gateways or subnets, stay away.

It is possible to have a static IP Address, however it's not possible (yet) to do this via the Web UI. You need to hard-code this. A template is provided, but you'll have to change some code:

- Open `e_WIFI.ino`
- Remove the lines that have `REMOVE THIS LINE WHEN YOU NEED STATIC IP` in them (be sure to also remove the comment markers `/*` and `*/`)
- Change the settings after the `IPAddress` lines that meet your needs in your environment.

## Plugins

Officially supported plugin:
Expand Down
2 changes: 1 addition & 1 deletion src/a_GLOBAL/b_SETTINGS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void loadSettings()
M_TALLY = preferences.getString("m_tally");
}

Serial.println("BRIGHTNESS THINGY");
Serial.println("BRIGHTNESS");
Serial.println(preferences.getUInt("bright"));

if(preferences.getUInt("bright")){
Expand Down
54 changes: 51 additions & 3 deletions src/a_GLOBAL/d_VMIX.ino
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
bool stm = 0;
bool rec = 0;

// Connect to vMix instance
boolean connectTovMix(bool recursive)
{
Expand All @@ -12,6 +15,7 @@ boolean connectTovMix(bool recursive)

// Subscribe to the tally events
client.println("SUBSCRIBE TALLY");
client.println("SUBSCRIBE ACTS");
showTallyScreen();
return true;
}
Expand Down Expand Up @@ -204,8 +208,19 @@ void handleData(String data)
}
else
{
Serial.print("Response from vMix: ");
Serial.println(data);
if(data.indexOf("ACTS OK Recording 1") == 0){
rec = 1;
} else if(data.indexOf("ACTS OK Recording 0") == 0){
rec = 0;
} else if(data.indexOf("ACTS OK Streaming 1") == 0) {
stm = 1;
} else if(data.indexOf("ACTS OK Streaming 0") == 0){
stm = 0;
} else {
Serial.print("Response from vMix: ");
Serial.println(data);
}
showStatus();
}
}

Expand All @@ -231,7 +246,7 @@ void showTallyScreen() {
break;
default:
setTallyOff();
}
}
} else {
switch (currentState)
{
Expand All @@ -244,6 +259,39 @@ void showTallyScreen() {
}

renderBatteryLevel();
showStatus();
}

void showStatus(){
if(C_PLUS){
M5.Lcd.setCursor(10,10);
M5.Lcd.setTextSize(2);
} else {
M5.Lcd.setCursor(10,0);
M5.Lcd.setTextSize(1);
}

if(screenRotation == 1 || screenRotation == 3){
M5.Lcd.setCursor(140,0);
} else {
M5.Lcd.setCursor(60,150);
}
if(rec){
M5.Lcd.print("REC");
} else {
M5.Lcd.print(" ");
}

if(screenRotation == 1 || screenRotation == 3){
M5.Lcd.setCursor(110,0);
} else {
M5.Lcd.setCursor(0,150);
}
if(stm){
M5.Lcd.print("STM");
} else {
M5.Lcd.print(" ");
}
}

void noConnectionTovMix(){
Expand Down
15 changes: 14 additions & 1 deletion src/a_GLOBAL/e_WIFI.ino
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
void startWiFi()
{
Serial.println("STARTING WIFI THINGY");
Serial.println("STARTING WIFI");
WiFi.mode(WIFI_STA);
WiFi.begin(&(WIFI_SSID[0]), &(WIFI_PASS[0]));

// We start by connecting to a WiFi network
/* REMOVE THIS LINE WHEN YOU NEED STATIC IP
// Set your Static IP address
IPAddress local_IP(192, 168, 178, 222);
IPAddress gateway(192, 168, 178, 222);
IPAddress subnet(255, 255, 255, 0);
IPAddress primaryDNS(8, 8, 8, 8); // optional
IPAddress secondaryDNS(8, 8, 4, 4); // optional
// Configures static IP address
if (!WiFi.config(local_IP, gateway, subnet, primaryDNS, secondaryDNS)) {
Serial.println("STA Failed to configure");
}
REMOVE THIS LINE WHEN YOU NEED STATIC IP */

//WiFi.begin(&(WIFI_SSID[0]), &(WIFI_PASS[0]));
//WiFi.softAP(ssid, password);
Expand Down
4 changes: 4 additions & 0 deletions src/a_GLOBAL/plugins/Plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

There are 2 HATs that already work with the provided `LED_HEX.h` plugin. To make use of this plugin, remove the comment marks `//` from the lines in `k_PLUGINMANAGER.h`.

#### Prerequisites

You need the FastLED Library and is included in the `libs` folder. Please make sure that the library is found in: `%userprofile%\Documents\Arduino\libraries`

##### HEX HAT

You don't have to change the `LED_HEX.h` file. 🎉
Expand Down

0 comments on commit 0de8b91

Please sign in to comment.