0

WT8266-S1 WiFi module in my hand I want to encode this module with Ardino IDE. I have a coded program for Arduino NodeMCU 1.0. How can I convert it to the WT8266-S1 WiFi module? Do you have the WT8266-S1 WiFi module source code? Firebase connection to do the application to turn off the LED. Below is a sample code share.

#include <SoftwareSerial.h>

SoftwareSerial esp01(9,11); 

void setup()
{
  Serial.begin(9600);
  esp01.begin(9600); 

  pinMode(4,OUTPUT);   
  digitalWrite(4,LOW);

  pinMode(12,OUTPUT);
  digitalWrite(12,LOW);

  pinMode(13,OUTPUT);
  digitalWrite(13,LOW);

  sendData("AT+RST\r\n",2000); 
  sendData("AT+CWMODE=2\r\n",1000); 
  sendData("AT+CIFSR\r\n",1000); 
  sendData("AT+CIPMUX=1\r\n",1000); 
  sendData("AT+CIPSERVER=1,80\r\n",1000); 
}

void loop()
{
  if(esp01.available()) 
  {
    if(esp01.find("+IPD,"))
    {
     delay(1000); 

     // odczytanie ID połączenia
     int connectionId = esp01.read()-48; 

     esp01.find("pin="); 

     int pinNumber = (esp01.read()-48)*10; 
     pinNumber += (esp01.read()-48); 
     digitalWrite(pinNumber, !digitalRead(pinNumber)); 
      String closeCommand = "AT+CIPCLOSE="; 
     closeCommand+=connectionId; 
     closeCommand+="\r\n";

     sendData(closeCommand,1000); 
    }
  }
}

String sendData(String command, const int timeout)
{
    String response = "";

    esp01.print(command); 

    long int time = millis();

    while( (time+timeout) > millis())
    {
      while(esp01.available()) 
      {
        char c = esp01.read(); 
        response += c;
      }  
    } 
    Serial.print(response);
    return response;
}

Warning: espcomm_sync failed when I install this thread error: espcomm_open failed error: espcomm_upload_mem failed error: espcomm_upload_mem failed getting the error

  • what did you try? – Juraj Apr 10 at 14:11
  • I shared a sample code on the subject. – SH Yazılım Geliştirme Apr 10 at 14:34
  • this a sketch for an MCU with external esp8266 module with AT firmware wired to Serial interface. you try to upload it to the esp8266? – Juraj Apr 10 at 15:52
  • Is it possible that I want to load code into module WT8266? I wrote code for NodeMCU 1.0 and I want to edit it for the wt8266 module. @Juraj – SH Yazılım Geliştirme Apr 10 at 20:13
  • Can I write code for wt8266 as same as esp8266? Is this possible? @Juraj – SH Yazılım Geliştirme Apr 10 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.