Initial setup for SwitchMote [SOLVED - FastEddy]

Started by FastEddy, June 07, 2014, 12:18:14 AM

FastEddy

I have three Moteinos, one (with the memory chip) is in a SwitchMote and two others stand alone. I loaded the receive programme (it compiled OK) on the Switchmote and can send from the Moteinos. So far so good...

Now I try to upload SwitchModeConfig to the SwitchMote and it won't compile (verbose listing below).

I know I am probably doing something stupid... Is there a "How To" anywhere?

Arduino: 1.5.6-r2 (Windows 7), Board: "Arduino Uno"

Arduino: 1.5.6-r2 (Windows 7), Board: "Arduino Uno"

Build options changed, rebuilding all

Using library EEPROMEx in folder: C:\Users\Eddy\Documents\Arduino\libraries\EEPROMEx (legacy)

Using library RFM69 in folder: C:\Users\Eddy\Documents\Arduino\libraries\RFM69 (legacy)

Using library SPIFlash in folder: C:\Users\Eddy\Documents\Arduino\libraries\SPIFlash (legacy)



C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard -IC:\Users\Eddy\Documents\Arduino\libraries\EEPROMEx -IC:\Users\Eddy\Documents\Arduino\libraries\RFM69 -IC:\Users\Eddy\Documents\Arduino\libraries\SPIFlash C:\Users\Eddy\AppData\Local\Temp\build385881863135590140.tmp\SwitchMoteConfig.cpp -o C:\Users\Eddy\AppData\Local\Temp\build385881863135590140.tmp\SwitchMoteConfig.cpp.o

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard -IC:\Users\Eddy\Documents\Arduino\libraries\EEPROMEx -IC:\Users\Eddy\Documents\Arduino\libraries\RFM69 -IC:\Users\Eddy\Documents\Arduino\libraries\SPIFlash -IC:\Users\Eddy\Documents\Arduino\libraries\EEPROMEx\utility C:\Users\Eddy\Documents\Arduino\libraries\EEPROMEx\EEPROMex.cpp -o C:\Users\Eddy\AppData\Local\Temp\build385881863135590140.tmp\EEPROMEx\EEPROMex.cpp.o

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard -IC:\Users\Eddy\Documents\Arduino\libraries\EEPROMEx -IC:\Users\Eddy\Documents\Arduino\libraries\RFM69 -IC:\Users\Eddy\Documents\Arduino\libraries\SPIFlash -IC:\Users\Eddy\Documents\Arduino\libraries\RFM69\utility C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp -o C:\Users\Eddy\AppData\Local\Temp\build385881863135590140.tmp\RFM69\RFM69.cpp.o

C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp: In member function 'bool RFM69::initialize(byte, byte, byte)':
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:67: error: 'SPI' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:67: error: 'SPI_MODE0' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:69: error: 'SPI_CLOCK_DIV2' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp: In member function 'void RFM69::sendFrame(byte, const void*, byte, bool, bool)':
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:214: error: 'SPI' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp: In member function 'virtual void RFM69::interruptHandler()':
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:244: error: 'SPI' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp: In member function 'void RFM69::encrypt(const char*)':
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:316: error: 'SPI' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp: In member function 'byte RFM69::readReg(byte)':
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:340: error: 'SPI' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp: In member function 'void RFM69::writeReg(byte, byte)':
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:349: error: 'SPI' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp: In member function 'void RFM69::readAllRegs()':
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:400: error: 'SPI' was not declared in this scope

FastEddy

Just to amplify, I did a fresh installation of the Arduino environment and installed the three libraries, removing the -Master from the names of two of them so that they are recognised properly. I assume that there must be something else to install that is required to compile SwitchMoteConfig but not the Moteino receive example.

I'll continue reading but I am currently stumped  :'(

Felix


FastEddy

Felix,

Thank you for responding! I know I must just be missing something and I appreciate your help...

I may not have added that library correctly before but now I think I have. I have five libraries added (in my sketch directory - Arduino\libraries):

EEPROMEx
RFM69
SPIFlash
WirelessHEX
WirelessHEX69

I'm just trying to do the first-time initialisation atm, with a USB BUB programmer.

After the changes still, when I hit Verify for SwitchMoteConfig, I get:

Arduino: 1.5.6-r2 (Windows 7), Board: "Arduino Uno"

Using library RFM69 in folder: C:\Users\Eddy\Documents\Arduino\libraries\RFM69 (legacy)

Using library EEPROMEx in folder: C:\Users\Eddy\Documents\Arduino\libraries\EEPROMEx (legacy)

Using library SPIFlash in folder: C:\Users\Eddy\Documents\Arduino\libraries\SPIFlash (legacy)



C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard -IC:\Users\Eddy\Documents\Arduino\libraries\RFM69 -IC:\Users\Eddy\Documents\Arduino\libraries\EEPROMEx -IC:\Users\Eddy\Documents\Arduino\libraries\SPIFlash C:\Users\Eddy\AppData\Local\Temp\build385881863135590140.tmp\SwitchMoteConfig.cpp -o C:\Users\Eddy\AppData\Local\Temp\build385881863135590140.tmp\SwitchMoteConfig.cpp.o

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=156 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard -IC:\Users\Eddy\Documents\Arduino\libraries\RFM69 -IC:\Users\Eddy\Documents\Arduino\libraries\EEPROMEx -IC:\Users\Eddy\Documents\Arduino\libraries\SPIFlash -IC:\Users\Eddy\Documents\Arduino\libraries\RFM69\utility C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp -o C:\Users\Eddy\AppData\Local\Temp\build385881863135590140.tmp\RFM69\RFM69.cpp.o

C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp: In member function 'bool RFM69::initialize(byte, byte, byte)':
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:67: error: 'SPI' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:67: error: 'SPI_MODE0' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:69: error: 'SPI_CLOCK_DIV2' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp: In member function 'void RFM69::sendFrame(byte, const void*, byte, bool, bool)':
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:214: error: 'SPI' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp: In member function 'virtual void RFM69::interruptHandler()':
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:244: error: 'SPI' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp: In member function 'void RFM69::encrypt(const char*)':
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:316: error: 'SPI' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp: In member function 'byte RFM69::readReg(byte)':
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:340: error: 'SPI' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp: In member function 'void RFM69::writeReg(byte, byte)':
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:349: error: 'SPI' was not declared in this scope
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp: In member function 'void RFM69::readAllRegs()':
C:\Users\Eddy\Documents\Arduino\libraries\RFM69\RFM69.cpp:400: error: 'SPI' was not declared in this scope

FastEddy

SwitchMoteConfig.ino says that it needs:

#include <EEPROMex.h>      //get it here: http://playground.arduino.cc/Code/EEPROMex
#include <RFM69.h>         //get it here: http://github.com/lowpowerlab/rfm69
#include <SPIFlash.h>      //get it here: http://github.com/lowpowerlab/spiflash
#include <avr/wdt.h>       //comes with Arduino

There's no mention of the WirelessHEX69 library anywhere. I kinda assumed that was only for wireless programming, which I haven't even got to yet. But that's not the issue...

The problem is that I can't even compile SwitchMoteConfig.ino in the Arduino environment. Once I have that working, I'll upload it by USB and proceed on to the next step: compiling and installing SwitchMote, also by USB.

I have followed the instructions I can find to the letter and re-installed everything methodically, in case I messed up. Same result.

Obviously, I am missing something, perhaps something stupid. In any case, I do not know what to try next.

Any help will be appreciated.

Felix

You're right, somehow I was thinking you're trying wireless programming. You don't need WirelessHEX69 for the config part.
Looks like your environment is complaining about the SPI library which should come standard with the Arduino IDE. There is no compile error, just the compiler being clueless what SPI means.
Obviously something is missing there. Can you try to open an example Arduino sketch for SPI communication and try to compile that?
You're using a beta release, could you try the 1.0.5 stable release?

FastEddy

Ha ha! Thank you for the pointer Felix.

I did revert to Arduino 1.0.5-r2 (I'll stay with the stable version, just to be on the safe side) but that was not the problem...

The Github-posted version of Switch ModeConfig does not include the line: #include <SPI.h>

I added it and it compiles. As expected, I was missing something stupid.

I guess nobody else is using the Arduino environment! (or they are smarter than me - which is a distinct possibility :o)

Working, so I can't work with the hardware right now but, hopefully, I am now off and running.

Thanks again!

Felix

It compiles fine on my end without the added SPI.h, but .. great!
(I using IDE 1.0.5)

FastEddy

Odd.

I now notice that Gateway.ino has #include <SPI.h>, for instance: https://github.com/LowPowerLab/RFM69/blob/master/Examples/Gateway/Gateway.ino

SwitchMote.ino also:
https://github.com/LowPowerLab/SwitchMote/blob/master/SwitchMote.ino

But SwitchMoteConfig has #include <avr/wdt.h> in that position:
https://github.com/LowPowerLab/SwitchMote/blob/master/SwitchMoteConfig.ino

Whatever, it's working THANKS!

jcsingle21

I had this same problem on my Mac, did the #include <SPI.h> and all was good, thanks for the fix.