I am making an Arduino mod-bus device and I want to make a webpage as well that will allow me to reset the unit if there is any issues remotely. To do this I would need the mod-bus to operate on port 502 and the webpage to operate on port 80. is it possible for the Arduino to support two ports? I am using an Uno with a Ethernet shield and the standard ehternet.h file with a Modbus library. Any suggestions or ideas?

  • to test, run two instances of a web server ... one on port 80 and one on port 502 .... access the webpage using two devices so that you are serving a page to two different devices at the same time .... if that works, then try adding some modbus test code (if such a thing exists) instead of a webserver on port 502 – jsotola 9 hours ago
  • I tried that and it didn't take the ip address for the webpage but took it for the modbus, and when I added a second instance of the ip to see that would work it errored out. – Michael H. 9 hours ago
  • EthernetServer has nothing to do with IP. Servers should run on a different ports on the same IP. – Juraj 3 hours ago

There is no problem to run two EthernetServer instances on different ports. I have a WebServer and a TelnetServer in my project. (Network connection, setup and loop is handled in main ino file.)

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.