Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By Piman
#29642
martinayotte wrote:Maybe I've missed something. Is it with specific server software or a question in general ?

Because it is pretty easy to send a POST with multiple data fields, it is simply a keys/values transmitted.
Also, there still possibility to send a JSON object which itself contains multiple keys/values.
Of course, server side software need to be aware of this protocol. But that's part of the game ...

Thank you for your reply, I guess I'm trying to do both as I'm trying to learn as I go along and well need to implement these things in future projects, I suppose the first place to start would be the most simplest, I know on the server side it supports plaintext and Json objects.
I know how to do this using multiple connections but I'm trying to reduce the connection is down to one, this is what I'm sending: url = "/Api/IoT/Control/Module/Virtual/"+ String(IOT_NODE) + "/"+command; on multiple connections, I have done quite a bit of reading on Json objects but at this time I just don't understand it.
User avatar
By martinayotte
#29647 Since you are not yet familiar with JSON, maybe you can avoid this path for now.
The suggestion of @bbx10node above seem to be the easiest way to go.
Add some kind of debug prints on your server side, you will see that all parameters are received.
User avatar
By Piman
#29651
martinayotte wrote:Since you are not yet familiar with JSON, maybe you can avoid this path for now.
The suggestion of @bbx10node above seem to be the easiest way to go.
Add some kind of debug prints on your server side, you will see that all parameters are received.

Thanks again, maybe I haven't made myself clear enough has to what I am trying to do the HTML string that I pasted previously is only one of the HTML string i.e.

url += "/Api/IoT/Control/Module/Virtual/" + String(IOT_NODE) + "/ControlLevel/" + String(a);
url += "/Api/IoT/Control/Module/Virtual/" + String(IOT_NODE) + "/ControlLevel/" + String(b);
url += "/Api/IoT/Control/Module/Virtual/" + String(IOT_NODE) + "/ControlLevel/" + String(c);

As you can see this comprises of free sensors by adding multiple connections to the these three strings I can get it to work, but the multiple connections and disconnection affects the latency and response time.
User avatar
By gordonendersby
#29653 You are stuffed unless you can get the info from the developer of the IoT database server and api to push the values in to the database. Without this you cant guess the format of the string you need to build.

The string you are posting seems to be in a format to describe how the value gets to the right field and how the value is interpreted.
It describes the virtual module, the node name, the field the value goes into then the value.
You need to get the format of the string from the developer to put node name, fields and values into.
You cant guess this and it will be specific to that developers idea of how it should work.

Is this EasyIoT from iot-playground.com?
The same problem im having getting info as per my earlier post?

Gordon