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

Error in transferring data from libcoap server to aiocoap client #367

Open
Koushik-ak47 opened this issue Oct 17, 2024 · 1 comment
Open

Comments

@Koushik-ak47
Copy link

"
Python version: 3.11.2 (tags/v3.11.2:878ead1, Feb 7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)]
aiocoap version: 0.4.11
Modules missing for subsystems:
dtls: missing DTLSSocket
oscore: everything there
linkheader: everything there
prettyprint: everything there
ws: missing websockets
Python platform: win32
Default server transports: oscore:tcpserver:tcpclient:tlsserver:tlsclient:simple6:simplesocketserver
Selected server transports: oscore:tcpserver:tcpclient:tlsserver:tlsclient:simple6:simplesocketserver
Default client transports: oscore:tcpclient:tlsclient:simple6
Selected client transports: oscore:tcpclient:tlsclient:simple6
SO_REUSEPORT available (default, selected): False, False
"

I have tried sending large data using block mode transfer from libcoap server to aiocoap client. But the client is getting exit in between after 90 seconds of block transfer. The server code was tested with libcoap client code and it is working without any issue. Can you please solve the issue?

Hope you reply fast and solve this issue. I am attaching the client code here.

 import logging
import asyncio

from aiocoap import *
import aiocoap.numbers as numbers
logging.basicConfig(level=logging.INFO)
logging.getLogger("coap-client").setLevel(logging.DEBUG)

async def main():
    protocol = await Context.create_client_context()

    numbers.constants.TransportTuning.ACK_TIMEOUT = 20.0

    request = Message(code=GET, uri="coap://192.168.1.2:5683/get_service_log")
    
    try:
        response = await protocol.request(request).response
    except Exception as e:
        print("Failed to fetch resource:") 
        print(e)
    else:
        print("Result: %s\n%r" % (response.code, response.payload))


if __name__ == "__main__":
    asyncio.run(main())
@Koushik-ak47
Copy link
Author

Koushik-ak47 commented Oct 18, 2024

I am getting an error if I execute the above script. I used the libcoap-user example as server code.

 ERROR:coap.blockwise-requester:Error assembling blockwise response, passing on error ResourceChanged()
 Failed to fetch resource:

On server side, I am receiving an error when I have enabled the debug logs in server code as well.

 DEBUG: COAP_EVENT_XMIT_BLOCK_FAIL

Please note this points as well. @chrysn can you help me out ?

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