kmac makes a good observation. Arduino sketch programs often need to include other files called libraries which can be confusing, especially if one is new.
You might be helped by the following comments about having the libraries needed by this Home Automation project. (I try to cover such subjects in my progressive
Success... posts which you might also benefit from.)
When I refer to the Arduino IDE, I mean the program one uses to open, edit, & upload Arduino sketch programs.
Gateway node sketch says
Basic DHT node sketch says
#include <RFM69.h>
#include <RFM69.h>
#include <SPI.h>
#incl
ude <SPI.h>
#include <Ethernet.h>
#include <DHT.h>
#include <PubSubClient.h>
All mean "insert supplementary library program code."
One needs to have downloaded & carefully installed a sketch's required libraries (standardized building blocks for Arduino code) so Arduino IDE can find them. Generally one downloads a compressed file (like .zip) that contains essential files named Something.h & Something.cpp (examples I made up) plus explanatory text files & example files to help get started. Once uncompressed, the library of folders & files must be in a top folder with the exact name of what’s before .h or .cpp. So with a (made up) library containing clipper.h, the top folder must be clipper. Once via any renaming & moving you have all a library contents under the correctly named top folder, put that top folder inside the key folder, Documents\Arduino\libraries\. Then Arduino IDE should find & include the library in sketches (Arduino programs) & be able to load any library example sketches to use or adapt.
To get the
PubSubClient library, go to github.com/knolleary/pubsubclient/tags Under the latest release version (currently v1.9.1), click on one type of compressed file, zip (probably) or tar.gz & save the file where you can find it (maybe Downloads). With a compressed file utility (like WinZip or 7-Zip) extract the download to where you can find it. Say you download & extract v1.9.1. You get a top folder called pubsubclient-1.9.1. Inside it are 2 more folders, PubSubClient (the most important) & tests, & README. Rename README to README.txt or README.rtf so you can more easily open it. Move the tests folder into the PubSubClient folder. Copy or move the PubSubClient folder into Documents\Arduino\libraries\
Similarly, download
RFM69 library at github.com/LowPowerLab/RFM69/archive/master.zip. Extract RFM69-master.zip. Rename the top folder from RFM69-master to RFM69. Copy or move the renamed top folder to Documents\Arduino\libraries\
Similarly, download
DHT library (for the DHT11 temperature & humidity sensor) at
github.com/adafruit/DHT-sensor-library/archive/master.zip. Rename the folder from DHT-sensor-library-master to DHT. Copy or move that folder into Documents\Arduino\libraries\
The
SPI library comes with the Arduino IDE install.
The
Ethernet library also comes with the Arduino IDE, but for better stability of the network make the changes shown below for the file C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.h. Per CompuTourist at
homeautomation.proboards.com/thread/20/new-release-duplex-gateway referring to harizanov.com/2012/04/rfm12b-and-arduino-ethernet-with-wiznet5100-chip/ ...
Within w5100.h replace:
#else
inline static void initSS() { DDRB |= _BV(2); };
inline static void setSS() { PORTB &= ~_BV(2); };
inline static void resetSS() { PORTB |= _BV(2); };
#endif
with: [Small
additions of cli(); & sei(); ]
#else
inline static void initSS() { DDRB |= _BV(2); };
inline static void setSS() {
cli(); PORTB &= ~_BV(2); };
inline static void resetSS() { PORTB |= _BV(2);
sei(); };
#endif
Library files are text files. So use a text editor like [Windows] Notepad. In Notepad’s File menu, choose “Open” & navigate to C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility\w5100.h You could copy that address (C:\Program…), paste it in Notepad’s upper left file address box, & tap enter key. Search & find the text to be replaced shown above. Make the changes & save the file. If you are blocked from saving the changes, exit the Arduino IDE. If that’s not enough, restart the computer & try again.