Update 2:
Have tested by pinging various devices on different subnets / vlans
and did a pcap on the wifi AP
I can see the icmp requests going through for each request except for ones on the 4.x subnet, almost like the arduino doesnt like that IP address and refuses to send those packets?
Update 1:
Have tested the following
Turned on logging on firewall and noticed the following actions:
- Ping router from Arduino - See logs in firewall, arduino gets response. (Red line)
- Send external web request from arduino - See logs in firewall, arduino gets response. (Orange Line)
- Send web request to internal server - Arduino queries internal DNS and gets IP of web server, but no request send (Nothing in firewall logs) (Yellow and Blue)
- Send ping to internal server - Arduino queries same dns server, gets ip, but no request sent (Firewall logs again) (Yellow and Green)
however, sending the ping and web request from desktop, shows both the firewall log blocking the ping request, and the rule allowing the web request.(Brown Purple Pink)
Have attached diagram again to help visualize whats going onAnd can attach router logs or rules if required
Also have set a windows PC with the same IP address, and can ping the web server, so I know it's something wrong with the arduino's requests to the web server in particular, and not the firewall?
End Update
I have two Node MCUs which I'm using for a project. A while ago they were working fine, but i recently changed some network settings on my home network and found that it broke the script I had running on them. I finally figured out where it went wrong and fixed it, but now I have another interesting problem.
One of my nodes runs this script fine, where as the other gets stuck on the ping stage. I have uploaded the same script to both nodes and swapped over the IP address assigned and it follows the device not the IP. So I know its not a networking issue.
I know the WiFi is working on the funny node, as it gets a IP address. but it doesn't go any further
Any ideas?
Script attached below:
#include <DHT.h>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <ESP8266Ping.h>
// WiFi credentials.
const char* WIFI_SSID = "SSID";
const char* WIFI_PASS = "******";
WiFiClientSecure wifiClient;
bool connection = false;
WiFiClient client;
const char* dbServer = "webaddress";
void setup() {
//Open Serial
Serial.begin(9600);
Serial.setTimeout(2000);
//Connect to Wifi
bool pingtest = false;
Serial.print("Connecting to WiFi");
WiFi.begin(WIFI_SSID, WIFI_PASS);
//Wait for connection
int wificount = 0;
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
if (WiFi.status() == WL_CONNECTED) {
connection = true;
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
while(!pingtest){
Serial.println("Pinging Server");
if(Ping.ping(dbServer) == true){
pingtest = true;
}else{
Serial.print(".");
delay(1000);
}
}
}
}
void loop() {
Serial.println("Hello");
delay(2000);
}
Update (Cross posted from another forum): I have an Arduino which pings a server on a different VLAN / subnet as part of its code. It was working a while ago, but I changed some settings on my firewall to restrict stuff down, and that broke the Arduino code. I found it was because I was blocking ICMP across VLANs. So I created a rule to allow ping requests between the two VLANs tested on my desktop (on same net as Arduino) and works fine. Went to test on Arduino and wasn't getting any response.
So I put the router IP in and tested it on the Arduino, works fine. I can even ping the Arduino from my desktop, and ping my desktop from the Arduino
So I figured I must have some other firewall rule allowing my desktop to have special access. (not that I could find it) so gave the arduino the same Ip address and no luck, yet can still ping the router
I have attached a crude drawing here. Hopefully it helps to visualize my problem.