My project is to use an arduino as a server of serial device, the serial device can communicate fluidly with the computer, doing as a communication tunnel, I want a little advice on what codes or libraries could serve me for that function.
Hi,
Slightly confused here... do you mean you have some device which will communicate with an Arduino using serial and then talk to a PC using another serial or bluetooth or WiFi or ???
Please explain a bit more about what needs to talk to what.
Yours,
TonyWilk
I have a device with serial connection (rs232) that I want to communicate with the PC through the Ethernet port (RJ45).
I assume your serial device is remote from the PC otherwise you could connect it directly to the PC?
depending on the baudrate you could use SofteareSerial (maximum typically 38400baud) or a device with spare hardware serial ports to acquire the serial data then forward it using an ethernet shield to a PC using a TCP/IP protocol.
diego_bracamonte77:
I have a device with serial connection (rs232) that I want to communicate with the PC through the Ethernet port (RJ45).
Are you saying that you want an Arduino to receive data from some mystery device using Serial and send it on to the PC using Ethernet?
If so, why not say so?
That should be perfectly possible if you have an Ethernet shield for the Arduino. If your mystery device uses RS232 voltages you will need a MAX232 to convert them to TTL voltage levels for the Arduino.
...R
diego_bracamonte77:
I have a device with serial connection (rs232) that I want to communicate with the PC through the Ethernet port (RJ45).
Unless you have some mystery requirement for processing the serial data before sending it to the PC, you might be interested in: WIZnet Serial-to-Ethernet Gateway - WIZ110SR
Yours,
TonyWilk
Okay, I'll explain myself better, I have a labeling scale, the communication that comes from the factory is RS232, and the scale has a MAX232 so it provides TTL voltage levels for arduino. My main idea is to connect it to a PC and use the balance software to send product price lists and PLUs via ethernet or if wifi is possible, for this I need the Arduino to assign an IP and that of options to configure all communication parameters (baud, bits, etc.) and that obviously can both send data from the balance to the pc, and from the pc to the balance. To make a better idea to perform the function of this device DS1101 Programmable 3.5-channel RS232 Controller | Tibbo
Why not connect the scale direct to the PC using a USB-RS232 or USB-TTL serial cable?
http://www.ftdichip.com/Products/Cables/USBRS232.htm
you could implement software on the PC to read the serial data and do the required processing
Reply #6 starts off well. But by the time it is half way through I can no longer understand it.
From the little I can understand, @horace's suggestion in Reply #7 seems sensible.
...R
What happens is that it is a very long distance for a USB-RS232, and there are several scales connected to a single switch
diego_bracamonte77:
What happens is that it is a very long distance for a USB-RS232, and there are several scales connected to a single switch
Are we to assume each scale has a unique address in the messages?
Paul
via ethernet or if wifi is possible
esp-link is a transparent WiFi to serial bridge. It might do what you need but your description is not clear.
diego_bracamonte77:
What happens is that it is a very long distance for a USB-RS232, and there are several scales connected to a single switch
Why don't you start again with a new description of the whole thing that starts something like this
I have {N} scales that each produce a {serial TTL} signal to {1 / N} Arduinos which are {M} metres from a PC and I want to be able to ....
Describe the requirement, not the solution.
...R
Ok, sorry for the inconvenience, I'll be much clearer. I have 3 labeling scales that produce a serial-TTL signal and each of the scales plan to connect them to an arduino. The scales are located approximately 20 meters from a PC. Each scale must have a unique IP. I want the scales to be able to communicate perfectly with the PC, to be able to send you information from the administrative software of the scales (which is on the PC) to the scales directly, the type of information that I want to send to the balance are product names ( tomatoes, cheese, etc ...) and unit prices of each of the products. In order for the balance software to communicate with the scales, first the balance IP and the port number must be added.
is there any particular reason for converting the TTL serial to ethernet?
a couple of simpler ideas
- have a TTL-RS232 converter on each scale connected to three USB-RS232 devices on the PC to communicate with each scale using a sperate COM port
- does the TTL serial data from scales uniquely identify each device - if so could you connect all three using a RS485 bus to a USB-RS485 device on the PC?
diego_bracamonte77:
Ok, sorry for the inconvenience, I'll be much clearer. I have 3 labeling scales that produce a serial-TTL signal and each of the scales plan to connect them to an arduino. The scales are located approximately 20 meters from a PC.
Are the 3 scales close to each other so that they could all easily connect to one Arduino Mega.?
Each scale must have a unique IP.
Why? I can understand that the scales must be individually identified. But why would that require separate IP addresses? Wouldn't it be sufficient to include an ID character as part of the data being sent?
In view of the next paragraph, perhaps you would tell us exactly what you mean by IP - so there is no confusion.
I want the scales to be able to communicate perfectly with the PC, to be able to send you information from the administrative software of the scales (which is on the PC) to the scales directly, the type of information that I want to send to the balance are product names ( tomatoes, cheese, etc ...) and unit prices of each of the products. In order for the balance software to communicate with the scales, first the balance IP and the port number must be added.
This sounds as if you want the Ethernet/Arduino link to take the place of a simple Serial link between a PC and a scales so that the PC can send messages to and receive messages from the scales.
Does this mean that you have a commercial "scales software package" on the PC that you cannot modify?
OR, is the software on the PC something that you are writing yourself?
In either case, if the PC software is designed to communicate over a serial link I don't understand why it would be using an IP address.
Is it possible that this notion of the need for an IP address is something you have assumed simply because you are using an Ethernet connection?
As you can see there is still an awful lot more that you need to tell us.
...R
diego_bracamonte77:
Ok, sorry for the inconvenience, I'll be much clearer. I have 3 labeling scales that produce a serial-TTL signal and each of the scales plan to connect them to an arduino. The scales are located approximately 20 meters from a PC. Each scale must have a unique IP. I want the scales to be able to communicate perfectly with the PC, to be able to send you information from the administrative software of the scales (which is on the PC) to the scales directly, the type of information that I want to send to the balance are product names ( tomatoes, cheese, etc ...) and unit prices of each of the products. In order for the balance software to communicate with the scales, first the balance IP and the port number must be added.
Right up front, if your scales' software is not designed for "perfect" communications, you will never achieve it. "perfect", to me, means error reporting and error correcting communications, which you do not seem to have.
Paul
Yes, the scales are at a very close distance. And I can not modify the scale software. The problem is that the PC can not move it from place and is quite removed from the scales and I have not found any RS232-USB cable of 20 meters. So if I can convert rs232 to wifi or ethernet I would see it more comfortable given the distance. here I leave a photo of the software http://prntscr.com/in7tj8[/img]
FTDI have USB-RS232 cables terminated with 9-pin D-type connectors
there are USB-RS232 devices with 2, 3 or 4 ports, e.g.
usb-to-serial-converter-lite-4-port-rs232-p511
there are 20m RS232 cables with 9-pin D-type connectors on EBAY
diego_bracamonte77:
Yes, the scales are at a very close distance. And I can not modify the scale software. The problem is that the PC can not move it from place and is quite removed from the scales and I have not found any RS232-USB cable of 20 meters. So if I can convert rs232 to wifi or ethernet I would see it more comfortable given the distance. here I leave a photo of the software http://prntscr.com/in7tj8[/img]
The 20 meter length for RS-232 is not a problem if you DON'T use twisted pairs. Twisted pairs make very good capacitors and that is what kills RS-232. Make your own cables. And perhaps reduce the speed. That's what everyone did in the good old days!
The real problem you have is not the distance, but being able to consolidate the connections to a single PC. At least that seems to be the problem from here. Am I wrong?
Paul