Hi,
I'm new to Arduino and have just started with my first project.
I want the user to be able to enter the IP-information (ip,Subnet,gateway and DNS) via my keypad and then I want to ping it.
Im using ICMPPing lib to ping the address, and when using DHCP it work perfect.
But when I have the user enter the information on the keypad the ping command won't take it due to that it's not an IPAddress datatype.
I need help in either converting my string, array or what ever I can use to store the entered values into an IPAddress.
Or any other idea?
Did you read the threads at the top of the forum? Specifically, the one that says to post the code you are talking about. You are the one asking for help. It is YOUR responsibility to provide the needed information - specifically the code that does not work, for your definition of work.
The error when using the String array to save the input comes in the ping command with error:
error: no match for call to '(ICMPPing) (String&, int)
ICMPEchoReply ICMPPing::operator()(const IPAddress&, int)
Code that wont work:
ICMPEchoReply gwReply = ping(manualIP[3], 4);
I understand why it's not working, what I need help with is how to save the input as an IPAddress datatype or convert it from the saved values to the IPAddress datatype
The manualIP is a String array:
String manualIP[6];
Why? What do the 6 elements represent?
The IP address is an array of bytes. You need to convert each String to an int (or parse the String to collect the individual elements, if the String contains something like 192.168.1.110 and then convert each substring), and store in the appropriate position in an IPAddress object.