Trouble making HTTP requests from docker container
-
@Peter-Lebiedzinski Since reprapfirmware is using its own little http server there is no dedicate config file. Here you can find some docs about the general API: https://github.com/Duet3D/RepRapFirmware/wiki/HTTP-requests Note that every request starting with /rr_ is covered there.
Every other request is a file request. Probably some subdirectory (like /foobar/rr_status) is added to your request leading to that error. Without further debugging as pointed out above it's hard to say what it is.
Maybe you can run Wireshark on the host and capture what exactly is going on.
-
@chrishamm It looks like the request URI is not resolving properly and this is causing the server to treat it as a file request:
https://github.com/Duet3D/RepRapFirmware/blob/v3-chrishamm/src/Networking/HttpResponder.cpp#L1140
Wireshark traces:
Working request payload:
Hypertext Transfer Protocol
GET /rr_status HTTP/1.1\r\n
Host: 192.168.75.110\r\n
User-Agent: curl/7.83.1\r\n
Accept: /\r\n
\r\n
[Full request URI: http://192.168.75.110/rr_status]
[HTTP request 1/1]
[Response in frame: 9957]Not working request payload:
Hypertext Transfer Protocol
GET http://192.168.75.110/rr_status HTTP/1.1\r\n
Host: 192.168.75.110\r\n
User-Agent: curl/7.74.0\r\n
Accept: /\r\n
\r\n
[Full request URI: http://192.168.75.110/rr_status]
[HTTP request 1/1]
[Response in frame: 23915] -
All that HTTP and Docker stuff is way out of my knowledge zone, but I'd try to "ping" the Duet bord from inside the docker container.
Maybe Duets IP address is out of Dockers reach? -
@Peter-Lebiedzinski Thanks, that explains it, looks like the Duet HTTP server didn't understand absolute URIs. I've got a fix ready, if you are comfortable running out a beta version, here my current dev build for the 6HC with that fix.
-
@chrishamm Okay I can try the new build. Will it work on the following Duet hardware:
Board: Duet 2 WiFi (2WiFi)
Firmware: RepRapFirmware for Duet 2 WiFi/Ethernet 3.4.4 (2022-10-20)
Duet WiFi Server Version: 1.27 -
@Peter-Lebiedzinski Sorry, that's for the 6HC, for some reason I thought you were using that. I'll prepare another Duet 2 build when I get home again.
-
@chrishamm Great. Thank you for the fast support.
-
@Peter-Lebiedzinski Here you go.
-
@chrishamm This new firmware has fixed the issue. Thank you.
-
@chrishamm would we be able to generate the firmware for the Duet 3 6XD board as well?
-
@Peter-Lebiedzinski the fix should be included in 3.5b3
-
@chrishamm Sorry for asking again, but I am working with someone who is unable to use the latest version 3.5b3, and has to use 3.4.5, specifically with the following:
Board: Duet 3 MB6XD (MB6XD)
DSF Version: 3.4.5
Firmware: RepRapFirmware for Duet 3 MB6XD 3.4.5
Duet Web Control 3.4.5Could you generate the firmware for this configuration? If possible, in the future, I'd like to save you the trouble of generating these files, is there documentation on how I can generate these files myself?
-
@Peter-Lebiedzinski I've back-ported the fix to the 3.4-dev branch, so it will be included in the forthcoming 3.4.6 release.