News How to Set a Static IP Address on Raspberry Pi

Status
Not open for further replies.
Sep 7, 2022
1
0
10
With an Arduino that is serving a web page one can use mDns instead of keeping track of the local IP address.
Add this to your Setup():
C++:
if (MDNS.begin("esp32"))
  {
    MDNS.setInstanceName("count server demo");
    MDNS.addService("http", "tcp", 80);
    MDNS.addServiceTxt("http","tcp","counter","true");
  }
Then that webpage is available locally in chrome and safari as:
http://esp32.local./
I didn't test the other browsers.
I'm sure this works for a Pi also even though I haven't tried it yet. mDns might be on by default.
The url would be http://raspberrypi.local./
To check, try this command:
dns-sd -B _http._tcp
When I do that I find that both of my printers are serving http (a supply level page) in addition to the microcontroller.
 

wl84

Honorable
Nov 16, 2017
4
0
10,510
When I run the nameserver command I get two results back - 192.168.11.1 and 192.168.68.1. I tried both in the config and I can't connect to anythign with either. I'm trying to setup pihole
 
Status
Not open for further replies.