So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Timmiej93
#75985 For my network, I'd like to set it up so that 192.168.0.* is every random object, and 192.168.1.* is everything IOT related. I've set my subnet mask to 255.255.254.0 everywhere, theoretically giving me 512 IP addresses, ranging from 192.168.0.0 to 192.168.1.254. With some devices (laptop, phone) I tested, this works just fine. I can assign them an IP in the 192.168.1.1-192.168.1.254 range, and they get perfect connectivity. However, when I assign NodeMCU a static IP through:
Code: Select allwifi.sta.setip({
      ip = "192.168.1.5",
      netmask = "255.255.254.0",
      gateway = "192.168.0.2"
  }
)

, I can only get connectivity when they're on either 192.168.1.1 or 192.168.1.2 (I have tested some random numbers, none worked, so I'm guessing these are the only two that work). I can ping the ESP on every IP address, and get a response perfectly. However, when I try to access the server (if that's even a server, I'm not yet very familiar with NodeMCU), I get no reply. Viewing the output in ESPlorer also gives me no activity at all on any IP outside the two working ones aforementioned.

The server is setup as follows:
Code: Select all   srv=net.createServer(net.TCP)
   srv:listen(43333, function(conn)


It's very possible that I'm using an outdated / aged way of setting these things up, but I'm using a precompiled version of NodeMCU, of which I'm not sure which modules it contains. I'd love to build an up to date one myself, but without knowing which modules I need, that's gonna be a bit tricky.

Back to the main question however: Is there any reason that many IPs in the 192.168.1.* range won't allow me to use my server, but do allow me to ping the device?