ESP8266_AT_Instruction_Set_v0_22.pdf
1.01MB
at_cmd1.ino
0.00MB

/*
--------------------------------------------------
아두이노 우노 핀    ESP8266 Serial WIFI 모듈  핀
  3.3V              VCC, CH_PD
 D0(TX)             RX (레벨쉬프트 사용)
 D1(RX)             TX
 GND                GND
 ------------------------------------------------
시리얼 모니터 115200bps 설정, Toth NL & CR 설정 후 아래 명령 실행
AT+RST                       //restart
AT+UART_DEF=9600,8,1,0,0    
시리얼 모니터 9600pbs 설정 변경후  
AT+RST              //응답 확인
*/

void setup() {
  // put your setup code here, to run once:
//  Serial.begin(9600) ;
//  Serial.println("AT CMD TEST 1");
}

void loop() {
  // put your main code here, to run repeatedly:

}

처음에 설정해주고 그다음부턴 9600 보드레이트 들어가면된다

처음에는 아마도 115200 일것이다

 

 

 

 

at_cmd2.ino
0.00MB

 

/*
--------------------------------------------------
아두이노 우노 핀    ESP8266 Serial WIFI 모듈  핀
  3.3V              VCC, CH_PD
 D7(TX)             RX (레벨쉬프트 사용)
 D6(RX)             TX
 GND                GND
 ------------------------------------------------
//시리얼 모니터 115200 설정, Both NL & CR 설정 후 아래 명령 실행
AT+RST    ==>  응답확인 : 핀 연결 및 모듈 테스트 
*/

SoftwareSerial wifi(6, 7) ;  // RX, TX
void setup() {
  // put your setup code here, to run once:
  wifi.begin(9600) ;
  Serial.begin(115200) ;
//  Serial.println("AT CMD TEST 2");
}



void loop() {
  // put your main code here, to run repeatedly:
  if (Serial.available()) wifi.write(Serial.read()) ;
  if (wifi.available()) Serial.write(wifi.read()) ;
}

 보드레이트는 115200 으로 하면 된다

 

 

그리고 디지털  0 에 있던걸 7 에 1 에 있던걸 6에 꽃아줘야한다!!!!!!!!!!!!!!!

 

 

받으면

WebClient 예제를 만들어주고

와이파이만 바꿔주자

 

오오오ㅗ오오오

오옹오오오오오오오!!!!!

됫어

wifi_client.ino
0.00MB

/*
 WiFiEsp test: ClientTest
http://www.kccistc.net/
작성일 : 2019.12.17 
작성자 : IoT 임베디드 KSH
*/
#define DEBUG_WIFI
#define AP_SSID "smartmes"
#define AP_PASS "smartmes0"
#define SERVER_NAME "192.168.0.31"
#define SERVER_PORT 5000   

#define WIFITX 9  //9:TX -->ESP8266 RX
#define WIFIRX 10 //10:RX-->ESP8266 TX
           
#include "WiFiEsp.h"
#include "SoftwareSerial.h"

SoftwareSerial wifiSerial(WIFIRX, WIFITX); 
WiFiEspClient client;
 
void setup() {
  // put your setup code here, to run once:
    Serial.begin(115200); //DEBUG
    wifi_Setup();
}

void loop() {
  // put your main code here, to run repeatedly:
  while (client.available()) {
    char c = client.read();
    Serial.write(c);
  }
}
void wifi_Setup() {
  wifiSerial.begin(9600);
  wifi_Init();
  server_Connect();
}
void wifi_Init()
{
  do {
    WiFi.init(&wifiSerial);
    if (WiFi.status() == WL_NO_SHIELD) {
#ifdef DEBUG_WIFI    
      Serial.println("WiFi shield not present");
#endif 
    }
    else
      break;   
  }while(1);

#ifdef DEBUG_WIFI    
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(AP_SSID);
#endif     
    while(WiFi.begin(AP_SSID, AP_PASS) != WL_CONNECTED) {   
#ifdef DEBUG_WIFI  
      Serial.print("Attempting to connect to WPA SSID: ");
      Serial.println(AP_SSID);   
#endif   
    }
#ifdef DEBUG_WIFI      
  Serial.println("You're connected to the network");    
  printWifiStatus();
#endif 
}
int server_Connect()
{
#ifdef DEBUG_WIFI     
  Serial.println("Starting connection to server...");
#endif  

  if (client.connect(SERVER_NAME, SERVER_PORT)) {
#ifdef DEBUG_WIFI     
    Serial.println("Connected to server");
#endif   
  }
  else
  {
#ifdef DEBUG_WIFI      
     Serial.println("server connection failure");
#endif    
  } 
}
void printWifiStatus()
{
  // print the SSID of the network you're attached to
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print the received signal strength
  long rssi = WiFi.RSSI();
  Serial.print("Signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}

J1C.exe
3.04MB

이건 서버 한번만들어주자

저거 해서 포트 만들어주고

내컴터 주소 처주고

열어주고

시작하면

음 잘감 ㅋㅋ

 

받는것도 해보자

  while (Serial.available()) {    //available 수신 값이 있어야 시작한다 아니면 실행 안함
    char c = Serial.read();
    client.write(c);
  }

ㅊ추가하면 보내기도 된다

블로그 이미지

Or71nH

,