Also it seems a virtual module can have more than one parameter but the http post string doesnt specify which parameter the value is for.
If the virtual module im using has 2 parameters.
Humidity and temperature how would i specify which parameter the value goes in to?
At some point ill need to add the battery level to each module as well so i have a need to post multiple parameters for each module. Am i using the wrong module for this in the virtual module?
Bit quiet on here init?
Anybody able to point me in the right direction?
This is bit of a show stopper for me not being able to find any documentation on the http post stuff for the virtual driver.
EasyIoT seemed a good choice as it seemed to have a good balance between simplicity and too many features.
Yes it is possible to send as many variables as you want form your sketch, I have found that I have learned most of what I need to know about EasyIOT by looking at the diffrent projects that others are doing as well as reading about other peoples problems.
Here is my code for an ESP connected to a DHT11.....same as DHT22 just not as accurate. You will notice that I only update to the EasyIOT server when something changes....
// DHT Sensor Setup
#define DHTPIN 2 // We have connected the DHT to Digital Pin 2
#define DHTTYPE DHT11 // This is the type of DHT Sensor (Change it to DHT11 if you're using that model)
DHT dht(DHTPIN, DHTTYPE, 15); // Initialize DHT object
void startWiFi(){
Serial.print("Connecting to ");
Serial.println(ssid);
do {
t = dht.readTemperature();
h = dht.readHumidity();
Serial.print("Temperature: ");
Serial.println(t);
Serial.print("Humidity: ");
Serial.println(h);
} while (t == 85.0 || t == (-127.0));
if (t != oldTemp)
{
sendTemp(t);
oldTemp = t;
}
if (h != oldHumid)
{
sendHumidity(h);
oldHumid = h;
}
Thanks for that.
Its pretty much what Ive already got.
Im trying to find out if I can do it in one http transaction.
You have 2 separate http posts.
You open a connection to the server.
Post one value to the first node and close the connection.
Then open a connection post the next value to the second node and close the connection again.
If thats the only way to do it Ill have to.
But also you have 2 separate nodes rather than a single node able to hold 2 values.
Id like a single node to hold multiple related values.
For example Temp, humidity and voltage.
To hold each of these in a separate node for each value would make a dozen sensors very difficult to manage.
Is there any documentation ive missed that might help me with this?
Theres a query on esp8266.com as well asking how its possible to do this.
So the info is needed by more than just me.
www.esp8266.com/viewtopic.php?f=29&t=5629
Can you help us out.
Once i have the answers about multiple fields per node and multiple values in an http post i can write it up for others to use.
Is there any documentation ive missed that might help me with this?
Theres a query on esp8266.com as well asking how its possible to do this.
So the info is needed by more than just me.
www.esp8266.com/viewtopic.php?f=29&t=5629
Can you help us out.
Once i have the answers about multiple fields per node and multiple values in an http post i can write it up for others to use.
Gordon
Currently EasyIoT server http API support only one value per node. Current system in not optimal. You can use MQTT and send more values to one node. I'm building new version in which you will be able to send many values with http API. I will also add widget customization - you will be able to customize your node representation in UI. For example to display humidity and temperature at the same time in one node.