You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build a CoAP server project, using aiocoap and Docker containers.
I'm using the Docker Compose file to manage containers in the project and a Dockerfile to build the images for the container. In this case I use a Docker image of Ubuntu to build the custom image with CoAP Server (installing python, requirements and running server.py from the aiocoap tutorial).
The problem: Request outside the container, with WSL Ubuntu
$ aiocoap-client -m GET coap://127.0.0.1:5683/.well-known/core
Network error: [Errno 111] received through errqueue
In my case, I need to interact outside the container, because all the compose file will be executed in a Raspberry, so I need to send coap request from a Client (e.g. ESP32) to a CoAP Server (Raspberry Pi).
How can I solve this issue?
Working example: Request inside the container
After open the bash of the container with the command docker exec -it ubuntu-coap-server bash
coapuser@docker-desktop:/app$ aiocoap-client -m GET coap://127.0.0.1:5683/.well-known/core
Response arrived from different address; base URI is coap://127.0.0.1/.well-known/core
</.well-known/core>;ct="40",</>,</time>;obs,</other/block>,</other/separate>;title="A large resource",</whoami>,<https://christian.amsuess.com/tools/aiocoap/#version-0.4.7>;rel="impl-info"
aiocoap.cli.defaults: output
Python version: 3.8.10 (default, Nov 22 2023, 10:22:35)
[GCC 9.4.0]
aiocoap version: 0.4.7
Modules missing for subsystems:
dtls: missing DTLSSocket
oscore: missing cbor2, cryptography, filelock, ge25519
linkheader: everything there
prettyprint: missing cbor2, termcolor, pygments
Python platform: linux
Default server transports: tcpserver:tcpclient:tlsserver:tlsclient:udp6
Selected server transports: tcpserver:tcpclient:tlsserver:tlsclient:udp6
Default client transports: tcpclient:tlsclient:udp6
Selected client transports: tcpclient:tlsclient:udp6
SO_REUSEPORT available (default, selected): True, True```
The text was updated successfully, but these errors were encountered:
I have little knowledge of what those WSL containers do, but can you confirm that the loopback address is even supposed to work across container boundaries?
You can test that easily by running sudo apt install socat on the Linux side, then running sudo socat - tcp-listen:80, and then pointing your web browser at http://127.0.0.1/ -- if forwarding works, you'll see the HTTP request in the Linux machine (and get an error in the browser); if not, socat will report nothing (and you'll get a different error).
Hi everyone,
I'm trying to build a CoAP server project, using aiocoap and Docker containers.
I'm using the Docker Compose file to manage containers in the project and a Dockerfile to build the images for the container. In this case I use a Docker image of Ubuntu to build the custom image with CoAP Server (installing python, requirements and running server.py from the aiocoap tutorial).
compose.yml & Dockerfile
Testing the server with aiocoap-client
The problem: Request outside the container, with WSL Ubuntu
In my case, I need to interact outside the container, because all the compose file will be executed in a Raspberry, so I need to send coap request from a Client (e.g. ESP32) to a CoAP Server (Raspberry Pi).
How can I solve this issue?
Working example: Request inside the container
After open the bash of the container with the command
docker exec -it ubuntu-coap-server bash
aiocoap.cli.defaults: output
The text was updated successfully, but these errors were encountered: