Ethernet gateway compile error
-
Hi, could you please help me solv this error? I try compile GatewayW5100.ino from offical site and Arduino IDE show this error:
In file included from C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp:23:0,from C:\Users\M\Documents\Arduino\libraries\MySensors-master/MySensors.h:261, from C:\Users\M\Desktop\GatewayW5100\GatewayW5100.ino:116:
C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.h:34:31: error: 'SPI_MODE0' was not declared in this scope
#define MY_RF24_SPI_DATA_MODE SPI_MODE0
^
C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.h:38:76: note: in expansion of macro 'MY_RF24_SPI_DATA_MODE'
SoftSPI<MY_SOFT_SPI_MISO_PIN, MY_SOFT_SPI_MOSI_PIN, MY_SOFT_SPI_SCK_PIN, MY_RF24_SPI_DATA_MODE> _SPI;
^
C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.h:38:97: error: template argument 4 is invalid
SoftSPI<MY_SOFT_SPI_MISO_PIN, MY_SOFT_SPI_MOSI_PIN, MY_SOFT_SPI_SCK_PIN, MY_RF24_SPI_DATA_MODE> _SPI;
^
C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.h:38:103: error: invalid type in declaration before ';' token
SoftSPI<MY_SOFT_SPI_MISO_PIN, MY_SOFT_SPI_MOSI_PIN, MY_SOFT_SPI_SCK_PIN, MY_RF24_SPI_DATA_MODE> _SPI;
^
In file included from C:\Users\M\Documents\Arduino\libraries\MySensors-master/MySensors.h:261:0,
from C:\Users\M\Desktop\GatewayW5100\GatewayW5100.ino:116:
C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp: In function 'uint8_t RF24_spiMultiByteTransfer(uint8_t, uint8_t*, uint8_t, bool)':
C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp:44:24: error: request for member 'transfer' in '_SPI', which is of non-class type 'int'
uint8_t status = _SPI.transfer( cmd );
^
C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp:47:18: error: request for member 'transfer' in '_SPI', which is of non-class type 'int'
status = _SPI.transfer( NOP ); ^
C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp:49:24: error: request for member 'transfer' in '_SPI', which is of non-class type 'int'
} else status = _SPI.transfer(*current++);
^
C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp: In function 'bool RF24_initialize()':
C:\Users\M\Documents\Arduino\libraries\MySensors-master/drivers/RF24/RF24.cpp:261:7: error: request for member 'begin' in '_SPI', which is of non-class type 'int'
_SPI.begin();
^
exit status 1
Nastala chyba při kompilaci u desky Arduino Nano.Thanks.
-
@Marek-Běluša You do not appear to have installed the MySensors library correctly. Delete the MySensors-master folder in your libraries folder and re-install . Use the method shown here
-
I've got the same error but the thing missing is incluse spi.h somewhere below...
-
Thanks for reporting this.
The build pages currently use the development branch of MySensors, and therefore require the development version of the MySensors library. I understand that this is confusing and I'll discuss with the core team.
In the meanwhile, either:
- use MySensors 2.0 with the sketches from master (example: https://github.com/mysensors/MySensors/blob/master/examples/GatewayW5100/GatewayW5100.ino )
OR
- use MySensors development branch from github with the sketches from the build pages/development branch on github
Sorry for the confusion.
-
Two build pages (ethernet gateway and battery powered sensors) used the development version of sketches, instead of the master version. I have updated them now.
-
Hello
I have used the version on the build page for ethernet gateway and used the last version of RF24 library for maniacbug together with Mysensors 2.0 library
But I still get a bunch of these errors when compiling
MySensors.h:261: In file included from EthernetGateway.ino:115: from RF24.cpp: 25:1: error: 'LOCAL' does not name a type LOCAL uint8_t MY_RF24_BASE_ADDR[MY_RF24_ADDR_WIDTH] = { MY_RF24_BASE_RADIO_ID } RF24.cpp: 26:1: error: 'LOCAL' does not name a type LOCAL uint8_t MY_RF24_NODE_ADDRESS = AUTO RF24.cpp: 28:1: error: 'LOCAL' does not name a type LOCAL void RF24_csn(bool level) { RF24.cpp: 32:1: error: 'LOCAL' does not name a type LOCAL void RF24_ce(bool level) { RF24.cpp: 36:1: error: 'LOCAL' does not name a type LOCAL uint8_t RF24_spiMultiByteTransfer(uint8_t cmd, uint8_t* buf, uint8_t len, bool aReadMode) { RF24.cpp: 60:1: error: 'LOCAL' does not name a type LOCAL uint8_t RF24_spiByteTransfer(uint8_t cmd) { RF24.cpp: 64:1: error: 'LOCAL' does not name a type LOCAL uint8_t RF24_RAW_readByteRegister(uint8_t cmd) { RF24.cpp: 70:1: error: 'LOCAL' does not name a type LOCAL uint8_t RF24_RAW_writeByteRegister(uint8_t cmd, uint8_t value) { RF24.cpp: 75:1: error: 'LOCAL' does not name a type LOCAL void RF24_flushRX(void) { RF24.cpp: 80:1: error: 'LOCAL' does not name a type LOCAL void RF24_flushTX(void) { RF24.cpp: 85:1: error: 'LOCAL' does not name a type LOCAL uint8_t RF24_getStatus(void) { RF24.cpp: 89:1: error: 'LOCAL' does not name a type LOCAL void RF24_setChannel(uint8_t channel) { RF24.cpp: 93:1: error: 'LOCAL' does not name a type LOCAL void RF24_setRetries(uint8_t retransmitDelay, uint8_t retransmitCount) { RF24.cpp: 97:1: error: 'LOCAL' does not name a type LOCAL void RF24_setAddressWidth(uint8_t width) { RF24.cpp: 101:1: error: 'LOCAL' does not name a type LOCAL void RF24_setRFSetup(uint8_t RFsetup) { RF24.cpp: 105:1: error: 'LOCAL' does not name a type LOCAL void RF24_setFeature(uint8_t feature) { RF24.cpp: 109:1: error: 'LOCAL' does not name a type LOCAL void RF24_setPipe(uint8_t pipe) { RF24.cpp: 113:1: error: 'LOCAL' does not name a type LOCAL void RF24_setAutoACK(uint8_t pipe) { RF24.cpp: 117:1: error: 'LOCAL' does not name a type LOCAL void RF24_setDynamicPayload(uint8_t pipe) { RF24.cpp: 121:1: error: 'LOCAL' does not name a type LOCAL void RF24_setRFConfiguration(uint8_t configuration) { RF24.cpp: 125:1: error: 'LOCAL' does not name a type LOCAL void RF24_setPipeAddress(uint8_t pipe, uint8_t* address, uint8_t width) { RF24.cpp: 129:1: error: 'LOCAL' does not name a type LOCAL void RF24_setPipeLSB(uint8_t pipe, uint8_t LSB) { RF24.cpp: 133:1: error: 'LOCAL' does not name a type LOCAL void RF24_setStatus(uint8_t status) { RF24.cpp: 136:1: error: 'LOCAL' does not name a type LOCAL void RF24_enableFeatures(void) { RF24.cpp: 140:1: error: 'LOCAL' does not name a type LOCAL void RF24_openWritingPipe(uint8_t recipient) { RF24.cpp: 147:1: error: 'LOCAL' does not name a type LOCAL void RF24_startListening(void) { RF24.cpp: 157:1: error: 'LOCAL' does not name a type LOCAL void RF24_stopListening(void) { RF24.cpp: 167:1: error: 'LOCAL' does not name a type LOCAL void RF24_powerDown(void) { RF24.cpp: 173:1: error: 'LOCAL' does not name a type LOCAL bool RF24_sendMessage( uint8_t recipient, const void* buf, uint8_t len ) { RF24.cpp: 208:1: error: 'LOCAL' does not name a type LOCAL uint8_t RF24_getDynamicPayloadSize(void) { RF24.cpp: 220:1: error: 'LOCAL' does not name a type LOCAL bool RF24_isDataAvailable() { RF24.cpp: 226:1: error: 'LOCAL' does not name a type LOCAL uint8_t RF24_readMessage( void* buf) { RF24.cpp: 235:1: error: 'LOCAL' does not name a type LOCAL void RF24_setNodeAddress(uint8_t address) { RF24.cpp: 245:1: error: 'LOCAL' does not name a type LOCAL uint8_t RF24_getNodeID(void) { RF24.cpp: 249:1: error: 'LOCAL' does not name a type LOCAL bool RF24_sanityCheck(void) { RF24.cpp: 256:1: error: 'LOCAL' does not name a type LOCAL bool RF24_initialize(void) { MyTransportNRF24.cpp:22: In file included from MySensors.h:262: from EthernetGateway.ino:115: from RF24.h: In function void setup() RF24.h: 121:6: error: redefinition of 'void setup() void setup() RF24.cpp:23: In file included from MySensors.h:261: from EthernetGateway.ino:115: from RF24.h:121: note void setup() previously defined here void setup() MyTransportNRF24.cpp:22: In file included from MySensors.h:262: from EthernetGateway.ino:115: from RF24.h: In function void loop() RF24.h: 125:6: error: redefinition of 'void loop() void loop() { RF24.cpp:23: In file included from MySensors.h:261: from EthernetGateway.ino:115: from RF24.h:125: note void loop() previously defined here void loop() { MySensors.h:262: In file included from EthernetGateway.ino:115: from MyTransportNRF24.cpp: In function bool transportInit() MyTransportNRF24.cpp: 44:25: error: 'RF24_initialize' was not declared in this scope return RF24_initialize() MyTransportNRF24.cpp: In function void transportSetAddress(uint8_t) MyTransportNRF24.cpp: 48:29: error: 'RF24_setNodeAddress' was not declared in this scope RF24_setNodeAddress(address) MyTransportNRF24.cpp: 49:22: error: 'RF24_startListening' was not declared in this scope RF24_startListening() MyTransportNRF24.cpp: In function uint8_t transportGetAddress() MyTransportNRF24.cpp: 53:24: error: 'RF24_getNodeID' was not declared in this scope return RF24_getNodeID() MyTransportNRF24.cpp: In function bool transportSend(uint8_t, const void*, uint8_t) MyTransportNRF24.cpp: 67:56: error: 'RF24_sendMessage' was not declared in this scope bool status = RF24_sendMessage( recipient, data, len ) MyTransportNRF24.cpp: In function bool transportAvailable() MyTransportNRF24.cpp: 74:36: error: 'RF24_isDataAvailable' was not declared in this scope bool avail = RF24_isDataAvailable() MyTransportNRF24.cpp: In function bool transportSanityCheck() MyTransportNRF24.cpp: 79:26: error: 'RF24_sanityCheck' was not declared in this scope return RF24_sanityCheck() MyTransportNRF24.cpp: In function uint8_t transportReceive(void*) MyTransportNRF24.cpp: 83:37: error: 'RF24_readMessage' was not declared in this scope uint8_t len = RF24_readMessage(data) MyTransportNRF24.cpp: In function void transportPowerDown() MyTransportNRF24.cpp: 94:17: error: 'RF24_powerDown' was not declared in this scope RF24_powerDown() MySensors.h:288: In file included from EthernetGateway.ino:115: from MySensorsCore.cpp: In function void _process() MySensorsCore.cpp: 39:15: error: 'ledsProcess' was not declared in this scope ledsProcess() MySensorsCore.cpp: In function void _infiniteLoop() MySensorsCore.cpp: 62:16: error: 'ledsProcess' was not declared in this scope ledsProcess() MySensorsCore.cpp: In function void _begin() MySensorsCore.cpp: 79:12: error: 'ledsInit' was not declared in this scope ledsInit() EthernetGateway.ino: In function void setup() EthernetGateway.ino: 121:6: error: redefinition of 'void setup() void setup() RF24.cpp:23: In file included from MySensors.h:261: from EthernetGateway.ino:115: from RF24.h:121: note void setup() previously defined here void setup() EthernetGateway.ino: In function void loop() EthernetGateway.ino: 125:6: error: redefinition of 'void loop() void loop() { RF24.cpp:23: In file included from MySensors.h:261: from EthernetGateway.ino:115: from RF24.h:125: note void loop() previously defined here void loop() { Error compiling project sources
Anyone that can tell me why?
Regards,
Mikael
-
Why would you put the RF24 library in the mix?
The MySensors library has everything needed bundled for communication over the NRF24L01 radio.
-
I only used the code that is written here: https://www.mysensors.org/build/ethernet_gateway. Have not changed anything at all
Could it be that I have a mixup between old and new library files from Mysensors (i.e. old mysensors.h)?
I didn't find a description on how to upgrade the library files for Mysensors so it might be that I did someting wrong
-
You can either use the Library Manager to install MySensors 2.0 or download the development (2.1.0.beta) branch from github if you want the latest bugfixes and features.
-
Thank's!
I downloaded the development version of the library and installed, seems to work fine and compiles without errors (except from the MY_LEDS_BLINKING_FEATURE which I removed)