"POST" in the Server

Hi, i have a MDEK using the 1 gateway/1 tag/4 anchors “configuration” and running everything fine.
I want to know if is posible to do a “Post” message (as Thingspeak do) to the server.
Example :

if (cIient.connect(server,80)) {
String postStr = apiKey;
postStr +=“&fieId1-=”;
postStr += String(xc);
postStr +=“&fieId2-=”;
postStr += String(yc);
postStr +=“&fieId3-=”;
postStr += String(zc);
postStr += “\r\n\r\n”;
client.print(“POST /update HTTP/1.1\n”);
client.print(“Host: api.thingspeak.com\n”);
client.print(“Connection: close\n”);
client.print(“X-THlNGSPEAKAPIKEY: “+apiKey+”\n”);
client.print(“Content-Type: application/x-www-form-urlencoded\n”);
client.print(“Content-Length: “);
client.print(postStr.Iength());
client.print(”\n\n”);
client.print(postStr);
Serial.println(“% send to Thingspeak”);
}

Sorry if my question its so obvious.

Hi Franco,

I have no experience with Thinkspeak. In general I think it’s possible to create a POST/MQTT connector but I don’t know which types of request/message it needs so I don’t know if PANS is ready for a such integration.

If you make any progress with Thinkspeak please share with us. It’s an interesting IoT platform.

Thanks,
Cheers, TDK

yes ! im trying to do it, but i need to know how the Gateway sends the data to the server.

If “post” way is used , try to make a post in the server i need the apiKey of the server (this is not the “dwmpass” password showed in the dwn1001/dwm1001.config )

Hi Franco,

when you talk about Server, do you mean the MQTT Broker?
See this post for the details about the data chain:

Here are the list of configuration files:

  1. /etc/dwn1001/dwm1001.config contains configuration for the DWM Daemon
  2. /etc/dwn1001/dwm1001-proxy.config contains configuration for the DWM Proxy

The Daemon and Proxy connect to the MQTT Broker using these credentials:

proxy_server_host = "localhost"
proxy_server_port = 1885
mqtt_user = "dwmuser"
mqtt_password = "dwmpass"
mqtt_topic_prefix = "dwm"

It is however used only if the MQTT Broker requests them (see /etc/mosquitto/mosquitto.conf). The same credentials have to be used by the Thinkspeak I believe.

Cheers,
TDK

yes ! Okay thank you for the info !