Skip to content
Browse files

Making code work with stock Arduino 1.0.1

  • Loading branch information...
1 parent 97d364f commit 6f6aaec4524790bca6ed594db2aa8e1729dedfd0 @johnmckerrell committed Jul 26, 2012
Showing with 132 additions and 117 deletions.
  1. +41 −14 README
  2. +20 −33 YAHMS.ino
  3. +36 −40 YAHMS_Config.cpp
  4. +2 −2 YAHMS_Config.h
  5. +13 −8 YAHMS_Controller.cpp
  6. +1 −1 YAHMS_Defines.h
  7. +18 −18 YAHMS_Sampler.cpp
  8. +1 −1 YAHMS_SyncTime.cpp
View
55 README
@@ -3,24 +3,51 @@ YAHMS
Yet Another Home Management System
-John McKerrell 2011
+John McKerrell 2011/2012
YAHMS is distributed under the terms of the Artistic License 2.0. For more
details, see the full text of the license in the file LICENSE.
-This arduino code is supposed to give a generic base to build hardware
-on and have it controlled by configuration on a web site. The website
-will provide "control blocks" specifying when digital outputs should
-be turned on and will also specify Analog inputs that should be
-sampled and sent back to the server. The server will also specify
-pins that are connected to an Xbee module, if these pins are present
-and the Arduino receives samples from other Xbee modules then these
-will also be sent back to the server.
+YAHMS acts as a simple Arduino sketch that takes its instructions from
+a server on the internet. The only thing that requires changing is the MAC
+address of the Arduino Ethernet board or Ethernet Shield which should be
+put in YAHMS_Local.h. Configuration of input & output pins is done on the
+server.
+
+The server will define which digital output and analog input pins are
+active. If an XBee module is attached the server should tell the Arduino
+which pins this is connected to.
+
+The server will store "control blocks" which the YAHMS code downloads and
+uses to determine when to turn the digital input pins on and off. This is
+time based, the YAHMS code uses NTP to ensure accurate timings and a
+timezone offset which is sent by the server.
+
+When analog inputs are active the YAHMS sketch will sample these and send
+a normalised value back to the server once every minute.
+
+Similarly if an XBee module is active, values reported by XBee packets
+will be normalised and sent back to the server too.
+
+The server can be found at http://yahms.net/ but is very minimal,
+ask John McKerrell at http://twitter.com/mcknut if you want to use it.
+
+More info can be found here:
+
+http://blog.johnmckerrell.com/category/arduino-2/
Though this code is quite functional it should still be considered an
-early release. It requires the very latest Ethernet libraries
-available from amcewen on github:
- https://github.com/amcewen/Arduino
+early release. It requires the latest Arduino interface and the
+following libraries:
+
+XBee with SoftwareSerial support
+https://github.com/johnmckerrell/xbee-arduino
+
+Flash
+http://arduiniana.org/libraries/flash/
+
+Time
+http://arduino.cc/playground/Code/Time
-It also requires the HttpClient and Flash libraries which are
-available separately.
+HttpClient
+https://github.com/amcewen/HttpClient
View
53 YAHMS.ino
@@ -35,7 +35,7 @@ Check the last time we sent back a sample, if it’s been too long then send the
#include <Udp.h>
#include <util.h>
-#include <NewSoftSerial.h>
+#include <SoftwareSerial.h>
#include <XBee.h>
#include <SPI.h>
@@ -55,30 +55,17 @@ Check the last time we sent back a sample, if it’s been too long then send the
#include "YAHMS_Sampler.h"
#include "YAHMS_Controller.h"
-void * operator new(size_t size);
-void operator delete(void * ptr);
-
-void * operator new(size_t size)
-{
- return malloc(size);
-}
-
-void operator delete(void * ptr)
-{
- free(ptr);
-}
-
#ifdef LOGGING
-FLASH_STRING(CONFIGURING_ETHERNET,"Configuring ethernet");
-FLASH_STRING(CONFIGURING_ETHERNET_FAILED,"Failed to configure Ethernet using DHCP");
-FLASH_STRING(SYNCING_TIME,"Syncing time");
-FLASH_STRING(SETUP_SAMPLER,"Setup sampler");
-FLASH_STRING(SETUP_CONTROLLER,"Setup controller");
-FLASH_STRING(CHECK_FOR_CONFIG,"Check for config");
-FLASH_STRING(TAKE_SAMPLES,"TakeSamples");
-FLASH_STRING(UPDATE_OUTPUT_PINS,"Update output pins");
-FLASH_STRING(CHECK_AND_SUBMIT_SAMPLES,"CheckAndSubmitSamples");
+FLASH_STRING(CONFIGURING_ETHERNET,"\n\n!!!\n\nConfiguring ethernet\n");
+FLASH_STRING(CONFIGURING_ETHERNET_FAILED,"Failed to configure Ethernet using DHCP\n");
+FLASH_STRING(SYNCING_TIME,"Syncing time\n");
+FLASH_STRING(SETUP_SAMPLER,"Setup sampler\n");
+FLASH_STRING(SETUP_CONTROLLER,"Setup controller\n");
+FLASH_STRING(CHECK_FOR_CONFIG,"Check for config\n");
+FLASH_STRING(TAKE_SAMPLES,"TakeSamples\n");
+FLASH_STRING(UPDATE_OUTPUT_PINS,"Update output pins\n");
+FLASH_STRING(CHECK_AND_SUBMIT_SAMPLES,"CheckAndSubmitSamples\n");
#endif
// Enter a MAC address for your controller below.
@@ -93,7 +80,7 @@ extern char xbeeRX;
extern char xbeeTX;
XBee xbee = XBee();
-NewSoftSerial *xbeeSerial = NULL;
+SoftwareSerial *xbeeSerial = NULL;
void setup() {
Serial.begin(9600);
@@ -107,26 +94,26 @@ void setup() {
}
// start Ethernet and UDP
#ifdef LOGGING
- CONFIGURING_ETHERNET.println(Serial);
+ CONFIGURING_ETHERNET.print(Serial);
#endif
if (Ethernet.begin(mac) == 0) {
#ifdef LOGGING
- CONFIGURING_ETHERNET_FAILED.println(Serial);
+ CONFIGURING_ETHERNET_FAILED.print(Serial);
#endif
// no point in carrying on, so do nothing forevermore:
for(;;)
;
}
#ifdef LOGGING
- SYNCING_TIME.println(Serial);
+ SYNCING_TIME.print(Serial);
#endif
SyncTime_setup();
#ifdef LOGGING
- SETUP_SAMPLER.println(Serial);
+ SETUP_SAMPLER.print(Serial);
#endif
SetupSampler();
#ifdef LOGGING
- SETUP_CONTROLLER.println(Serial);
+ SETUP_CONTROLLER.print(Serial);
#endif
SetupController();
}
@@ -148,7 +135,7 @@ void loop() {
Not sure about advance blocks - perhaps also an On block, these and +1 hour could be a special type that you only have one of, so a later +1 or advance discards the previous
*/
#ifdef LOGGING
- CHECK_FOR_CONFIG.println(Serial);
+ CHECK_FOR_CONFIG.print(Serial);
#endif
CheckAndUpdateConfig();
/*
@@ -157,22 +144,22 @@ Read in all of the local samples
Check the Xbee for any samples
*/
#ifdef LOGGING
- TAKE_SAMPLES.println(Serial);
+ TAKE_SAMPLES.print(Serial);
#endif
TakeSamples();
/*
Iterate over outputs, check whether we’re inside an On block, update pin status accordingly
*/
#ifdef LOGGING
- UPDATE_OUTPUT_PINS.println(Serial);
+ UPDATE_OUTPUT_PINS.print(Serial);
#endif
CheckAndUpdateState();
/*
Check the last time we sent back a sample, if it’s been too long then send the latest values, don’t send a sample that’s too old
*/
#ifdef LOGGING
- CHECK_AND_SUBMIT_SAMPLES.println(Serial);
+ CHECK_AND_SUBMIT_SAMPLES.print(Serial);
#endif
CheckAndSubmitSamples();
/*
View
76 YAHMS_Config.cpp
@@ -38,15 +38,15 @@ FLASH_STRING(PROG_ON,"ON");
FLASH_STRING(PROG_OFF,"OFF");
FLASH_STRING(DOWNLOADING_CONFIG_FROM,"Downloading config from http://");
FLASH_STRING(HTTP_REQUEST_FAILED,"HTTP request failed. Reported:");
-FLASH_STRING(HTTP_NOT_CONNECTED,"HTTP request couldn't connect");
-FLASH_STRING(VALID_EEPROM_CONTENTS,"Valid eeprom contents");
+FLASH_STRING(HTTP_NOT_CONNECTED,"HTTP request couldn't connect\n");
+FLASH_STRING(VALID_EEPROM_CONTENTS,"Valid eeprom contents\n");
FLASH_STRING(CONFIG_SIZE_IS,"Config size is ");
FLASH_STRING(XBEE_PINS_CHANGED_TO,"Xbee pins changed to RX=");
FLASH_STRING(XBEE_PINS_TX," TX=");
FLASH_STRING(ANALOG_PINS_ARE,"Analog pins are: ");
FLASH_STRING(INPUT_PINS_ARE,"Input pins are: ");
FLASH_STRING(OUTPUT_PINS_ARE,"Output pins are: ");
-FLASH_STRING(CONTROL_BLOCKS,"Control Blocks:");
+FLASH_STRING(CONTROL_BLOCKS,"Control Blocks:\n");
#endif
ControlBlock *firstControlBlock = NULL, *lastControlBlock = NULL;
@@ -65,20 +65,25 @@ byte settings[NUM_SETTINGS];
void LogControlBlock(ControlBlock *currentControlBlock) {
#ifdef LOGGING
Serial.print(currentControlBlock->minute,DEC);
- Serial.print(BLANK);
+ BLANK.print(Serial);
Serial.print(currentControlBlock->hour,DEC);
- Serial.print(BLANK);
+ BLANK.print(Serial);
Serial.print(currentControlBlock->day,DEC);
- Serial.print(BLANK);
+ BLANK.print(Serial);
Serial.print(currentControlBlock->month,DEC);
- Serial.print(BLANK);
+ BLANK.print(Serial);
Serial.print(currentControlBlock->weekday,DEC);
- Serial.print(BLANK);
+ BLANK.print(Serial);
Serial.print(currentControlBlock->len,DEC);
- Serial.print(BLANK);
+ BLANK.print(Serial);
Serial.print(currentControlBlock->pin,DEC);
- Serial.print(BLANK);
- Serial.println(currentControlBlock->state?PROG_ON:PROG_OFF);
+ BLANK.print(Serial);
+ if (currentControlBlock->state) {
+ PROG_ON.print(Serial);
+ } else {
+ PROG_OFF.print(Serial);
+ }
+ Serial.println();
#endif
}
@@ -118,7 +123,7 @@ void CheckAndUpdateConfig() {
eepromRecent = false;
}
// Download the config file from http://bubblino.com/<MAC Address>
- Client c;
+ EthernetClient c;
HttpClient http(c);
if (!eepromRecent) {
char configPath[31] = "/api/c/";
@@ -144,14 +149,13 @@ void CheckAndUpdateConfig() {
configPath[30] = '\0';
#ifdef LOGGING
- Serial.print(DOWNLOADING_CONFIG_FROM);
+ DOWNLOADING_CONFIG_FROM.print(Serial);
Serial.print(YAHMS_SERVER);
Serial.println(configPath);
#endif
- if (http.get(YAHMS_SERVER, 80, configPath, USERAGENT, NULL) == 0)
+ if (http.get(YAHMS_SERVER, 80, configPath, USERAGENT) == 0)
{
// Request sent okay
- http.finishRequest();
// Look for the response, and specifically pull out the content-length header
unsigned long timeoutStart = millis();
@@ -234,7 +238,7 @@ void CheckAndUpdateConfig() {
{
// This isn't a successful response
#ifdef LOGGING
- Serial.println(HTTP_REQUEST_FAILED);
+ HTTP_REQUEST_FAILED.print(Serial);
Serial.println(err);
#endif
}
@@ -246,22 +250,22 @@ void CheckAndUpdateConfig() {
else
{
// else hope that the last config was okay
- Serial.println(HTTP_NOT_CONNECTED);
+ HTTP_NOT_CONNECTED.print(Serial);
}
#endif
}
if (eepromValid) {
configTime = now();
#ifdef LOGGING
- Serial.println(VALID_EEPROM_CONTENTS);
+ VALID_EEPROM_CONTENTS.print(Serial);
#endif
configPresent = true;
unsigned long int configSize= 0;
for (int i = 9; i < 13; ++i) {
configSize = (256 * configSize) + EEPROM.read(i);
}
#ifdef LOGGING
- Serial.print(CONFIG_SIZE_IS);
+ CONFIG_SIZE_IS.print(Serial);
Serial.println(configSize);
#endif
ControlBlock *currentControlBlock = NULL;
@@ -270,6 +274,7 @@ void CheckAndUpdateConfig() {
firstControlBlock = firstControlBlock->next;
free(currentControlBlock);
}
+ lastControlBlock = NULL;
// Now parse the EEPROM contents line by line
int i = 0;
@@ -302,12 +307,6 @@ void CheckAndUpdateConfig() {
intIndex = 0;
} else if (c == '*' && lineMode == 'C') {
if (intIndex < sizeof(controlBlockValues)) {
- /*
- Serial.print("Storing controlBlockValues[");
- Serial.print(intIndex);
- Serial.print("]=");
- Serial.println(-1);
- */
controlBlockValues[intIndex] = -1;
}
intVal = -1;
@@ -317,10 +316,6 @@ void CheckAndUpdateConfig() {
case 'S':
if (intIndex < NUM_SETTINGS) {
settings[intIndex] = intVal;
- Serial.print("Storing setting ");
- Serial.print(intIndex);
- Serial.print(" as ");
- Serial.println(intVal);
}
break;
case 'A':
@@ -430,36 +425,37 @@ void CheckAndUpdateConfig() {
// We don't need to check whether we're part-way through a number
// here because we add a new-line above
+
if (xbeeChanged) {
#ifdef LOGGING
- Serial.print(XBEE_PINS_CHANGED_TO);
+ XBEE_PINS_CHANGED_TO.print(Serial);
Serial.print(xbeeRX,DEC);
- Serial.print(XBEE_PINS_TX);
+ XBEE_PINS_TX.print(Serial);
Serial.println(xbeeTX,DEC);
#endif
- NewSoftSerial *serial = new NewSoftSerial(xbeeRX,xbeeTX);
+ SoftwareSerial *serial = new SoftwareSerial(xbeeRX,xbeeTX);
if (xbeeSerial)
delete xbeeSerial;
xbeeSerial = serial;
- xbee.setSerial(serial);
+ xbee.setSerial(*serial);
xbee.begin(9600);
}
#ifdef LOGGING
- Serial.print(ANALOG_PINS_ARE);
+ ANALOG_PINS_ARE.print(Serial);
for(int i = 0; i < NUM_ANALOG_PINS; ++i) {
if (i > 0) {
- Serial.print(COMMA);
+ COMMA.print(Serial);
}
Serial.print(analogPins[i],DEC);
}
Serial.println();
- Serial.print(INPUT_PINS_ARE);
+ INPUT_PINS_ARE.print(Serial);
#endif
for(int i = 0; i < NUM_INPUT_PINS; ++i) {
#ifdef LOGGING
if (i > 0) {
- Serial.print(COMMA);
+ COMMA.print(Serial);
}
Serial.print(inputPins[i],DEC);
#endif
@@ -469,12 +465,12 @@ void CheckAndUpdateConfig() {
}
#ifdef LOGGING
Serial.println();
- Serial.print(OUTPUT_PINS_ARE);
+ OUTPUT_PINS_ARE.print(Serial);
#endif
for(int i = 0; i < NUM_OUTPUT_PINS; ++i) {
#ifdef LOGGING
if (i > 0) {
- Serial.print(COMMA);
+ COMMA.print(Serial);
}
Serial.print(outputPins[i],DEC);
#endif
@@ -489,7 +485,7 @@ void CheckAndUpdateConfig() {
currentControlBlock = firstControlBlock;
#ifdef LOGGING
- Serial.println(CONTROL_BLOCKS);
+ CONTROL_BLOCKS.print(Serial);
while (currentControlBlock) {
LogControlBlock(currentControlBlock);
currentControlBlock = currentControlBlock->next;
View
4 YAHMS_Config.h
@@ -30,7 +30,7 @@ Check the last time we sent back a sample, if it’s been too long then send the
#include <Ethernet.h>
#include <IPAddress.h>
-#include <NewSoftSerial.h>
+#include <SoftwareSerial.h>
#include <XBee.h>
#include <Time.h>
@@ -44,7 +44,7 @@ Check the last time we sent back a sample, if it’s been too long then send the
extern byte mac[];
extern XBee xbee;
-extern NewSoftSerial *xbeeSerial;
+extern SoftwareSerial *xbeeSerial;
extern char outputPins[];
extern byte settings[];
View
21 YAHMS_Controller.cpp
@@ -5,7 +5,7 @@
#include <Flash.h>
#ifdef LOGGING
-FLASH_STRING(ACTIVE_CONTROL_BLOCK,"Active Control Block");
+FLASH_STRING(ACTIVE_CONTROL_BLOCK,"Active Control Block\n");
FLASH_STRING(SETTING_OUTPUTPINS,"Setting outputPins[");
FLASH_STRING(OUTPUT_PINS_SEP1,"] (");
FLASH_STRING(OUTPUT_PINS_SEP2,") to ");
@@ -61,22 +61,22 @@ void CheckAndUpdateState() {
if (mins <= minsSinceMidnight && (mins+currentControlBlock->len) > minsSinceMidnight) {
pinState = currentControlBlock->state ? 1 : 0;
#ifdef LOGGING
- Serial.println(ACTIVE_CONTROL_BLOCK);
+ ACTIVE_CONTROL_BLOCK.print(Serial);
LogControlBlock(currentControlBlock);
#endif
}
} else if (currentControlBlock->hour == hour(t)) {
pinState = currentControlBlock->state ? 1 : 0;
#ifdef LOGGING
- Serial.println(ACTIVE_CONTROL_BLOCK);
+ ACTIVE_CONTROL_BLOCK.print(Serial);
LogControlBlock(currentControlBlock);
#endif
}
} else if (currentControlBlock->minute != -1) {
if (currentControlBlock->minute <= minute(t) && (currentControlBlock->minute + currentControlBlock->len) > minute(t)) {
pinState = currentControlBlock->state ? 1 : 0;
#ifdef LOGGING
- Serial.println(ACTIVE_CONTROL_BLOCK);
+ ACTIVE_CONTROL_BLOCK.print(Serial);
LogControlBlock(currentControlBlock);
#endif
}
@@ -95,12 +95,17 @@ void CheckAndUpdateState() {
pinState = 0;
if (pinState != currentPinState[i]) {
#ifdef LOGGING
- Serial.print(SETTING_OUTPUTPINS);
+ SETTING_OUTPUTPINS.print(Serial);
Serial.print(i);
- Serial.print(OUTPUT_PINS_SEP1);
+ OUTPUT_PINS_SEP1.print(Serial);
Serial.print(outputPins[i],DEC);
- Serial.print(OUTPUT_PINS_SEP2);
- Serial.println(pinState ? PROG_HIGH : PROG_LOW);
+ OUTPUT_PINS_SEP2.print(Serial);
+ if (pinState) {
+ PROG_HIGH.print(Serial);
+ } else {
+ PROG_LOW.print(Serial);
+ }
+ Serial.println();
#endif
digitalWrite(outputPins[i], pinState ? HIGH : LOW);
currentPinState[i] = pinState;
View
2 YAHMS_Defines.h
@@ -1,6 +1,6 @@
#define YAHMS_API_VERSION 1
#define USERAGENT "YAHMS/0.1"
-#define YAHMS_SERVER "yahms.johnmckerrell.com"
+#define YAHMS_SERVER "yahms.net"
#define RESPONSETIMEOUT 30
#define LOGGING
View
36 YAHMS_Sampler.cpp
@@ -34,11 +34,11 @@ FLASH_STRING(HAVE_XBEE_PACKET_FROM_NODE,"Have xbee packet from node ");
FLASH_STRING(XBEE_SAMPLES_FOR_NODE,"Xbee Samples for node ");
FLASH_STRING(PROG_PIN," pin ");
FLASH_STRING(SMOOTHED_OUT_TO," smoothed out to ");
-FLASH_STRING(NO_XBEE_PACKET,"No xbee packet");
+FLASH_STRING(NO_XBEE_PACKET,"No xbee packet\n");
FLASH_STRING(PROG_SAMPLE,"Sample ");
FLASH_STRING(PROG_EQUALS," = ");
FLASH_STRING(SUBMITTING_SAMPLES_TO,"Submitting samples to http://");
-FLASH_STRING(HTTP_SUBMIT_CONNECTION_FAILED,"HTTP Connection Failed");
+FLASH_STRING(HTTP_SUBMIT_CONNECTION_FAILED,"HTTP Connection Failed\n");
FLASH_STRING(HTTP_SUBMIT_REQUEST_FAILED,"HTTP Request Failed with: ");
#endif
FLASH_STRING(CONTENT_LENGTH,"Content-Length: ");
@@ -106,7 +106,7 @@ void TakeSamples() {
byte xbeeNode = ioSample.getRemoteAddress16();
#ifdef LOGGING
- Serial.print(HAVE_XBEE_PACKET_FROM_NODE);
+ HAVE_XBEE_PACKET_FROM_NODE.print(Serial);
Serial.println(xbeeNode,DEC);
#endif
if (xbeeNode < MAX_XBEE_NODES) {
@@ -119,11 +119,11 @@ void TakeSamples() {
}
xbeeSamples[xbeeNode][i] = smoothSamples(samples,sampleSize);
#ifdef LOGGING
- Serial.print(XBEE_SAMPLES_FOR_NODE);
+ XBEE_SAMPLES_FOR_NODE.print(Serial);
Serial.print(xbeeNode,DEC);
- Serial.print(PROG_PIN);
+ PROG_PIN.print(Serial);
Serial.print(i);
- Serial.print(SMOOTHED_OUT_TO);
+ SMOOTHED_OUT_TO.print(Serial);
Serial.println(xbeeSamples[xbeeNode][i]);
#endif
} else if (ioSample.isDigitalEnabled(i)) {
@@ -138,7 +138,7 @@ void TakeSamples() {
}
} else {
#ifdef LOGGING
- Serial.println(NO_XBEE_PACKET);
+ NO_XBEE_PACKET.print(Serial);
#endif
}
}
@@ -162,9 +162,9 @@ void CheckAndSubmitSamples() {
}
submitSamples[i] = smoothSamples(analogSamples[i], NUM_SAMPLES);
#ifdef LOGGING
- Serial.print(PROG_SAMPLE);
+ PROG_SAMPLE.print(Serial);
Serial.print(i);
- Serial.print(PROG_EQUALS);
+ PROG_EQUALS.print(Serial);
Serial.println(submitSamples[i]);
#endif
if (submitSamples[i] != -1) {
@@ -184,7 +184,7 @@ void CheckAndSubmitSamples() {
}
- Client c;
+ EthernetClient c;
HttpClient http(c);
char configPath[22] = "/api/s/";
@@ -203,21 +203,21 @@ void CheckAndSubmitSamples() {
configPath[21] = '\0';
#ifdef LOGGING
- Serial.print(SUBMITTING_SAMPLES_TO);
+ SUBMITTING_SAMPLES_TO.print(Serial);
Serial.print(YAHMS_SERVER);
Serial.println(configPath);
#endif
- if (http.post(YAHMS_SERVER, 80, configPath, USERAGENT, NULL) == 0)
+ if (http.post(YAHMS_SERVER, 80, configPath, USERAGENT) == 0)
{
// Request sent okay
#ifdef LOGGING
- Serial.print(CONTENT_LENGTH);
+ CONTENT_LENGTH.print(Serial);
Serial.println(contentLength);
#endif
- http.print(CONTENT_LENGTH);
+ CONTENT_LENGTH.print(http);
http.println(contentLength);
- http.println(SAMPLE_CONTENT_TYPE);
- http.finishRequest();
+ SAMPLE_CONTENT_TYPE.print(http);
+ http.println();
for (int i = 0; i < NUM_ANALOG_PINS; ++i) {
if (submitSamples[i] != -1) {
@@ -260,7 +260,7 @@ void CheckAndSubmitSamples() {
}
} else {
#ifdef LOGGING
- Serial.print(HTTP_SUBMIT_REQUEST_FAILED);
+ HTTP_SUBMIT_REQUEST_FAILED.print(Serial);
Serial.println(err);
#endif
@@ -269,7 +269,7 @@ void CheckAndSubmitSamples() {
c.stop();
} else {
#ifdef LOGGING
- Serial.println(HTTP_SUBMIT_CONNECTION_FAILED);
+ HTTP_SUBMIT_CONNECTION_FAILED.print(Serial);
#endif
}
View
2 YAHMS_SyncTime.cpp
@@ -36,7 +36,7 @@ IPAddress timeServer(91,189,94,4); // time.ubuntu.com NTP server
byte packetBuffer[ NTP_PACKET_SIZE]; //buffer to hold incoming and outgoing packets
// A UDP instance to let us send and receive packets over UDP
-UDP Udp;
+EthernetUDP Udp;
void SyncTime_setup()
{

0 comments on commit 6f6aaec

Please sign in to comment.
Something went wrong with that request. Please try again.