Go Down

Topic: Arduino Wifi - Dhcp server (Read 81 times) previous topic - next topic



I have written an application for Android which sends commands to an Arduino Wifi and an Android tablet.
The 3 devices are connected into a wifi network of a internet router. This last one delivers an Ip adress to the 3 devices. Everything works correctly.
From an android smartphone I can send strings to Arduino Wifi and to the Android tablet.

I would like to obtain the same result but without the internet router and use the Arduino Wifi as a dhcp server. I connect the smartphone and the tablet on the Arduino Wifi and they get an IP adress from the Arduino Wifi. From each device I can ping the Arduino Wifi.
The Arduino Wifi is set to mode AP+STA.

But when I send a command from the smartphone to the tablet I get the error message : "impossible to reach this host".

Does somebody has an idea of what is wrong ?

Thanks for your help.


Double check what the IP addresses are for the devices (and the subnet mask) to verify they are on the same subnet.  How does your smartphone know what the IP address of the tablet is you want to talk to - DHCP hands out the addresses, but you don't have any DNS at that point, so it does not know how to convert from the tablet name to an IP address (or are you using the IP addresses for your communication - that would take out the DNS issue).  The error message you posted has the look and feel of the two devices being on different subnets or something.

-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3


Hello Mikey

Thanks for your reply.
The Arduino Wifi delivers IP adresses to smartphone and to tablet.
On the tablet I can see the used Ip adress and I use this IP adress for communication.
The exact error message on the smartphone which send the command : failed to connect to
(port 8000) isConnected failed : EHOSTUNREACH (No route to host)

On the tablet and smartphone I can not check subnetmask. It is not displayed.

When I use a wifi router instead of Arduino wifi, everything works fine.

Thanks again.


You need to look at the addresses of all 3.  the is a bit unusual - usually, you will see something more along the lines of or something (although the 240 is legal).  Assuming the subnet mask is, then all three devices need to be 192.168.240.??? for them to be able to communicate with each other.  The subnet mask tells you which part of the address is the network and which part is the hostID.  the "255" chunks are network while the "0" is the hostID - in the case of the usual, only the last octet can change and still be part of the 192.168.240. network.  Not sure how much of this you are familiar with, but that is how it works and without DNS to resolve the name, you have to use the IP addresses to talk between devices.
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131