-1

I have a windows 10 pc that has a wifi usb stick to connect to my home router. This dongle uses an IP like this: 192.168.1.10. The gateway (router) has IP: 192.168.1.254. Then I have a board with an Arduino UNO microcontroller with a WiFi board that has a web server with IP: 192.168.4.1. I would like to make sure that my PC can connect to the Arduino UNO WiFi board using TCP/IP communication. So Arduino UNO must have an IP: 192.168.1.40. Furthermore, my pc must be able to access the webserver on the Arduino UNO using the browser at the IP address: 192.168.4.1 (of the WiFi card mounted on the Arduino UNO). How can I make my pc communicate with the Arduino UNO via WiFi, both using the webserver on the Arduino UNO and using the Arduino UNO on the 192.168.1.x network ? Does the PC need to have 2 USB WiFi sticks, one to connect to the 192.168.4.1 IP (webserver) and one to connect via TCP/IP to the 192.168.1.x network ?

1 Answers1

1

The simplest way to make everything "just work" is to follow three simple rules:

  1. Have a router on each network.

  2. Each device on a network (that is not the router for that network) should have a default route to the router on that network.

  3. Each device that is a router on a network should have a route for any network it doesn't directly serve as a router for that leads to the router for that nework.

So, for example, say that the router for 192.168.1.0/24 is 192.168.1.1 and the router for 192.168.4.0/24 is 192.168.4.1, then:

Every device on 192.168.1.0/24 other than the router should have 192.168.1.1 as its default route. Every device on 192.168.4.0/24 other than the router should have 192.168.4.1 as its default route.

If the two routers aren't the same thing the 192.168.1.1 router should have a route to 192.168.4.0/24 through 192.168.4.1 and the 192.168.4.1 router should have a route to 192.168.1.0/24 through 192.168.1.1.

David Schwartz
  • 179,497
  • 17
  • 214
  • 278