Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Removal of zip dependencies #4

Merged
merged 7 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions .github/workflows/build-esp-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Unzip Arduino Libraries
run: |
mkdir ~/Arduino
mkdir ~/Arduino/libraries
unzip ./ArduinoLibraries/ESPAsyncTCP-master.zip -d ~/Arduino/libraries/
unzip ./ArduinoLibraries/ESPAsyncWebServer-master.zip -d ~/Arduino/libraries/

- name: Compile sketch
uses: arduino/compile-sketches@v1
with:
Expand All @@ -40,17 +33,19 @@ jobs:
- ./ESPMaster
libraries: |
- name: ArduinoJson
version: 7.0.1
version: 7.0.3
- name: ArduinoOTA
version: 1.0.12
- name: NTPClient
version: 3.2.1
- name: ESPAsyncWebSrv
version: 1.2.7
- name: ezTime
version: 0.8.3
- name: NTPClient
version: 3.2.1
- name: LinkedList
version: 1.3.3
- name: WiFiManager
version: 2.0.16-rc.2
version: 2.0.17
cli-compile-flags: |
- --warnings
- "none"
Binary file removed ArduinoLibraries/ESPAsyncTCP-master.zip
Binary file not shown.
Binary file removed ArduinoLibraries/ESPAsyncWebServer-master.zip
Binary file not shown.
10 changes: 10 additions & 0 deletions ESPMaster/Classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@ struct ScheduledMessage {
String Message;
long ScheduledDateTimeUnix;
};

//Used as a work around for issues that linked list has with other libraries
//Taken from here: https://github.com/vortigont/LinkedList/commit/39c2628a7794fc6e88e024d7fc82d52bc833c332
//Credit: vortigont
namespace LL {
#include <LinkedList.h>
}

template<typename T> using LNode = LL::ListNode<T>;
template<typename T> using LList = LL::LinkedList<T>;
5 changes: 2 additions & 3 deletions ESPMaster/ESPMaster.ino
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@
#include <Arduino.h>
#include <ArduinoJson.h>
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <ESPAsyncWebSrv.h>
#include <ESP8266WiFi.h>
#include <ezTime.h>
#include <LinkedList.h>
#include <NTPClient.h>
#include <WiFiUdp.h>
#include <Wire.h>
Expand Down Expand Up @@ -168,7 +167,7 @@ bool alignmentUpdated = false;
bool isPendingReboot = false;
bool isPendingWifiReset = false;
bool isPendingUnitsReset = false;
LinkedList<ScheduledMessage> scheduledMessages;
LList<ScheduledMessage> scheduledMessages;
Timezone timezone;

//Create AsyncWebServer object on port 80
Expand Down
6 changes: 3 additions & 3 deletions ESPMaster/HelpersStringHandling.ino
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int convertSpeed(String flapSpeed) {
return flapSpeedInt;
}

LinkedList<String> processSentenceToLines(String sentence) {
LList<String> processSentenceToLines(String sentence) {
SerialPrintln("Processing Sentence to lines");

//Remove trailing and preceding whitespace
Expand Down Expand Up @@ -97,7 +97,7 @@ LinkedList<String> processSentenceToLines(String sentence) {
}

// Split the string into substrings based on spaces
LinkedList<String> words;
LList<String> words;
while (sentence.length() > 0)
{
//Find the next space
Expand All @@ -118,7 +118,7 @@ LinkedList<String> processSentenceToLines(String sentence) {
}

//Now process the words into lines where possible
LinkedList<String> lines;
LList<String> lines;
String inProgressLine;
while(words.size() != 0)
{
Expand Down
2 changes: 1 addition & 1 deletion ESPMaster/ServiceFlapFunctions.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void showText(String message, int delayMillis) {
SerialPrintln("New Message: " + messageDisplay);
SerialPrintln("Alignment Updated: " + alignmentUpdatedDisplay);

LinkedList<String> messageLines = processSentenceToLines(message);
LList<String> messageLines = processSentenceToLines(message);

if (messageLines.size() > 1) {
SerialPrintln("Showing a split down message");
Expand Down
2 changes: 1 addition & 1 deletion ESPMaster/ServiceScheduledMessageFunctions.ino
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ void writeScheduledMessagesToFile() {
//Write an empty array to the schedule messages file, used in case something goes terribly wrong
void writeEmptyScheduledMessagesToFile() {
writeFile(LittleFS, scheduledMessagesPath, "[]");
}
}
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,15 @@ To upload the sketch to the ESP you need to install a few things to your arduino
- Install the ESP8266 board to your Arduino IDE. You can follow [this tutorial](https://randomnerdtutorials.com/how-to-install-esp8266-board-arduino-ide/)
- Install the arduino ESP8266 littleFS plugin to use the file system of the ESP, you can follow [this tutorial](https://randomnerdtutorials.com/install-esp8266-nodemcu-littlefs-arduino/)
- Install the following libraries via Library Manager:
- [ArduinoJSON](https://github.com/bblanchon/ArduinoJson) - Version: 7.0.1
- [ArduinoJSON](https://github.com/bblanchon/ArduinoJson) - Version: 7.0.3
- [ESPAsyncWebSrv](https://github.com/dvarrel/ESPAsyncWebSrv) - Version: 1.2.7
- Dependencies which should be installed automatically:
- [ESPAsyncTCP](https://github.com/dvarrel/ESPAsyncTCP)
- [AsyncTCP](https://github.com/dvarrel/AsyncTCP)
- [NTPClient](https://github.com/arduino-libraries/NTPClient) - Version: 3.2.1
- [ezTime](https://github.com/ropg/ezTime) - Version: 0.8.3
- [LinkedList](https://github.com/ivanseidel/LinkedList) - Version: 1.3.3
- [WiFiManager](https://github.com/tzapu/WiFiManager) - Version: 2.0.16-rc.2
- Install the following libraries via including the included `.zip` folders in the `ArduinoLibraries` in this repository in your Arduino Libraries IDE libaries folder. These will need unzipped:
- ESPAsyncWebServer
- Downloaded From: https://github.com/me-no-dev/ESPAsyncWebServer/archive/master.zip
- This library was modified to add a namespace to the `LinkedList` used within its internals to avoid conflicts with `LinkedList` library
- ESPAsyncTCP
- Downloaded From: https://github.com/me-no-dev/ESPAsyncTCP/archive/master.zip
- [WiFiManager](https://github.com/tzapu/WiFiManager) - Version: 2.0.17

To upload sketches to the ESP8266 you can either use an [Arduino Uno](https://create.arduino.cc/projecthub/pratikdesai/how-to-program-esp8266-esp-01-module-with-arduino-uno-598166) or you can buy a dedicated programmer. It is highly recommend getting a programmer as it makes uploading programs onto the ESP8266 much faster.

Expand Down
Loading