Skip to content

Commit

Permalink
Merge pull request #85 from Qrome/2.7
Browse files Browse the repository at this point in the history
2.7
  • Loading branch information
Qrome authored Feb 19, 2019
2 parents 289100d + c8963da commit 23955b9
Show file tree
Hide file tree
Showing 101 changed files with 8,087 additions and 1,780 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ It is recommended to use Arduino IDE. You will need to configure Arduino IDE to
Use the Arduino guide for details on how to installing and manage libraries https://www.arduino.cc/en/Guide/Libraries
**Packages** -- the following packages and libraries are used (download and install):
<ESP8266WiFi.h>
<ArduinoJson.h> --> https://github.com/bblanchon/ArduinoJson (version 5.13.X)
<ESP8266WebServer.h>
<WiFiManager.h> --> https://github.com/tzapu/WiFiManager
"FS.h"
Expand All @@ -85,6 +84,8 @@ Use the Arduino guide for details on how to installing and manage libraries http
<Max72xxPanel.h> --> https://github.com/markruys/arduino-Max72xxPanel
<JsonStreamingParser.h> --> https://github.com/squix78/json-streaming-parser

Note ArduinoJson (version 5.13.1) is now included as a library file in version 2.7 and later.

## Initial Configuration
Starting with version 2.0 editing the **Settings.h** file is optional. All API Keys are now managed in the Web Interface except for the GeoNames Key. It is not required to edit the Settings.h file before loading and running the code.
* Open Weather Map API Key: http://openweathermap.org/
Expand Down
Binary file removed marquee.ino.d1_mini_2.6.bin
Binary file not shown.
Binary file added marquee.ino.d1_mini_2.7.bin
Binary file not shown.
Binary file removed marquee.ino.d1_mini_wide_2.6.bin
Binary file not shown.
Binary file added marquee.ino.d1_mini_wide_2.7.bin
Binary file not shown.
107 changes: 53 additions & 54 deletions marquee/BitcoinApiClient.h
Original file line number Diff line number Diff line change
@@ -1,55 +1,54 @@
/** The MIT License (MIT)
Copyright (c) 2018 David Payne
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

#pragma once
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <ArduinoJson.h>

class BitcoinApiClient {

private:

String myCurrency = "";

const char* servername = "api.coindesk.com"; // remote server we will connect to https://www.coindesk.com/api/

typedef struct {
String code;
String rate;
String description;
float rate_float;
} bpi;

bpi bpiData;

public:
BitcoinApiClient();
void updateBitcoinData(String currencyCode);

String getCode();
String getRate();
String getDescription();
float getRateFloat();
};
/** The MIT License (MIT)
Copyright (c) 2018 David Payne
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

#pragma once
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include "libs/ArduinoJson/ArduinoJson.h"

class BitcoinApiClient {

private:

String myCurrency = "";

const char* servername = "api.coindesk.com"; // remote server we will connect to https://www.coindesk.com/api/

typedef struct {
String code;
String rate;
String description;
float rate_float;
} bpi;

bpi bpiData;

public:
BitcoinApiClient();
void updateBitcoinData(String currencyCode);

String getCode();
String getRate();
String getDescription();
float getRateFloat();
};
107 changes: 53 additions & 54 deletions marquee/GeoNamesClient.h
Original file line number Diff line number Diff line change
@@ -1,55 +1,54 @@
/** The MIT License (MIT)
Copyright (c) 2018 David Payne
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

#pragma once
#include <ESP8266WiFi.h>
#include <ArduinoJson.h>

class GeoNamesClient {

private:
String myLat = "";
String myLon = "";
String myUserName = "";
boolean isDst = true; // Daylight Savings Time

int hours = 0;
int minutes = 0;
String datetime = "";

const char* servername = "api.geonames.org"; // remote server we will connect to

public:
GeoNamesClient(String UserName, String lat, String lon, boolean useDst);
void updateClient(String UserName, String lat, String lon, boolean useDst);
float getTimeOffset();
String getHours();
String getMinutes();
String getYear();
String getMonth00();
String getMonth(boolean zeroPad);
String getMonthName();
String getDay00();
String getDay(boolean zeroPad);
};
/** The MIT License (MIT)
Copyright (c) 2018 David Payne
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

#pragma once
#include <ESP8266WiFi.h>
#include "libs/ArduinoJson/ArduinoJson.h"

class GeoNamesClient {

private:
String myLat = "";
String myLon = "";
String myUserName = "";
boolean isDst = true; // Daylight Savings Time

int hours = 0;
int minutes = 0;
String datetime = "";

const char* servername = "api.geonames.org"; // remote server we will connect to

public:
GeoNamesClient(String UserName, String lat, String lon, boolean useDst);
void updateClient(String UserName, String lat, String lon, boolean useDst);
float getTimeOffset();
String getHours();
String getMinutes();
String getYear();
String getMonth00();
String getMonth(boolean zeroPad);
String getMonthName();
String getDay00();
String getDay(boolean zeroPad);
};
153 changes: 76 additions & 77 deletions marquee/OctoPrintClient.h
Original file line number Diff line number Diff line change
@@ -1,78 +1,77 @@
/** The MIT License (MIT)
Copyright (c) 2018 David Payne
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

#pragma once
#include <ESP8266WiFi.h>
#include <ArduinoJson.h>
#include <base64.h>

class OctoPrintClient {

private:
char myServer[100];
int myPort = 80;
String myApiKey = "";
String encodedAuth = "";

void resetPrintData();
boolean validate();

String result;

typedef struct {
String averagePrintTime;
String estimatedPrintTime;
String fileName;
String fileSize;
String lastPrintTime;
String progressCompletion;
String progressFilepos;
String progressPrintTime;
String progressPrintTimeLeft;
String state;
String error;
} PrinterStruct;

PrinterStruct printerData;


public:
OctoPrintClient(String ApiKey, String server, int port, String user, String pass);
void getPrinterJobResults();
void updateOctoPrintClient(String ApiKey, String server, int port, String user, String pass);

String getAveragePrintTime();
String getEstimatedPrintTime();
String getFileName();
String getFileSize();
String getLastPrintTime();
String getProgressCompletion();
String getProgressFilepos();
String getProgressPrintTime();
String getProgressPrintTimeLeft();
String getState();
boolean isPrinting();
boolean isOperational();
String getError();
};
/** The MIT License (MIT)
Copyright (c) 2018 David Payne
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

#pragma once
#include <ESP8266WiFi.h>
#include "libs/ArduinoJson/ArduinoJson.h"
#include <base64.h>

class OctoPrintClient {

private:
char myServer[100];
int myPort = 80;
String myApiKey = "";
String encodedAuth = "";

void resetPrintData();
boolean validate();

String result;

typedef struct {
String averagePrintTime;
String estimatedPrintTime;
String fileName;
String fileSize;
String lastPrintTime;
String progressCompletion;
String progressFilepos;
String progressPrintTime;
String progressPrintTimeLeft;
String state;
String error;
} PrinterStruct;

PrinterStruct printerData;


public:
OctoPrintClient(String ApiKey, String server, int port, String user, String pass);
void getPrinterJobResults();
void updateOctoPrintClient(String ApiKey, String server, int port, String user, String pass);

String getAveragePrintTime();
String getEstimatedPrintTime();
String getFileName();
String getFileSize();
String getLastPrintTime();
String getProgressCompletion();
String getProgressFilepos();
String getProgressPrintTime();
String getProgressPrintTimeLeft();
String getState();
boolean isPrinting();
boolean isOperational();
String getError();
};
Loading

0 comments on commit 23955b9

Please sign in to comment.