Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Guide/d_PacketBuffer/d_PacketBuffer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public:
byte length() { return fill; }
void reset()
{
memset(buf,NULL,sizeof(buf));
memset(buf,0,sizeof(buf));
fill = 0;
}
virtual size_t write (uint8_t ch)
Expand Down
6 changes: 3 additions & 3 deletions Guide/e_BasicMultiNodeWebClient/e_BasicMultiNodeWebClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public:
byte length() { return fill; }
void reset()
{
memset(buf,NULL,sizeof(buf));
memset(buf,0,sizeof(buf));
fill = 0;
}
virtual size_t write (uint8_t ch)
Expand All @@ -43,14 +43,14 @@ static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };

byte Ethernet::buffer[700];

char website[] PROGMEM = "emoncms.org";
const char website[] PROGMEM = "emoncms.org";

void setup ()
{
Serial.begin(9600);
Serial.println("05 - Basic MultiNode Web Client");

if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)
if (ether.begin(sizeof Ethernet::buffer, mymac, 8) == 0)
Serial.println( "Failed to access Ethernet controller");
if (!ether.dhcpSetup())
Serial.println("DHCP failed");
Expand Down
2 changes: 1 addition & 1 deletion Guide/f_ReceivingReply/decode_reply.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
int get_reply_data(word off)
{
memset(line_buf,NULL,sizeof(line_buf));
memset(line_buf,0,sizeof(line_buf));
if (off != 0)
{
uint16_t pos = off;
Expand Down
4 changes: 2 additions & 2 deletions Guide/f_ReceivingReply/f_ReceivingReply.ino
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
byte Ethernet::buffer[700];
unsigned long timer;

char website[] PROGMEM = "emoncms.org";
const char website[] PROGMEM = "emoncms.org";

// This is the char array that holds the reply data
char line_buf[50];
Expand All @@ -38,7 +38,7 @@ void setup ()
Serial.begin(9600);
Serial.println("06 - Receiving a reply");

if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)
if (ether.begin(sizeof Ethernet::buffer, mymac, 8) == 0)
Serial.println( "Failed to access Ethernet controller");
if (!ether.dhcpSetup())
Serial.println("DHCP failed");
Expand Down
2 changes: 1 addition & 1 deletion Guide/g_FetchEmoncmsFeedValue/decode_reply.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
int get_reply_data(word off)
{
memset(line_buf,NULL,sizeof(line_buf));
memset(line_buf,0,sizeof(line_buf));
if (off != 0)
{
uint16_t pos = off;
Expand Down
4 changes: 2 additions & 2 deletions Guide/g_FetchEmoncmsFeedValue/g_FetchEmoncmsFeedValue.ino
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
byte Ethernet::buffer[700];
unsigned long timer;

char website[] PROGMEM = "emoncms.org";
const char website[] PROGMEM = "emoncms.org";

// This is the char array that holds the reply data
char line_buf[50];
Expand All @@ -34,7 +34,7 @@ void setup ()
pinMode(redLED, OUTPUT); digitalWrite(redLED,HIGH);
pinMode(greenLED, OUTPUT); digitalWrite(greenLED,HIGH);

if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)
if (ether.begin(sizeof Ethernet::buffer, mymac,8) == 0)
Serial.println( "Failed to access Ethernet controller");
if (!ether.dhcpSetup())
Serial.println("DHCP failed");
Expand Down
17 changes: 8 additions & 9 deletions NanodeRF_Cosm/NanodeRF_Cosm.ino
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public:
byte length() { return fill; }
void reset()
{
memset(buf,NULL,sizeof(buf));
memset(buf,0,sizeof(buf));
fill = 0;
}
virtual size_t write (uint8_t ch)
Expand All @@ -83,7 +83,7 @@ byte Ethernet::buffer[700];
static uint32_t timer;

//Domain name of remote webserver - leave blank if posting to IP address
char website[] PROGMEM = "api.cosm.com";
const char website[] PROGMEM = "api.cosm.com";

const int redLED = 6; // NanodeRF RED indicator LED
//const int redLED = 17; // Open Kontrol Gateway LED indicator
Expand Down Expand Up @@ -117,7 +117,6 @@ void setup () {
Serial.println("\n[webClient]");

//if (ether.begin(sizeof Ethernet::buffer, mymac, 10) == 0) { //for use with Open Kontrol Gateway
if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) { //for use with NanodeRF
if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) {
Serial.println( "Failed to access Ethernet controller");
ethernet_error = 1;
Expand All @@ -140,9 +139,9 @@ void setup () {

#ifdef UNO
wdt_enable(WDTO_8S);
#endif;
#endif
}
}


//**********************************************************************************************************************
// LOOP
Expand Down Expand Up @@ -258,13 +257,13 @@ static void my_callback (byte status, word off, word len) {
// We just search for the characters and hope they are in the right place
char val[1];
val[0] = line_buf[23]; val[1] = line_buf[24];
int hour = atoi(val);
char hour = atoi(val);
val[0] = line_buf[26]; val[1] = line_buf[27];
int minute = atoi(val);
char minute = atoi(val);
val[0] = line_buf[29]; val[1] = line_buf[30];
int second = atoi(val);
char second = atoi(val);
val[0] = line_buf[11]; val[1] = line_buf[12];
int day = atoi(val);
char day = atoi(val);

// Don't send all zeros, happens when server failes to returns reponce to avoide GLCD getting mistakenly set to midnight
if (hour>0 || minute>0 || second>0)
Expand Down
4 changes: 2 additions & 2 deletions NanodeRF_Cosm/decode_reply.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
int get_header_line(int line,word off)
{
memset(line_buf,NULL,sizeof(line_buf));
memset(line_buf,0,sizeof(line_buf));
if (off != 0)
{
uint16_t pos = off;
Expand All @@ -27,7 +27,7 @@ int get_header_line(int line,word off)

int get_reply_data(word off)
{
memset(line_buf,NULL,sizeof(line_buf));
memset(line_buf,0,sizeof(line_buf));
if (off != 0)
{
uint16_t pos = off;
Expand Down
2 changes: 1 addition & 1 deletion NanodeRF_Cosm/dhcp_dns.ino
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void dhcp_dns()

#ifdef UNO
wdt_enable(WDTO_8S);
#endif;
#endif

Serial.print("DNS status: "); // print
Serial.println(dns_status); // dns status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public:
byte length() { return fill; }
void reset()
{
memset(buf,NULL,sizeof(buf));
memset(buf,0,sizeof(buf));
fill = 0;
}
virtual size_t write (uint8_t ch)
Expand All @@ -79,7 +79,7 @@ PacketBuffer str;
static byte mymac[] = { 0x42,0x31,0x42,0x21,0x30,0x31 };

// 1) Set this to the domain name of your hosted emoncms - leave blank if posting to IP address
char website[] PROGMEM = "emoncms.org";
const char website[] PROGMEM = "emoncms.org";

// or if your posting to a static IP server:
static byte hisip[] = { 192,168,1,10 };
Expand Down Expand Up @@ -130,7 +130,7 @@ void setup () {
Serial.println("\n[webClient]");

//if (ether.begin(sizeof Ethernet::buffer, mymac, 10) == 0) { //for use with Open Kontrol Gateway
if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) { //for use with NanodeRF
if (ether.begin(sizeof Ethernet::buffer, mymac,8) == 0) { //for use with NanodeRF
Serial.println( "Failed to access Ethernet controller");
ethernet_error = 1;
}
Expand All @@ -152,7 +152,7 @@ void setup () {

#ifdef UNO
wdt_enable(WDTO_8S);
#endif;
#endif
}

//**********************************************************************************************************************
Expand Down Expand Up @@ -284,11 +284,11 @@ static void my_callback (byte status, word off, word len) {
Serial.println(line_buf);

char tmp[] = {line_buf[1],line_buf[2],0};
byte hour = atoi(tmp);
char hour = atoi(tmp);
tmp[0] = line_buf[4]; tmp[1] = line_buf[5];
byte minute = atoi(tmp);
char minute = atoi(tmp);
tmp[0] = line_buf[7]; tmp[1] = line_buf[8];
byte second = atoi(tmp);
char second = atoi(tmp);

if (hour>0 || minute>0 || second>0)
{
Expand Down
4 changes: 2 additions & 2 deletions NanodeRF_Power_RTCrelay_GLCDtemp/decode_reply.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
int get_header_line(int line,word off)
{
memset(line_buf,NULL,sizeof(line_buf));
memset(line_buf,0,sizeof(line_buf));
if (off != 0)
{
uint16_t pos = off;
Expand All @@ -27,7 +27,7 @@ int get_header_line(int line,word off)

int get_reply_data(word off)
{
memset(line_buf,NULL,sizeof(line_buf));
memset(line_buf,0,sizeof(line_buf));
if (off != 0)
{
uint16_t pos = off;
Expand Down
2 changes: 1 addition & 1 deletion NanodeRF_Power_RTCrelay_GLCDtemp/dhcp_dns.ino
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void dhcp_dns()

#ifdef UNO
wdt_enable(WDTO_8S);
#endif;
#endif

Serial.print("DNS status: "); // print
Serial.println(dns_status); // dns status
Expand Down
4 changes: 2 additions & 2 deletions NanodeRF_Test/NanodeRF_Test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const int redLED=6;
// ethernet interface mac address
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
// remote website name
char website[] PROGMEM = "google.com";
const char website[] PROGMEM = "google.com";

byte Ethernet::buffer[700];
static long timer;
Expand Down Expand Up @@ -46,7 +46,7 @@ digitalWrite(redLED, HIGH);
Serial.begin(9600);
Serial.println("\n[getDHCPandDNS]");

if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)
if (ether.begin(sizeof Ethernet::buffer, mymac, 8) == 0)
{
Serial.println( "Failed to access Ethernet controller");
digitalWrite(redLED, LOW);
Expand Down
14 changes: 7 additions & 7 deletions NanodeRF_multinode/NanodeRF_multinode.ino
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public:
byte length() { return fill; }
void reset()
{
memset(buf,NULL,sizeof(buf));
memset(buf,0,sizeof(buf));
fill = 0;
}
virtual size_t write (uint8_t ch)
Expand All @@ -68,7 +68,7 @@ PacketBuffer str;
static byte mymac[] = { 0x42,0x31,0x42,0x21,0x30,0x31 };

// 1) Set this to the domain name of your hosted emoncms - leave blank if posting to IP address
char website[] PROGMEM = "emoncms.org";
const char website[] PROGMEM = "emoncms.org";

// or if your posting to a static IP server:
static byte hisip[] = { 192,168,1,10 };
Expand Down Expand Up @@ -118,7 +118,7 @@ void setup () {
Serial.println("\n[webClient]");

//if (ether.begin(sizeof Ethernet::buffer, mymac, 10) == 0) { //for use with Open Kontrol Gateway
if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) { //for use with NanodeRF
if (ether.begin(sizeof Ethernet::buffer, mymac,8) == 0) { //for use with NanodeRF
Serial.println( "Failed to access Ethernet controller");
ethernet_error = 1;
}
Expand All @@ -140,7 +140,7 @@ void setup () {

#ifdef UNO
wdt_enable(WDTO_8S);
#endif;
#endif
}

//**********************************************************************************************************************
Expand Down Expand Up @@ -247,11 +247,11 @@ static void my_callback (byte status, word off, word len) {
Serial.println(line_buf);

char tmp[] = {line_buf[1],line_buf[2],0};
byte hour = atoi(tmp);
char hour = atoi(tmp);
tmp[0] = line_buf[4]; tmp[1] = line_buf[5];
byte minute = atoi(tmp);
char minute = atoi(tmp);
tmp[0] = line_buf[7]; tmp[1] = line_buf[8];
byte second = atoi(tmp);
char second = atoi(tmp);

if (hour>0 || minute>0 || second>0)
{
Expand Down
4 changes: 2 additions & 2 deletions NanodeRF_multinode/decode_reply.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
int get_header_line(int line,word off)
{
memset(line_buf,NULL,sizeof(line_buf));
memset(line_buf,0L,sizeof(line_buf));
if (off != 0)
{
uint16_t pos = off;
Expand All @@ -27,7 +27,7 @@ int get_header_line(int line,word off)

int get_reply_data(word off)
{
memset(line_buf,NULL,sizeof(line_buf));
memset(line_buf,0,sizeof(line_buf));
if (off != 0)
{
uint16_t pos = off;
Expand Down
2 changes: 1 addition & 1 deletion NanodeRF_multinode/dhcp_dns.ino
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void dhcp_dns()

#ifdef UNO
wdt_enable(WDTO_8S);
#endif;
#endif

Serial.print("DNS status: "); // print
Serial.println(dns_status); // dns status
Expand Down
8 changes: 4 additions & 4 deletions NanodeRF_multinode_bulksend/NanodeRF_multinode_bulksend.ino
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public:
byte length() { return fill; }
void reset()
{
memset(buf,NULL,sizeof(buf));
memset(buf,0,sizeof(buf));
fill = 0;
}
virtual size_t write (uint8_t ch)
Expand All @@ -67,7 +67,7 @@ PacketBuffer str;
static byte mymac[] = { 0x42,0x31,0x42,0x21,0x30,0x31 };

// 1) Set this to the domain name of your hosted emoncms - leave blank if posting to IP address
char website[] PROGMEM = "emoncms.org";
const char website[] PROGMEM = "emoncms.org";

//IP address of remote sever, only needed when posting to a server that has not got a dns domain name (staticIP e.g local server)
byte Ethernet::buffer[700];
Expand All @@ -88,7 +88,7 @@ void setup () {
Serial.println("NanodeRF_multinode_bulksend");

//if (ether.begin(sizeof Ethernet::buffer, mymac, 10) == 0) { //for use with Open Kontrol Gateway
if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) { //for use with NanodeRF
if (ether.begin(sizeof Ethernet::buffer, mymac, 8) == 0) { //for use with NanodeRF
Serial.println( "Failed to access Ethernet controller");
}

Expand All @@ -114,7 +114,7 @@ void setup () {

#ifdef UNO
wdt_enable(WDTO_8S);
#endif;
#endif

ethernet_requests = 0;

Expand Down
2 changes: 1 addition & 1 deletion NanodeRF_multinode_bulksend/decode_reply.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
int get_reply_data(word off)
{
memset(line_buf,NULL,sizeof(line_buf));
memset(line_buf,0,sizeof(line_buf));
if (off != 0)
{
uint16_t pos = off;
Expand Down
Loading