Compile ไม่ผ่านคับขึ้น Error compiling for board NodeMCU 1.0 (ESP-12E Module)

พึ่งจะเคยศึกษากับแอปBlynkครั้งแรกคับCodeมาจาก Exampleในไลบารี่คับ

    **Eror messages**
    Arduino: 1.8.5 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 9600, 4M (3M SPIFFS)"

    In file included from C:\Users\User\AppData\Local\Temp\arduino_modified_sketch_316638\ESP8266_Standalone.ino:37:0:

    C:\Users\User\Documents\Arduino\libraries\blynk-library-master\src/BlynkSimpleEsp8266.h:18:21: fatal error: version.h: No such file or directory

     #include <version.h>

                         ^

    compilation terminated.

    exit status 1
    Error compiling for board NodeMCU 1.0 (ESP-12E Module).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
1 Likes

ยังไม่ได้ใส่ auth เลยครับ ใช่ บอร์ดรุ่นไหนถ่ายมาให้ดูด้วยครับ

ใส่authแล้วก็เหมือนเดิมคับ บอร์ด:inex netpie v.2 (AX-WiFi)

1 Likes

ลองเลือกบอร์ดนี้ครับ

อ่านลิ้งค์นี้ครับ อาจเป็นเคสคล้ายๆ กัน

อ่านไม่เข้าใจเลยคับ ผมต้องการแค่เชื่อมต่อ เพื่อสั่งงานรีเลย์และส่งค่าจากเซนเซอร์ความชื้นในดินเท่านั้นคับต้องเพิ่มโค้ดอะไรบ้างคับ

เอาโค้ตมาดูครับ

#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
const int analogInPin = A0;
const int relay = 2;
int sensorValue = 0;        
int outputValue = 0;      

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "050d5c7fdd4b42dc89969f4edc3ec5cd";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "chaiphat";
char pass[] = "juris456";

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(auth, ssid, pass);
  pinMode(relay, OUTPUT);
}

void loop()
{
  Blynk.run();
  sensorValue = analogRead(analogInPin);
  outputValue = map(sensorValue, 0, 1023, 100, 0);

  Serial.print("Soil Moisture = ");
  Serial.print(outputValue);
  Serial.println(" %");

  if (outputValue <= 40) {  
    digitalWrite(relay, HIGH);
  }
  else {
    digitalWrite(relay, LOW);
  }
  delay(1000);
}

[ถ้าจะเพิ่มโค้ดส่งค่าจากเซนเซอร์ความชื้นในดินและเปิดปิดรีเลย์ทำยังไงคับ]
(ตอนนี้ก็ยังcompileไม่ผ่าน)

Arduino: 1.8.5 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)"

In file included from C:\Users\User\Documents\Arduino\ESP8266_Standalone\ESP8266_Standalone.ino:37:0:

C:\Users\User\Documents\Arduino\libraries\Blynk\src/BlynkSimpleEsp8266.h:18:21: fatal error: version.h: No such file or directory

 #include <version.h>

                     ^

compilation terminated.

exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

ผมรันผ่านน่าจะเป็นที่ Libery ไม่ครบละครับ

วิธีแก้เบื้องต้นคือเปิดตัวอย่างใน blynk มาสักอันแล้วเอาไปวาง รันดูว่าผ่านไหม เลือกตามนี้

ถ้าผมคาดไม่ผิดน่าจะต้องผ่านนะ


มันเป็นที่ผมลงไลบารี่ผิดรึปล่าวคับ

ลงแบบไหนมาครับ ขอดูลิ้งค์ที่ทำตามหน่อย

https://github.com/blynkkk/blynk-library/releases/latest

Copy file blynk มาวางเฉยๆ ใช่ไหมครับ

กดExtract มาที่Arduinoเลยคับ

1 Likes

ลบตรงนั้นออกครับ ไป install จาก arduino Ide แทน

ลบทั้งFolder librariesเลยนะคับ