Skip to content

Commit

Permalink
Added baudrate command
Browse files Browse the repository at this point in the history
  • Loading branch information
mmiscool authored and mmiscool committed Nov 17, 2015
1 parent 724d11e commit e3d1c06
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 3 deletions.
12 changes: 12 additions & 0 deletions ESP8266Basic/Commands.ino
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,18 @@ void ExicuteTheCurrentLine()
return;
}



if (Param0 == "baudrate")
{
Serial.begin(GetMeThatVar(Param1).toInt());
return;
}





//i2c led display
if (Param0 == "oledprint")
{
Expand Down
13 changes: 10 additions & 3 deletions ESP8266Basic/ESP8266Basic.ino
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@

#include <WiFiClientSecure.h>
#include "ESP8266httpUpdate.h"
#include <time.h>

String BasicVersion = "ESP Basic 1.43";

String BasicVersion = "ESP Basic 1.44";


OneWire oneWire(5);
Expand Down Expand Up @@ -276,6 +278,9 @@ Servo Servo16;
String PinListOfStatus[16];
int PinListOfStatusValues[16];

//time Stff
int timezone = 3;
int dst = 0;



Expand Down Expand Up @@ -333,11 +338,13 @@ void setup() {

if ( server.arg("update") == "Update" )
{

// Serial.println(BasicOTAupgrade());
t_httpUpdate_return ret = ESPhttpUpdate.update("os.smbisoft.com", 80, "/4M/ESP8266Basic.cpp.bin");
//t_httpUpdate_return ret = ESPhttpUpdate.update("cdn.rawgit.com", 80, "/esp8266/Basic/master/Flasher/Build/4M/ESP8266Basic.cpp.bin");

switch (ret) {
case HTTP_UPDATE_FAILED:
case HTTP_UPDATE_FAILD:
Serial.println("HTTP_UPDATE_FAILD");
break;

Expand Down Expand Up @@ -636,7 +643,7 @@ void StartUpProgramTimer()
{
while (millis() < 30000)
{
//delay(1000);
delay(0);
//Serial.println(millis());
server.handleClient();
if (WaitForTheInterpertersResponse == 0) return;
Expand Down
14 changes: 14 additions & 0 deletions ESP8266Basic/Functions_and_var_management.ino
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ String GetMeThatVar(String VariableNameToFind)
}


if (FunctionName == "time")
{

time_t now = time(nullptr);
MyOut = String(ctime(&now));
}


if (FunctionName == "timesetup")
{
timezone = Param0.toInt();
int dst = Param1.toInt();
}



if (FunctionName == "i2c.begin")
Expand Down
40 changes: 40 additions & 0 deletions ESP8266Basic/OTA_Functions.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//const char* host = "raw.githubusercontent.com";
//const int httpsPort = 443;
//
//// Use web browser to view and copy
//// SHA1 fingerprint of the certificate
//const char* fingerprint = "B0 74 BB EF 10 C2 DD 70 89 C8 EA 58 A2 F9 E1 41 00 D3 38 82";
//
//const char* url = "/esp8266/Basic/master/Flasher/Build/4M/ESP8266Basic.cpp.bin";
//
//
//
//
//bool BasicOTAupgrade()
//{
// configTime(3 * 3600, 0, "pool.ntp.org");
//
// // Use WiFiClientSecure class to create TLS connection
// WiFiClientSecure client;
// Serial.print("connecting to ");
// Serial.println(host);
// if (!client.connect(host, httpsPort)) {
// Serial.println("connection failed");
// return 0;
// }
//
// if (client.verify(fingerprint, host)) {
// Serial.println("certificate matches");
// } else {
// Serial.println("certificate doesn't match");
// return 0;
// }
//
// Serial.print("Starting OTA from: ");
// Serial.println(url);
//
// auto ret = ESPhttpUpdate.update(client, host, url);
// // if successful, ESP will restart
// Serial.println("update failed");
// Serial.println((int) ret);
//}
1 change: 1 addition & 0 deletions ESP8266Basic/WIFI_stuff.ino
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ bool ConnectToTheWIFI(String NetworkName, String NetworkPassword, String Network
}
else
{
// configTime(3 * 3600, 0, "pool.ntp.org", "time.nist.gov");
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Expand Down
Binary file modified Flasher/Build/1M/ESP8266Basic.cpp.bin
Binary file not shown.
Binary file modified Flasher/Build/2M/ESP8266Basic.cpp.bin
Binary file not shown.
Binary file modified Flasher/Build/4M/ESP8266Basic.cpp.bin
Binary file not shown.
Binary file modified Flasher/Build/512k/ESP8266Basic.cpp.bin
Binary file not shown.
Binary file modified Flasher/ESP_Basic_Flasher.exe
Binary file not shown.

0 comments on commit e3d1c06

Please sign in to comment.