1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-27 01:56:14 +01:00

Revert "Merge branch 'thingietest'"

This reverts commit 79f552ab5f, reversing
changes made to 7af5effba9.
This commit is contained in:
Asbelos 2020-07-25 14:40:59 +01:00
parent 79f552ab5f
commit 95a5f7b9a4
2 changed files with 10 additions and 22 deletions

View File

@ -92,8 +92,8 @@ void setup() {
// setup(serial, F(router name), F(password) , port) // setup(serial, F(router name), F(password) , port)
// //
#ifdef WIFI #ifdef WIFI
Serial2.begin(115200); Serial1.begin(115200);
WifiInterface::setup(Serial2, F("BTHub5-M6PT"), F("49de8d4862"),F("DCCEX"),F("CVReader"),3532); // (3532 is 0xDCC decimal... ) WifiInterface::setup(Serial1, F("BTHub5-M6PT"), F("49de8d4862"),F("DCCEX"),F("CVReader"),3532); // (3532 is 0xDCC decimal... )
#endif #endif
// This is just for demonstration purposes // This is just for demonstration purposes
@ -121,7 +121,7 @@ void loop() {
// Responsibility 3: Optionally handle any incoming WiFi traffic // Responsibility 3: Optionally handle any incoming WiFi traffic
#ifdef WIFI #ifdef WIFI
WifiInterface::loop(Serial2); WifiInterface::loop(Serial1);
#endif #endif
// Your additional code // Your additional code

View File

@ -23,7 +23,6 @@
#include "WiThrottle.h" #include "WiThrottle.h"
#include "HTTPParser.h" #include "HTTPParser.h"
const char PROGMEM READY_SEARCH[] ="\r\nready\r\n"; const char PROGMEM READY_SEARCH[] ="\r\nready\r\n";
const char PROGMEM WIFIOK_SEARCH[] ="\r\nWIFI GOT IPready\r\n";
const char PROGMEM OK_SEARCH[] ="\r\nOK\r\n"; const char PROGMEM OK_SEARCH[] ="\r\nOK\r\n";
const char PROGMEM END_DETAIL_SEARCH[] ="@ 1000"; const char PROGMEM END_DETAIL_SEARCH[] ="@ 1000";
const char PROGMEM PROMPT_SEARCH[] =">"; const char PROGMEM PROMPT_SEARCH[] =">";
@ -57,25 +56,17 @@ bool WifiInterface::setup2(Stream & wifiStream, const __FlashStringHelper* SSid,
//checkForOK(wifiStream,5000,END_DETAIL_SEARCH,true); // Show startup but ignore unreadable upto ready //checkForOK(wifiStream,5000,END_DETAIL_SEARCH,true); // Show startup but ignore unreadable upto ready
checkForOK(wifiStream,5000,READY_SEARCH,true); checkForOK(wifiStream,5000,READY_SEARCH,true);
// StringFormatter::send(wifiStream,F("AT+CWMODE=3\r\n")); // configure as server or access point StringFormatter::send(wifiStream,F("AT+CWMODE=3\r\n")); // configure as server or access point
// checkForOK(wifiStream,1000,OK_SEARCH,true); // Not always OK, sometimes "no change" checkForOK(wifiStream,1000,OK_SEARCH,true); // Not always OK, sometimes "no change"
// StringFormatter::send(wifiStream, F("AT+CWHOSTNAME=\"%S\"\r\n"), hostname); // Set Host name for Wifi Client StringFormatter::send(wifiStream, F("AT+CWHOSTNAME=\"%S\"\r\n"), hostname); // Set Host name for Wifi Client
// checkForOK(wifiStream,2000, OK_SEARCH, true); checkForOK(wifiStream,2000, OK_SEARCH, true);
// Older ES versions have AT+CWJAP, newer ones have AT+CWJAP_CUR and AT+CWHOSTNAME // Older ES versions have AT+CWJAP, newer ones have AT+CWJAP_CUR and AT+CWHOSTNAME
// StringFormatter::send(wifiStream,F("AT+CWJAP=\"%S\",\"%S\"\r\n"),SSid,password); StringFormatter::send(wifiStream,F("AT+CWJAP=\"%S\",\"%S\"\r\n"),SSid,password);
// if (!checkForOK(wifiStream,20000,OK_SEARCH,true)) {
// StringFormatter::send(wifiStream,F("AT+CWJAP_CUR=\"%S\",\"%S\"\r\n"),SSid,password);
// if (!checkForOK(wifiStream,20000,OK_SEARCH,true)) return false;
// }
checkForOK(wifiStream,5000,WIFIOK_SEARCH,true);
StringFormatter::send(wifiStream,F("AT+CWJAP?\r\n"),SSid,password);
if (!checkForOK(wifiStream,20000,OK_SEARCH,true)) { if (!checkForOK(wifiStream,20000,OK_SEARCH,true)) {
StringFormatter::send(wifiStream,F("AT+CWJAP_CUR?\r\n"),SSid,password); StringFormatter::send(wifiStream,F("AT+CWJAP_CUR=\"%S\",\"%S\"\r\n"),SSid,password);
if (!checkForOK(wifiStream,20000,OK_SEARCH,true)) return false; if (!checkForOK(wifiStream,20000,OK_SEARCH,true)) return false;
} }
@ -89,9 +80,6 @@ bool WifiInterface::setup2(Stream & wifiStream, const __FlashStringHelper* SSid,
StringFormatter::send(wifiStream,F("AT+CIPSERVER=1,%d\r\n"),port); // turn on server on port 80 StringFormatter::send(wifiStream,F("AT+CIPSERVER=1,%d\r\n"),port); // turn on server on port 80
if (!checkForOK(wifiStream,10000,OK_SEARCH,true)) return false; if (!checkForOK(wifiStream,10000,OK_SEARCH,true)) return false;
StringFormatter::send(wifiStream,F("AT+CIPRECVMODE=0\r\n"),port); // turn on server on port 80
if (!checkForOK(wifiStream,10000,OK_SEARCH,true)) return false;
// StringFormatter::send(wifiStream, F("AT+MDNS=1,\"%S.local\",\"%S.local\",%d\r\n"), hostname, servername, port); // Setup mDNS for Server // StringFormatter::send(wifiStream, F("AT+MDNS=1,\"%S.local\",\"%S.local\",%d\r\n"), hostname, servername, port); // Setup mDNS for Server
// if (!checkForOK(wifiStream,5000, OK_SEARCH, true)) return false; // if (!checkForOK(wifiStream,5000, OK_SEARCH, true)) return false;
(void)servername; // not currently in use (void)servername; // not currently in use