Coap-client does not save the response from the coap-server
Posted: Thu Jul 14, 2016 3:22 am
Hi. I have a two esp-12q with nodeMCU 1.5.1 firmware and I have a problem with using a coap module.
I have started a coap server on first esp:
Test on Firefox with copper plugin got the right results.
But, if I want to use the second esp-12q with similar firmware to get this value from the first esp I get a problem - my code does nothing, because in the documentation for coap module there is no way to accept response.
Question: Is there a way to get an answer as client?
In the mind comes only a bunch of client + server on each esp, where client1 makes a POST-request to a server2 to a function, that sends a reply as a POST-request from client2 to server1 to a function, that finally save the data.
client1 -> server2 -> client2 -> server1
I have started a coap server on first esp:
Code: Select all
cs=coap.Server()
cs:listen(5683)
test='[1,2,3]'
cs:var("test", coap.JSON)
Test on Firefox with copper plugin got the right results.
But, if I want to use the second esp-12q with similar firmware to get this value from the first esp I get a problem - my code does nothing, because in the documentation for coap module there is no way to accept response.
Code: Select all
cc = coap.Client()
cc:get(coap.CON, "coap://192.168.10.11:5683/v1/v/test") -- and the response goes to... to where?
Question: Is there a way to get an answer as client?
In the mind comes only a bunch of client + server on each esp, where client1 makes a POST-request to a server2 to a function, that sends a reply as a POST-request from client2 to server1 to a function, that finally save the data.
client1 -> server2 -> client2 -> server1