EthernetENC and UIPEthernet - URL instead of IP address?

Learning to use Grafana. I want to send data to the InfluxDB database which is hosted on AWS servers. In the sketch I need to enter the remote IP, which in this case is not known. Instead I should use this URL:

Is there a way to insert URL when using any of these two libraries?

you can use ArduinoHttpClent library

OK, I can try. There are 12 sketches with that library, can you suggest which is most useful in my case? Important to note, I am using ENC28J60.

the ArduinoHttClent library works with the Client class which is base class for all EthernetClient and WiFiClient classes. so there is no problem to use it with EthernetENC library

I have to admit, I'm lost. Suppose I can use my original sketch with some changes/additions from the suggested library that will make it connect to an URL. And it seems that all sketches deal with Wifi, I don't use it. Can I have a hint or two, please?

Here is my sketch which works when I am sending to an IP address instead of URL:

#include <EthernetENC.h>

EthernetUDP udp;
#define INPUT1 A4
#define INPUT2 A5
#define INPUT3 A6

EthernetServer server = EthernetServer(8);

void setup() {


  uint8_t mac[6] = {0x74,0x69,0x69,0x2D,0x30,0x61};
  IPAddress ip(192, 168, 1, 91);  //Arduino IP adress, change IP to our network IP address
  IPAddress gateway(192, 168, 1, 1);  //Change gateway to our network gateway address
  IPAddress subnet(255, 255, 255, 0);  ////Change subnet to our network subnet address
  IPAddress dnsServer(192, 168, 1, 1);

  Ethernet.begin(mac, ip, dnsServer, gateway, subnet);

  Serial.print(F("localIP: "));
  Serial.print(F("subnetMask: "));
  Serial.print(F("gatewayIP: "));
  Serial.print(F("dnsServerIP: "));

  pinMode(INPUT1, INPUT);
  pinMode(INPUT2, INPUT);
  pinMode(INPUT3, INPUT); 

void loop() {

  int success;
  String Value1,Value2,Value3,Values;

//Ping Echo Response -Start 
  size_t size;  
  if (EthernetClient client = server.available())
      if (client)
          while((size = client.available()) > 0)
              uint8_t* msg = (uint8_t*)malloc(size);
              size =,size);
//Ping Echo Response -End
//Values Data Sending InfluxDB -CodeStart
      Value1 = analogRead(INPUT1);
      Value2 = analogRead(INPUT2);
      Value3 = analogRead(INPUT3);
      success = udp.beginPacket(IPAddress(192, 168, 1 , 73),5151);
      Serial.print("beginPacket: ");
      Serial.println(success ? "success" : "failed");
      Values = String("Value1=" + Value1 + "," + "Value2=" + Value2 + "," + "Value3=" + Value3);
      success = udp.print(Values);

      Serial.print(F("Values: "));

      Serial.print(F("bytes written: "));

      success = udp.endPacket();

      Serial.print(F("endPacket: "));
      Serial.println(success ? "success" : "failed");


This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.