Choose style:

Author Topic: Serial to USB (SOLVED)  (Read 486 times)

0 Members and 1 Guest are viewing this topic.

Offline emegra

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1916
  • Karma: 415
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9 64bit
Serial to USB (SOLVED)
« on: August 16, 2019, 05:10:17 am »
Hi guys

I'm still working on my friends laptop, and I'm trying to get a weight monitor device to connect to Peppermint, this device connects to a weighbridge via a serial connection and to a PC/laptop also via a serial connection he's been using a serial to usb cable that comes with a Windows & Mac driver (no linux driver surprise surprise), and then connecting via Putty, I can't see any reason why this shouldn't work in Linux if I can find a driver to convert the serial signal to usb such as the Windows & Mac driver that comes with the cable.

So my question is does anyone know of a Linux driver or any other way I can solve the problem ?


Graeme
« Last Edit: August 22, 2019, 04:21:23 pm by emegra »
If you can keep your head while all around are losing theirs then you're not quite grasping the situation

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26277
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Serial to USB
« Reply #1 on: August 16, 2019, 04:45:33 pm »
With the USB to Serial adapter plugged in, what's the output from
Code: [Select]
lsusb
then unplug the adapter .. wait 5 seconds .. replug the adapter .. then post the output from:
Code: [Select]
dmesg | tail -n 30
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline emegra

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1916
  • Karma: 415
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9 64bit
Re: Serial to USB
« Reply #2 on: August 21, 2019, 02:40:26 pm »
Outputs as requested, apologies for the time it's taken to get back to you, I have a lot going on right now

Code: [Select]
grant@Grants-Thinkpad ~ $ lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 003 Device 004: ID 04f2:b39a Chicony Electronics Co., Ltd
Bus 003 Device 003: ID 8087:07dc Intel Corp.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub[/code
[code]

grant@Grants-Thinkpad ~ $ dmesg | tail -n 30
[  306.634875] usb 3-3: USB disconnect, device number 2
[  306.635273] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
[  306.635325] pl2303 3-3:1.0: device disconnected
[  328.136779] usb 3-3: new full-speed USB device number 5 using xhci_hcd
[  328.285803] usb 3-3: New USB device found, idVendor=067b, idProduct=2303, bcdDevice= 3.00
[  328.285808] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  328.285812] usb 3-3: Product: USB-Serial Controller
[  328.285814] usb 3-3: Manufacturer: Prolific Technology Inc.
[  328.287490] pl2303 3-3:1.0: pl2303 converter detected
[  328.288435] usb 3-3: pl2303 converter now attached to ttyUSB0
[  380.314700] usb 3-3: USB disconnect, device number 5
[  380.315106] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
[  380.315141] pl2303 3-3:1.0: device disconnected
[  391.788883] usb 3-3: new full-speed USB device number 6 using xhci_hcd
[  391.937702] usb 3-3: New USB device found, idVendor=067b, idProduct=2303, bcdDevice= 3.00
[  391.937705] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  391.937707] usb 3-3: Product: USB-Serial Controller
[  391.937708] usb 3-3: Manufacturer: Prolific Technology Inc.
[  391.939129] pl2303 3-3:1.0: pl2303 converter detected
[  391.939965] usb 3-3: pl2303 converter now attached to ttyUSB0
[  470.095727] usb 3-3: USB disconnect, device number 6
[  470.096216] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
[  470.096269] pl2303 3-3:1.0: device disconnected
[  481.544642] usb 3-3: new full-speed USB device number 7 using xhci_hcd
[  481.693840] usb 3-3: New USB device found, idVendor=067b, idProduct=2303, bcdDevice= 3.00
[  481.693844] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  481.693847] usb 3-3: Product: USB-Serial Controller
[  481.693849] usb 3-3: Manufacturer: Prolific Technology Inc.
[  481.695463] pl2303 3-3:1.0: pl2303 converter detected
[  481.696302] usb 3-3: pl2303 converter now attached to ttyUSB0
grant@Grants-Thinkpad ~ $ [/code



Graeme


If you can keep your head while all around are losing theirs then you're not quite grasping the situation

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26277
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Serial to USB
« Reply #3 on: August 21, 2019, 03:24:27 pm »
Have you seen this
https://askubuntu.com/questions/471821/pl2303-attached-to-ttyusb0-change-it-to-ttys

it seems like the PL2303 adapter is probably working, but you may need to add yourself to the dialout group before you can access it.

Probably wisest/safest to add yourself to dialout via:-
Menu > Settings > Users and Groups
rather than by using the command at the above link
« Last Edit: August 21, 2019, 03:27:37 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline emegra

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1916
  • Karma: 415
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9 64bit
Re: Serial to USB
« Reply #4 on: August 22, 2019, 04:40:02 am »
Ok i did as you suggested and added the user to the dialout group but sadly i'm still not getting anything working

to give you some background this is completely new to me and I've never seen it working but from what I understand when it's plugged in a terminal window should open up via PuTTY and live data from the weighbridge should be displayed in the terminal.

the device I'm trying to connect is a simulator that streams the same data a weighbridge would if it was connected the output weight can be adjusted with a dial.

To add to the confusion he told me it was working in Windows 10 but when we tried it it wasn't working, it's doing exactly the same as it's doing in Linux,

The serial to USB cable he has comes with a Windows driver which appears to have been installed I say that because when I run the disc I'm only given the option to uninstall or reinstall so I don't know why it's not working in Windows either yet he assured me it was, so it's quite probable that whatever reason it's not working in Windows is the same reason it's not working in Linux, what he can't be sure of is that it's the same cable that worked in Windows, so do I have a faulty or incompatible cable, so my view is to get this working in Windows first because I know it does work in Windows and go from there. but I'd appreciate any advice anyone can give me,

He desperately want's to run Linux as much as possible and I want to help him do that but to be honest I've bitten off more than I can chew and it's getting me down :(


Graeme


« Last Edit: August 22, 2019, 04:46:54 am by emegra »
If you can keep your head while all around are losing theirs then you're not quite grasping the situation

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 1997
  • Karma: 344
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8, 9
Re: Serial to USB
« Reply #5 on: August 22, 2019, 05:31:14 am »
from what I understand when it's plugged in a terminal window should open up via PuTTY and live data from the weighbridge should be displayed in the terminal.


That must be a function of the Windows software. Have you tried installing statserial as in the terminal commands in Mark's link?

Offline emegra

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1916
  • Karma: 415
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9 64bit
Re: Serial to USB
« Reply #6 on: August 22, 2019, 06:52:42 am »

Quote
That must be a function of the Windows software. Have you tried installing statserial as in the terminal commands in Mark's link?

Not yet to be honest I find most of the info on that link a little hard to get my head round, ie is it suggesting I use statserial in the terminal to make the connection ?, or do I just need to make config changes using statserial ?, can I still use PuTTY to make the connection ?.

My guess is I use statserial to make config changes so PuTTY can communicate but I'm not sure


Graeme

If you can keep your head while all around are losing theirs then you're not quite grasping the situation

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 1997
  • Karma: 344
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8, 9
Re: Serial to USB
« Reply #7 on: August 22, 2019, 07:30:30 am »
Putty is the Windows-only equivalent of SSH. The link suggests that you read the device's info via statserial. Apologies I don't have time to look into this further at the moment.

« Last Edit: August 22, 2019, 07:44:03 am by murraymint »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26277
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Serial to USB
« Reply #8 on: August 22, 2019, 07:41:45 am »
Well like I said the USB to Serial adapter seems to be recognised and working.
(so no additional drivers should be necessary .. at least as far as the adapter is concerned)

It's also possible to install PuTTY in Linux
https://numato.com/blog/how-to-install-putty-on-linux/
(though probably not strictly necessary .. Linux already has TTY functionality)

But if this thing requires any Windows specific software (in addition to PuTTY) to work you may be in a world of problems.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline emegra

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1916
  • Karma: 415
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9 64bit
Re: Serial to USB
« Reply #9 on: August 22, 2019, 09:15:53 am »
I've already installed PuTTY from the repos, The only Windows software I'm aware of is the driver disc that comes with the serial to USB cable, but as I said in my earlier post this is not working in Windows now either although he assures me it did  but he can't guarantee it worked with that particular cable, so I have to question the cable, is it possible I have a faulty or incompatible cable.

I don't see any point in beating my head against a brick wall anymore trying to get this running in Linux untill I get it working in Windows so I can be sure the cable's good

Does that make sense ?


Graeme



If you can keep your head while all around are losing theirs then you're not quite grasping the situation

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26277
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Serial to USB
« Reply #10 on: August 22, 2019, 10:16:41 am »
Makes perfect sense .. taint gunna werk in Linuks if its broked.
« Last Edit: August 22, 2019, 10:19:11 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline emegra

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1916
  • Karma: 415
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9 64bit
Re: Serial to USB
« Reply #11 on: August 22, 2019, 12:07:12 pm »
Quote
Makes perfect sense .. taint gunna werk in Linuks if its broked.

if the cables broked taint gunna werk in windirs ither :)

But my rationale is I know it can work in Windows I don't know for certain if it can work in Linux,  I need to establish the cable's good before I go any further and it would be simpler to do that on a system I know it can work on rather than on one where i have some doubt



Graeme

If you can keep your head while all around are losing theirs then you're not quite grasping the situation

Offline emegra

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1916
  • Karma: 415
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9 64bit
Re: Serial to USB
« Reply #12 on: August 22, 2019, 02:17:26 pm »
OK I've got this working in Windows he had saved settings in PuTTY saved as "test" , so after reinstalling the driver I used these settings and it worked fine the settings are as follows
COM5
Speed 4800
Data Bits: 7
Stop Bits: 2
Parity: Even
Flow Control: Xon/Xoff

So I can say for definite there's nothing wrong with the cable and as far as i can see there's no additional Windows software to make this work

I tried using the identical settings in Linux but I get the following error message

Quote
Unable to open connection to /dev/ttyS0:
Unable to configure serial port

Statserial gives the following output

Code: [Select]
grant@Grants-Thinkpad ~ $ statserial /dev/ttyS0
statserial: TIOCMGET failed: Input/output error
grant@Grants-Thinkpad ~ $



Any ideas ?

Graeme
« Last Edit: August 22, 2019, 02:19:15 pm by emegra »
If you can keep your head while all around are losing theirs then you're not quite grasping the situation

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26277
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Serial to USB
« Reply #13 on: August 22, 2019, 03:11:10 pm »
According to your dmesg output, the PL2303 is at ttyUSB0
« Last Edit: August 22, 2019, 03:14:51 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26277
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Serial to USB
« Reply #14 on: August 22, 2019, 03:15:25 pm »
Try opening putty with
Code: [Select]
gksudo putty
then select Serial and enter /dev/ttyUSB0

Source:
https://askubuntu.com/questions/674723/how-to-use-the-digitus-serial-to-usb-adapter
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec