test
This commit is contained in:
@@ -12,4 +12,4 @@
|
|||||||
platform = espressif8266
|
platform = espressif8266
|
||||||
board = esp12e
|
board = esp12e
|
||||||
framework = arduino
|
framework = arduino
|
||||||
board_build.ldscript = eagle.flash.2m.ld
|
;board_build.ldscript = eagle.flash.2m.ld
|
||||||
@@ -41,7 +41,7 @@ WiFiEventHandler wifiConnectHandler;
|
|||||||
WiFiEventHandler wifiDisconnectHandler;
|
WiFiEventHandler wifiDisconnectHandler;
|
||||||
Ticker wifiReconnectTimer;
|
Ticker wifiReconnectTimer;
|
||||||
|
|
||||||
SoftwareSerial softSer;
|
SoftwareSerial softSer(D7, D8);
|
||||||
|
|
||||||
void connectToWifi();
|
void connectToWifi();
|
||||||
void connectToMqtt();
|
void connectToMqtt();
|
||||||
@@ -57,7 +57,9 @@ void writeHex(std::string data);
|
|||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
softSer.begin(9600, SWSERIAL_8N1, D5, D6, false);
|
pinMode(D7, INPUT);
|
||||||
|
pinMode(D8, OUTPUT);
|
||||||
|
softSer.begin(9600);//, SWSERIAL_8N1, D5, D6, false);
|
||||||
WiFi.mode(WIFI_STA);
|
WiFi.mode(WIFI_STA);
|
||||||
WiFi.hostname("Cur-MidRoom");
|
WiFi.hostname("Cur-MidRoom");
|
||||||
|
|
||||||
@@ -118,7 +120,7 @@ void loop(){
|
|||||||
while(softSer.available()){
|
while(softSer.available()){
|
||||||
in_b = softSer.read();
|
in_b = softSer.read();
|
||||||
Serial.print(in_b, 16);
|
Serial.print(in_b, 16);
|
||||||
readByte(in_b);
|
//readByte(in_b);
|
||||||
}
|
}
|
||||||
if(cRun + 999 < millis()){
|
if(cRun + 999 < millis()){
|
||||||
cRun = millis();
|
cRun = millis();
|
||||||
@@ -137,7 +139,7 @@ void connectToWifi() {
|
|||||||
|
|
||||||
void connectToMqtt() {
|
void connectToMqtt() {
|
||||||
Serial.println("Connecting to MQTT...");
|
Serial.println("Connecting to MQTT...");
|
||||||
mqttClient.connect();
|
//mqttClient.connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
void onWifiConnect(const WiFiEventStationModeGotIP& event) {
|
void onWifiConnect(const WiFiEventStationModeGotIP& event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user