Hi, i’m new on photon world… I’m testing a simple application on photon to read and write udp packet on lan between photon and pc, so either pc and photn act as server and client.
I set static ip, mask and gateway on photon.
When i test application and photon is connected on a wifii AP and switch where pc is connected too all works fine, i’m also able to ping photon; when i move photon under another AP linked on a different switch (the switches are connectet on a router) the link was broken, i can’t ping photon. All devices are in the same subnet (all other devices linked on different AP are able to comunicate, the lan in working).
Anyone have some idea how i can solve this ugly problem?
the photon have led status cloud connected but when my pc and photon are loggend on different AP i can’t connect… but i set static ip to be able to connect to phont whitout internet connection active, If i set ip/sub/gw configuration on the same lan and use UDP read/write to specific ip and port it could work also without internet connection, right?
It depends on the system mode, take a look at the documentation. for example if you set to AUTOMATIC (default):
"The automatic mode of connectivity provides the default behavior of the device, which is that:
SYSTEM_MODE(AUTOMATIC);
When the device starts up, it automatically tries to connect to Wi-Fi and the Particle Cloud.
Once a connection with the Particle Cloud has been established, the user code starts running."
[quote=“haplo, post:5, topic:20214”]
that if i not set SYSTEM_MODE photon not works without internet connection
[/quote] This is not quite correct and you may want to also read about SYSTEM_THREAD(ENABLED).
I would try your example with two other hosts, like two laptops or a laptop and a phone, on the two different APs. I think you will find that it is your AP configuration that is blocking your connections.
If your APs are configured as routers, then you will need to open up the required paths between them (TCP port number and allow ICMP echo packets between them). If you can configure your APs in bridge mode, then your test should work fine.
i tried (pc and photon under the same AP to have connectione and could test it) with SYSTEM_THREAD(ENABLED) and Photon became pingable before cloud connection and when i move in the other AP range photon is pingable again but UDP traffic not work.
I move in the same AP again and set SYSTEM_MODE(SEMI_AUTOMATIC) but photon became totally disconnected the led shows internet disconnected.
It seems to be a firewall issue. Which UDP port you are using? The access points are in bridge mode as @bko says? I also would check on the pc that the UDP port is not blocked by a local firewall.
I think the prboblem now is solved.
I add a new AP to have a better coverage of rooms near photon is installed, now with 3 AP all ethernet connected to Router (Gataway for all of them) and all configured with the same SSID and Password i can connect to photon from my Pc either ethernet connected than wifi under different AP with no problem.
I think there was 2 problems:
low wifi signal make UDP communications instable
Now i have 3 AP connected to 3 different switch connected to Router/Firewall, before i tried to enable Wifi on Router/Firewall but i lost connections between AP and Router/Firewall
After 24 hours with no lost connection i think i can say now is all working…