Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello, new to the forums and hopefully can get some expert advice!
I am trying to setup a digital scale with the RS-232 interface. it is connected to COM3.
I need to communicate with the scale at 9600, n, 8, 1, which I think is default (or do I need to set the COM port in Linux first?)
In Windows, I send the P character over Hyperterminal to the COM3 port and the scale responds with the weight (something like 5.00LBS.)
I am trying to see if I can get the same scenario in Linux (Ubuntu)
I opened 2 temrinals, I execute ""cp /dev/ttyS2 /dev/tty" in terminal1.
From terminal2 I exexute "echo P >/dev/ttyS2'
Expected output: get the scale to respond with the weight
Actual output in terminal2: no output
I believe I am missing something.
Hello, new to the forums and hopefully can get some expert advice!
I am trying to setup a digital scale with the RS-232 interface. it is connected to COM3.
I need to communicate with the scale at 9600, n, 8, 1, which I think is default (or do I need to set the COM port in Linux first?)
In Windows, I send the P character over Hyperterminal to the COM3 port and the scale responds with the weight (something like 5.00LBS.)
I am trying to see if I can get the same scenario in Linux (Ubuntu)
I opened 2 temrinals, I execute ""cp /dev/ttyS2 /dev/tty" in terminal1.
From terminal2 I exexute "echo P >/dev/ttyS2'
Expected output: get the scale to respond with the weight
Actual output in terminal2: no output I believe I am missing something.
Why are you copying /dev/ttys2 to /dev/tty??? What's the purpose of that, since...
...your next command does nothing with /dev/tty??
How do you know what serial port you're using
And how are you plugging in to the scale? USB? Most computers these days don't even HAVE a serial port, but USB to serial devices work fine. They are typically /dev/ttyUSB0, etc. As to whether you need to set the baud first...we don't know. You don't tell us anything about your hardware, or the version/distro of Linux you're using.
You can try to load a program called minicom (like hyperterm), but we can't tell you how, since you don't tell us what Linux you're using, and set baud/etc., from there.
Why are you copying /dev/ttys2 to /dev/tty??? What's the purpose of that, since...
...your next command does nothing with /dev/tty??
How do you know what serial port you're using
And how are you plugging in to the scale? USB? Most computers these days don't even HAVE a serial port, but USB to serial devices work fine. They are typically /dev/ttyUSB0, etc. As to whether you need to set the baud first...we don't know. You don't tell us anything about your hardware, or the version/distro of Linux you're using.
You can try to load a program called minicom (like hyperterm), but we can't tell you how, since you don't tell us what Linux you're using, and set baud/etc., from there.
Thank you for the response.
Regarding why am I copying- I followed an example from the link I originally provided. If I need to listen to the COM port somehow different- please explain how.
Regarding the COM port I run "dmesg | grep tty" and confirm the ports
Regarding how I am plugging in the scale- true serial port. Both the scale and the system have the RS-232.
OS: I am using Ubuntu 16.04.3 LTS.
system platform - the system is based off Intel Bay Trail J1900
More on this:
I connected the cable (to ensure my COM are working under Linux) to another system and executed "cat /dev/ttyS0" (COM1) . I then sent "echo "Hello" > /dev/ttyS2" (COM3)
I did receive the message, then I tried sending the message from ttyS0 to ttyS2 and it is OK.
Still cannot get the response from the scale.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.