Many bugfixes - fixed warnings and compile errors
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "sendmysql.h"
|
||||
#include "configreader.h"
|
||||
#include "restcurl.h"
|
||||
#include <string.h>
|
||||
|
||||
int main(void) {
|
||||
if (wiringPiSetup () == -1)
|
||||
@@ -26,20 +27,20 @@ int main(void) {
|
||||
data.pin = cfgreadpinnumber(i);
|
||||
getData(&data);
|
||||
printf("Pin: %i, %.2f, %.2f\n", data.pin, data.temperature, data.humidity);
|
||||
insertData(&data);
|
||||
//insertData(&data);
|
||||
}
|
||||
|
||||
sensornode nodes; //Settings of ESP8266 sensor nodes
|
||||
int nodecount;
|
||||
int nodecount = 0;
|
||||
cfgreadsensornodes(&nodes, nodecount); //read settings
|
||||
sensor nodedata; //Should be a linked list for further data usage
|
||||
sensornode *currentNode = nodes;
|
||||
sensornode *currentNode = &nodes;
|
||||
|
||||
|
||||
for (i = 0; i < nodecount; i++) {
|
||||
//start rest requests
|
||||
nodedata.ip = currentNode->ip;
|
||||
getRestSensor(&nodedate);
|
||||
strcpy(nodedata.ip, currentNode->ip);
|
||||
getRestSensor(&nodedata);
|
||||
|
||||
printf("Temperature: %f, Humidity: %f, NodeID: %i", nodedata.temperature, nodedata.humidity, nodedata.node_id);
|
||||
|
||||
|
Reference in New Issue
Block a user