Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4466

Networking and servers • HTTP Get by Name Fails; by IP Address Works; Ping by Name Works.

$
0
0
I'd like help configuring my node to allow HTTP Gets by Name to work. Get by IP Address works, Ping by Name works, only Get by Name fails.

This is the latest 64-bit Raspberry Pi OS (2024-07-04) Full on an RPi 5 (8GB) with update/upgrade as of today. The clients are a W10 machine and an Ambient Weather Station (Pro V5.1). As far as I can tell, both clients behave the same. I can only show logs from the W10 machine though. [When I configure the Weather Station to use the IP address, everything works - until a different IP address is assigned.]

I'm an experienced coder but a novice WRT networking. I'd guess this is some simple configuration issue. I've worked through several configuration issues to get this far. My evidence for the claims in the subject is below: Ping to Name (works), HTTP Get to Name (Fails), and HTTP Get to IP Address (works).

The ideal solution would not require more packages - just those included by the Foundation. I'm testing on an RPi5 but deployment is planned on a 3B (64Bit / Lite) with lots of software running
.
I'd appreciate help or pointers.

Code:

PS C:\Users\Ralph> ping HomeAutomationPinging HomeAutomation.falconbroadband.net [192.168.1.121] with 32 bytes of data:Reply from 192.168.1.121: bytes=32 time<1ms TTL=64…Reply from 192.168.1.121: bytes=32 time<1ms TTL=64Ping statistics for 192.168.1.121:    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:    Minimum = 0ms, Maximum = 0ms, Average = 0msPS C:\Users\Ralph> Invoke-WebRequest -URI "http://HomeAutomation:8077/?key1=val1&key2=val2"Invoke-WebRequest: Not Found (Not Found)PS C:\Users\Ralph> Invoke-WebRequest -URI "http://192.168.1.121:8077/?key1=val1&key2=val2"StatusCode        : 200StatusDescription : OKContent           : {}RawContent        : HTTP/1.1 200 OK                    Server: Microsoft-NetCore/2.0                    Date: Sun, 07 Jul 2024 04:31:58 GMT                    Transfer-Encoding: chunkedHeaders           : {[Server, System.String[]], [Date, System.String[]], [Transfer-Encoding, System.String[]]}RawContentLength  : 0RelationLink      : {}
More details:
  • The "server" (HTTP Get handler) is a C# program built for and running with ASP.NET 8.0.6.
    The HTTP Get request is made by PowerShell's Invoke-WebRequest but using curl gave the same results.
    The W10 machine is up-to-date. The Ambient Weather station works (by name) when I host the server on Windows.
Thank you for any help,
MMM

Statistics: Posted by MIT70 — Sun Jul 07, 2024 6:15 am — Replies 0 — Views 40



Viewing all articles
Browse latest Browse all 4466

Trending Articles