Closed kalj closed 5 years ago
I am running 1.8.9 built locally and it can compile just fine. Did you try compile one of the more basic blink sketch or similar from the esp libs?
I tried this today and got the same errors with 1.8.8. Since @dogmatic69 got it working on 1.8.9 I'm guessing there's some breaking changes with 1.8.8 that's fixed in 1.8.9
If you take a look at the preprocessed sketch output, you can see the problem:
#line 55 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\EspSparsnasGateway.ino"
int __get_adc_mode(void);
#line 109 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\EspSparsnasGateway.ino"
void setup();
#line 349 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\EspSparsnasGateway.ino"
bool initialize(uint32_t frequency);
#line 458 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\EspSparsnasGateway.ino"
void interruptHandler();
#line 612 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\EspSparsnasGateway.ino"
void setMode(uint8_t newMode);
#line 658 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\EspSparsnasGateway.ino"
void loop();
#line 686 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\EspSparsnasGateway.ino"
void reconnect();
#line 1 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\RFM69functions.ino"
uint32_t getFrequency();
#line 4 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\RFM69functions.ino"
void receiveBegin();
#line 16 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\RFM69functions.ino"
uint8_t readReg(uint8_t addr);
#line 24 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\RFM69functions.ino"
void writeReg(uint8_t addr, uint8_t value);
#line 32 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\RFM69functions.ino"
void select();
#line 38 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\RFM69functions.ino"
void unselect();
#line 64 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\RFM69functions.ino"
bool receiveDone();
#line 82 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\RFM69functions.ino"
uint16_t crc16(volatile uint8_t *data, size_t n);
#line 2 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\callback.ino"
void callback(char* topic, byte* payload, unsigned int length);
#line 38 "C:\\Users\\per\\Desktop\\EspSparsnasGateway\\EspSparsnasGateway.ino"
#define appname "EspSparsnasGateway"
const char compile_date[] = __DATE__ " " __TIME__;
// Sometimes you need to change how files are included:
// If the code doesnt compile, try to comment the row below and uncomment the next:
//#include <RFM69registers.h>
#include "RFM69registers.h"
#include <Arduino.h>
The Arduino IDE generates function prototypes for all functions in .ino files which don't already have a prototype. Usually the Arduino IDE does a good job of this but in some rare cases it inserts the prototypes in the wrong place. That is what has happened here. The #include
directive for Arduino.h must come before the function prototypes but the prototypes are being inserted above it. This bug has already been fixed in the Hourly Build of the Arduino IDE so there is no need to report it to Arduino.
The best workaround to fix the problem for the existing IDE release(s) with the bug is to move the #include
directives to the top of the sketch.
An alternative workaround is to add function prototypes for the problematic functions in the correct location in the sketch.
Fantastic @per1234 I've moved them all to the top but something still seems to be missing. This time in the callback.ino Updated fork is here.
Error:
Arduino:1.8.8 (Mac OS X), Kort:"NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Enabled, 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
callback:104:12: error: 'ArduinoJson::JsonObject' has no member named 'printTo'
root.printTo((char*)msg, root.measureLength() + 1);
^
callback:104:37: error: 'ArduinoJson::JsonObject' has no member named 'measureLength'
root.printTo((char*)msg, root.measureLength() + 1);
^
exit status 1
'StaticJsonBuffer' was not declared in this scope
I think you will find your answer here: https://github.com/bblanchon/ArduinoJson/issues/756 Seams to be a bug in the beta version of ArduinoJson use the stable version instead.
This Json issue is already reported here and is unrelated to the initial error. https://github.com/bphermansson/EspSparsnasGateway/issues/19
I get error messages like this:
I had to downgrade to Arduino IDE 1.6.13