1
\$\begingroup\$

I'm working on a project for school, and the basic premise is to take a serial input, and convert that information to go over Ethernet. It needs to be able to switch between rs232/rs422/rs485 at some point, but I would just like a jumping off point if at all possible. I'm trying to use an Uno and an Ethernet shield, but may switch to a Mega. New to this but looking forward to learning!

\$\endgroup\$
3
  • \$\begingroup\$ You would have an easier time using something with an available hardware UART such as a Mega or other microcontroller, since the one on the Uno is normally connected to the USB-serial converter. Also you are going to have to work out a rule for how to convert the irregular arrival of serial characters to packets worth sending (some combination of size, time, or looking for a terminating character/condition). You might try prototyping the scheme with software on another PC to test the suitability of the rules you come up with for moving data between the two systems you need to connect. \$\endgroup\$ Commented Nov 3, 2012 at 19:54
  • \$\begingroup\$ Though beware that a PC often does not expose the decision of packet boundaries to application software. And beware of the possible need to disable or work around the Nagle Algorithm which may drastically slow certain types of query/response communication when a serial messaging scheme is proxied over TCP/IP. \$\endgroup\$ Commented Nov 3, 2012 at 19:59
  • \$\begingroup\$ This is both too broad and just a high level usage question, not about electrical engineering. \$\endgroup\$ Commented Jul 2, 2013 at 11:05

1 Answer 1

1
\$\begingroup\$

This should be achievable with the UNO and the Ethernet shield. For extra serial comms ports the software serial library works well, but you shouldn't need it to begin with as the arduino communicates with the Ethernet shield via spi. The mega has hardware uarts and more memory, which is useful as memory can run out quite quickly as your code grows.

Without spoiling the fun of working it out, try setting up the arduino as a server with a fixed ip. Then use software on the pc such as hyper terminal or putty to connect to that IP address. The arduino Ethernet library page has good code examples. E.g. http://arduino.cc/en/Reference/ServerConstructor

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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