Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending CoAP message using http server post #158

Open
pawelevans opened this issue Jan 28, 2020 · 1 comment
Open

Sending CoAP message using http server post #158

pawelevans opened this issue Jan 28, 2020 · 1 comment

Comments

@pawelevans
Copy link

Hi,
I am using python-connect as http server on a beaglebone, and on pressing a web page button is handled by the httprequesthandler post. This executes the following:
if self.path == 'discovery':
client = HelperClient(server=("192.168.1.33", 5683))
response = client.get("/.well-known/core")
if response is not None:
print(response.pretty_print())
client.stop()
return MyHTTPReqHandler

On pressing the button on the web page, the coap message is seen by the coap server on the IP address 192.168.1.33 and an ACK is returned.

This is what is shown at the client end on receipt of this ACK:
28.01.20 08:53:40 (+0000) python-connect 2020-01-28 08:53:40,043 - MainThread - coapthon.layers.messagelayer - DEBUG - send_request - From None, To ('192.168.1.33', 5683), None-None, GET-Sp, [Uri-Path: .well-known, Uri-Path: core, ] No payload
28.01.20 08:53:40 (+0000) python-connect 2020-01-28 08:53:40,053 - MainThread - coapthon.client.coap - DEBUG - send_datagram - From None, To ('192.168.1.33', 5683), CON-4902, GET-Sp, [Uri-Path: .well-known, Uri-Path: core, ] No payload
28.01.20 08:53:40 (+0000) python-connect 2020-01-28 08:53:40,072 - Thread-1 - coapthon.client.coap - DEBUG - Start receiver Thread
28.01.20 08:53:40 (+0000) python-connect 2020-01-28 08:53:40,086 - Thread-1 - coapthon.layers.messagelayer - DEBUG - receive_empty - From ('192.168.1.33', 5683), To None, ACK-4902, EMPTY-None, [] No payload
28.01.20 08:53:40 (+0000) python-connect 2020-01-28 08:53:40,098 - MainThread-Retry-4902 - coapthon.client.coap - DEBUG - retransmit loop ... enter
28.01.20 08:53:40 (+0000) python-connect 2020-01-28 08:53:40,114 - MainThread-Retry-4902 - coapthon.client.coap - DEBUG - retransmit loop ... exit

The web page is no longer being serviced and have to restart the web service to recover.
Any help with this would be appreciated.

@pawelevans
Copy link
Author

I note that the receiver thread did not exit, which may be the reason.
Could this therefore be the receive handler is not happy with the empty payload in the response?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant