정보나눔

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

아두이노 Firebase 연동
밤빵 | 2018-09-01
 

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

 NodeMcu

 

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

 아두이노

 

 

3. 사용한 센서 모델명

 NodeMcu

 

 

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

노트북과 전원포트만 서로 연결했습니다.

 

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

  

/*
#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
#include <ArduinoJson.h>

#define FIREBASE_HOST "androidthingspark.firebaseio.com"
#define WIFI_SSID "MoAS_2.4"
#define WIFI_PASSWORD "MoAS4408"


void setup() {
  Serial.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT);

  // connect to wifi.
  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
  Serial.print("connecting");
  
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
  }
  Serial.println();
  Serial.print("connected: ");
  Serial.println(WiFi.localIP());
  
  Firebase.begin(FIREBASE_HOST);
}

void loop() {
  int Counter = 0;
  Firebase.setInt("Counter", Counter++);
  
  if (Firebase.failed()) {
      Serial.print(Counter);
      Serial.println(Counter);  
      delay(1000);
  }
 
}

 */

 

6. 문제점 및 에러 내용

 

아두이노:1.8.6 (Windows Store 1.8.14.0) (Windows 10), 보드:"NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

In file included from C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:30:0,

                 from C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22,

                 from C:\Users\alstk\AppData\Local\Temp\arduino_modified_sketch_730702\sketch_sep01e.ino:3:

C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseObject.h:109:21: error: 'StaticJsonBuffer' was not declared in this scope

     std::shared_ptr<StaticJsonBuffer<FIREBASE_JSONBUFFER_SIZE>> buffer_;

                     ^

C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseObject.h:109:21: note: suggested alternative:

In file included from C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/StaticJsonDocument.hpp:8:0,

                 from C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.hpp:10,

                 from C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.h:9,

                 from C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:26,

                 from C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22,

                 from C:\Users\alstk\AppData\Local\Temp\arduino_modified_sketch_730702\sketch_sep01e.ino:3:

C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Memory/StaticJsonBuffer.hpp:110:7: note:   'ArduinoJson::Internals::StaticJsonBuffer'

 class StaticJsonBuffer : public Internals::StaticJsonBufferBase {

       ^

In file included from C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/JsonObject.hpp:7:0,

                 from C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/DynamicJsonDocument.hpp:8,

                 from C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.hpp:9,

                 from C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.h:9,

                 from C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:26,

                 from C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22,

                 from C:\Users\alstk\AppData\Local\Temp\arduino_modified_sketch_730702\sketch_sep01e.ino:3:

C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/./JsonObjectData.hpp:17:65: error: template argument 1 is invalid

        sizeof(ArduinoJson::Internals::JsonObjectData::node_type))

                                                                 ^

C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseObject.h:28:34: note: in expansion of macro 'JSON_OBJECT_SIZE'

 #define FIREBASE_JSONBUFFER_SIZE JSON_OBJECT_SIZE(32)

                                  ^

C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseObject.h:109:38: note: in expansion of macro 'FIREBASE_JSONBUFFER_SIZE'

     std::shared_ptr<StaticJsonBuffer<FIREBASE_JSONBUFFER_SIZE>> buffer_;

                                      ^

In file included from C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:30:0,

                 from C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22,

                 from C:\Users\alstk\AppData\Local\Temp\arduino_modified_sketch_730702\sketch_sep01e.ino:3:

C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseObject.h:109:62: error: expected unqualified-id before '>' token

     std::shared_ptr<StaticJsonBuffer<FIREBASE_JSONBUFFER_SIZE>> buffer_;

                                                              ^

In file included from C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22:0,

                 from C:\Users\alstk\AppData\Local\Temp\arduino_modified_sketch_730702\sketch_sep01e.ino:3:

C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:86:19: error: 'StaticJsonBuffer' was not declared in this scope

   std::shared_ptr<StaticJsonBuffer<FIREBASE_JSONBUFFER_SIZE>> buffer_;

                   ^

C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:86:19: note: suggested alternative:

In file included from C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/StaticJsonDocument.hpp:8:0,

                 from C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.hpp:10,

                 from C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.h:9,

                 from C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:26,

                 from C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22,

                 from C:\Users\alstk\AppData\Local\Temp\arduino_modified_sketch_730702\sketch_sep01e.ino:3:

C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Memory/StaticJsonBuffer.hpp:110:7: note:   'ArduinoJson::Internals::StaticJsonBuffer'

 class StaticJsonBuffer : public Internals::StaticJsonBufferBase {

       ^

In file included from C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/JsonObject.hpp:7:0,

                 from C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/DynamicJsonDocument.hpp:8,

                 from C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.hpp:9,

                 from C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.h:9,

                 from C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:26,

                 from C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22,

                 from C:\Users\alstk\AppData\Local\Temp\arduino_modified_sketch_730702\sketch_sep01e.ino:3:

C:\Users\alstk\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/./JsonObjectData.hpp:17:65: error: template argument 1 is invalid

        sizeof(ArduinoJson::Internals::JsonObjectData::node_type))

                                                                 ^

C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseObject.h:28:34: note: in expansion of macro 'JSON_OBJECT_SIZE'

 #define FIREBASE_JSONBUFFER_SIZE JSON_OBJECT_SIZE(32)

                                  ^

C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:86:36: note: in expansion of macro 'FIREBASE_JSONBUFFER_SIZE'

   std::shared_ptr<StaticJsonBuffer<FIREBASE_JSONBUFFER_SIZE>> buffer_;

                                    ^

In file included from C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22:0,

                 from C:\Users\alstk\AppData\Local\Temp\arduino_modified_sketch_730702\sketch_sep01e.ino:3:

C:\Users\alstk\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:86:60: error: expected unqualified-id before '>' token

   std::shared_ptr<StaticJsonBuffer<FIREBASE_JSONBUFFER_SIZE>> buffer_;

                                                            ^

exit status 1
보드 NodeMCU 1.0 (ESP-12E Module) 컴파일 에러.

 

 

nodemcu 보드를 이용하여 와이파이를 통해 Firebase에 데이터를 보내려고 하는데 자꾸 컴파일에 문제가 생깁니다..

초보라 잘 모르겠어서 혹시 알고 계신 분 알려주시면 감사하겠습니다!

이전글   |    아두이노 조건문 질문드립니다. 2018-08-27
다음글   |    아두이노를 활용하여 gps 웹으로 받기 2018-09-02