정보나눔

오픈소스하드웨어 프로젝트에 대한 다양한 정보를 나누는 공간입니다.

error: espcomm_open failed // error: espcomm_upload_mem failed 오류를 모르겠습니다.
hcy333333333 | 2019-09-18
 

1. 프로젝트 사용한 보드 종류

   아두이노 UNO

 

 

2. 사용한 개발 프로그램명

  아두이노 IDE

 

 

3. 사용한 센서 모델명

  ESP8266, neo-6m

 

 

4. 연결한 회로 설명 (또는 이미지)

 

 

5. 소스코드 (주석 필수)

 

#include <TinyGPS++.h>
#include <SoftwareSerial.h>
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
 
static const int RXPin = 4, TXPin = 5;   // GPIO 4=D2(conneect Tx of GPS) and GPIO 5=D1(Connect Rx of GPS)
static const uint32_t GPSBaud = 9600; //if Baud rate 9600 didn't work in your case then use 4800
 
TinyGPSPlus gps; // The TinyGPS++ object
WidgetMap myMap(V0);  // V0 for virtual pin of Map Widget
 
SoftwareSerial ss(RXPin, TXPin);  // The serial connection to the GPS device
 
BlynkTimer timer;
 
float spd;       //Variable  to store the speed
float sats;      //Variable to store no. of satellites response
String bearing;  //Variable to store orientation or direction of GPS
 
char auth[] = "NTEJT1fa-eOd8ub9VF0I6mYk1rHyIKGj";              //Your Project authentication key
char ssid[] = "Android7104";              // Name of your network (HotSpot or Router name)
char pass[] = "12345678";              // Corresponding Password
 
 
 
 
//unsigned int move_index;         // moving index, to be used later
unsigned int move_index = 1;       // fixed location for now
  
 
void setup()
{
  Serial.begin(115200);
  Serial.println();
  ss.begin(GPSBaud);
  Blynk.begin(auth, ssid, pass);
  timer.setInterval(5000L, checkGPS); // every 5s check if GPS is connected, only really needs to be done once
}
 
void checkGPS(){
  if (gps.charsProcessed() < 10)
  {
    Serial.println(F("No GPS detected: check wiring."));
      Blynk.virtualWrite(V4, "GPS ERROR");  // Value Display widget  on V4 if GPS not detected
  }
}
 
void loop()
{
 
    while (ss.available() > 0) 
    {
      // sketch displays information every time a new sentence is correctly encoded.
      if (gps.encode(ss.read()))
        displayInfo();
  }
  Blynk.run();
  timer.run();
}
 
void displayInfo()

 
  if (gps.location.isValid() ) 
  {
    
    float latitude = (gps.location.lat());     //Storing the Lat. and Lon. 
    float longitude = (gps.location.lng()); 
    
    Serial.print("LAT:  ");
    Serial.println(latitude, 6);  // float to x decimal places
    Serial.print("LONG: ");
    Serial.println(longitude, 6);
    Blynk.virtualWrite(V1, String(latitude, 6));   
    Blynk.virtualWrite(V2, String(longitude, 6));  
    myMap.location(move_index, latitude, longitude, "GPS_Location");
    spd = gps.speed.kmph();               //get speed
       Blynk.virtualWrite(V3, spd);
       
       sats = gps.satellites.value();    //get number of satellites
       Blynk.virtualWrite(V4, sats);
 
       bearing = TinyGPSPlus::cardinal(gps.course.value()); // get the direction
       Blynk.virtualWrite(V5, bearing);               
      
    
  }
  
 
  Serial.println();
} 

 

6. 문제점 및 에러 내용

  error: espcomm_open failed
  error: espcomm_upload_mem failed

 

프로필사진

판다마니아 2019-09-20 10:09:09

esp8266 사용할 때 플래쉬 모드로 변경 후 사용해야 하는 것 같네요.

점퍼선을 이용해서 일반 모드에서 플래쉬 모드로 변경해주시고 다시 업로드해보시면 될것 같습니다.

 

 

아래 관련 에러내용 해결방법이 있으니 참고해보세요.

 

https://arduino.stackexchange.com/questions/45133/error-espcomm-upload-mem-failed-when-uploading-a-sketch

이전글   |    라즈베리파이와 연동해서 디스플레이에 무선으로 하는 방법 알려주세요ㅠ... 2019-09-18
다음글   |    아두이노 usb 선 연결할 때는 잘 되는데 연결 안하면 안돼요.. ... 2019-09-24