Arduino Wifi - Dhcp server

Hello,

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.

mikey

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 192.168.240.2
(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.
Mario

You need to look at the addresses of all 3. the 192.168.240.2 is a bit unusual - usually, you will see something more along the lines of 192.168.2.2 or something (although the 240 is legal). Assuming the subnet mask is 255.255.255.0, 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 255.255.255.0, 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.

hello , my project is like tracking the vechile using Iot,, i am using sim808 for gps tracking, for IOT application i am using MQTT which is running on ESP8266-1.How can i send gps data to ESP8266 which can publish it to broker(both gps and ESP8266 are connected to arduino uno)??, plz help me, Thanks in advance..