Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:39 28 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : LINUX: Getting Mint to see a USB com port...

Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 01:54am 12 Jun 2023
Copy link to clipboard 
Print this post

I'm trying to get a Prolific USB-serial adaptor working in Mint 20, but Mint basically refuses to see it or talk to it, BUT Mint knows it is there.

I have a feeling, I have to add the device to the dialout group, but I forget how you do that, as I don't use Linux commandline on a daily basis.

Can one of the Linux gurus here please help?





I am trying to use the adaptor with PuTTY, but PuTTY refuses to even SEE the adaptor, so the problem is two-fold:

1) I need to make Mint allow PuTTY to "SEE" the adaptor at a standard Linux serial-port path such as /dev/ttyACM0

2) I then need to add myself to the dialout group, as I think that is disabled by default, and you have to have that enabled to allow use of serial ports in Linux.

Thanks for any help.

I did look at Mr. Google, and there are a plethora of results, and it is all so confusing as different websites use different methods and I get totally lost.  
Smoke makes things work. When the smoke gets out, it stops!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6100
Posted: 02:36am 12 Jun 2023
Copy link to clipboard 
Print this post

You have to be a member of the dialout group.
You have to logout and back in for it to take effect.

You might have to get rid of modemmanager
sudo apt-get purge modemmanager
The commands to get rid of it may vary. Search the forum.

What is the output of dmesg

A lot of Prolific devices are clones and Prolific got sneaky in order to stop the clones working on Windows. I don't thik that is the case for LInux.

Jim
VK7JH
MMedit   MMBasic Help
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 339
Posted: 02:37am 12 Jun 2023
Copy link to clipboard 
Print this post

Most USB adaptors are listed in /dev as ttyUSBx
where x is a number from 0 to the total number of USB serial adapters - 1.

That's how my Prolific USB to serial adapter is listed.
 
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 571
Posted: 04:35am 12 Jun 2023
Copy link to clipboard 
Print this post

my checkcomms.sh

#!/bin/bash

echo "Comms are"
echo "------- USB's ---------"
ls -l /dev/ttyUSB*
echo
echo "------- ACM's ---------"
ls -l /dev/ttyACM*
echo
echo "plug in device press key"
read $key
echo
echo "Any thing new "
echo
echo "------- USB's ---------"
ls -l /dev/ttyUSB*
echo
echo "------- ACM's ---------"
ls -l /dev/ttyACM*
echo
read $key
exit



crude but has worked for years.

came out of
lsusb

ls /dev/tty*

ls /dev/ttyACM*

ls /dev/ttyUSB*

hope it helps

thinking of MMB4L as a shell for things like this just haven't had time to play.

Quazee137
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 04:42am 12 Jun 2023
Copy link to clipboard 
Print this post

usermod -a -G dialout $USER

you may need a sudo in front of that too.

does GFXterm see it?


cheers,
rob   :-)
 
andreas

Senior Member

Joined: 07/12/2020
Location: Germany
Posts: 207
Posted: 05:17am 12 Jun 2023
Copy link to clipboard 
Print this post

to see the groups you are in: groups
to add an existing user to an existing group:adduser <user> <group>

ls /dev/
plugin device
ls /dev/

..and compare what changed ;-)

or

dmesg just after plugging in the device

-andreas
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 06:00am 12 Jun 2023
Copy link to clipboard 
Print this post

Lots of replies!
Thanks!  

My Prolific unit IS a genuine article.
Cost about $30 from Jaycar.
I am NOT trying to use one of the often problematic eBay clone ones(often in translucent iMac blue colour).





@ Rob - can you link me to the Linux version of GFXterm?  I only have the Windows ones, and I can't remember where I got those from now!

dmesg result is HUGE, so I can't take a photo of it.  Is there a command to make it save the result as a text file somewhere I can copy it from?  It may not be needed anyway - see below...

@ Quazee137: This is the output I get from those commands...





From what I can tell from this, I am already a member of the dialout group, and I think the Prolific adaptor is at /dev/ttyUSB0.

Inside PuTTY, I cannot select /dev/ttyUSB0.  All it will let me select is /dev/ttyS0.
I cannot backspace and even TRY to type in the USB0 location - backspace has no effect.

EDIT: Hold the phone - In PuTTY, right down the bottom of the config window, under Category, I can enter in the /dev/ttyUSB0 reference there, and it seems to open OK.
Now I just need to connect something up to be sure it is working....
Edited 2023-06-12 16:08 by Grogster
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 06:20am 12 Jun 2023
Copy link to clipboard 
Print this post

COM port is now working in PuTTY.  

Would prefer to use GFXterm though, so Rob - as soon as you see this....
Smoke makes things work. When the smoke gets out, it stops!
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 722
Posted: 06:36am 12 Jun 2023
Copy link to clipboard 
Print this post

  Grogster said   Now I just need to connect something up to be sure it is working....


A piece of wire between pin 2/3 gives a nice echo🤓
Edited 2023-06-12 16:37 by atmega8
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 722
Posted: 06:51am 12 Jun 2023
Copy link to clipboard 
Print this post

Modemmanager,
NOT
modemanager!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 07:14am 12 Jun 2023
Copy link to clipboard 
Print this post

Yes, I should have thought of the loopback test!
However, I had a thing on the bench ready to connect to it, which I knew worked on the same Prolific adaptor and a Windoze laptop, so....

  Quote  Modemmanager,
NOT
modemanager!


F-ing Linux!  

Totally missed that extra "m" - very well hidden.....

In any event, it did not seem to matter, as the COM port is working now.
Smoke makes things work. When the smoke gets out, it stops!
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4043
Posted: 09:29am 12 Jun 2023
Copy link to clipboard 
Print this post

  Grogster said  Is there a command to make it save the result as a text file somewhere I can copy it from?


dmesg > out.txt


Use > to redirect the standard output from any console command to a file.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 11:38am 12 Jun 2023
Copy link to clipboard 
Print this post

try the following:

dmesg -w

this waits after printing all the messages, adding new messages as they arrive - press ctrl-C to exit. so with dmesg waiting, hit the enter key a few times (to create some blank lines) and then plug in your USB device to see the new messages associated with it displayed. hit the enter key a few more times (for more blank lines) then unplug the USB device to see 'unplug' events.


ModemManager is a right pain. when active, if it sees a serial device plugged in that it thinks may be a modem, it proceeds to try talking to it. if the device is a modem, this is all fine and dandy. if it is not a modem things can quickly go to custard as the device gets thoroughly confused by the gobbledygook being sent to it. TassyJim's advice to simply get rid of it is sound.


GFXterm's new home is here:
https://github.com/robert-rozee/GFXterm

the binaries folder contains pre-compiled binaries for 32- and 64-bit linux, as well as win32. in theory, it should also be possible to compile for RPi.

new changes are:
1. anything being pasted that is only one line long now does NOT have a carriage return appended (as requested by Frank N. Furter), and,
2. there is now a new menu option, "screen size" that enables you to manually set the screen size to anything between 40x16 and 160x60. this should accommodate the needs of the pico versions of MMbasic.


cheers,
rob   :-)
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3150
Posted: 12:01pm 12 Jun 2023
Copy link to clipboard 
Print this post

Re dmesg, if you start up your device and then plug in the USB/serial module "dmesg | tail" will usually give you what you want, e.g., ttyUSB0 (or the like).
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Andy-g0poy
Regular Member

Joined: 07/03/2023
Location: United Kingdom
Posts: 59
Posted: 12:08pm 12 Jun 2023
Copy link to clipboard 
Print this post

Permissions are assigned to users as are groups
Use whatever user manager you normally use. This will need to be run as root.
Permission changes sometimes need you to log out and log back in again

The backspace issue: putty defaults to using (I think) 127 as backspace. Backspace is control+H try that and see it it works. If so there is a putty setting that sets the backspace behaviour, choose the send control H option

You can't usually access a dev with an ls. devs are files.

Use ls -l (long listing to get a bit more info, and remember to pass the output through grep is things get too long

ls -l /dev | grep ttyU

will pull out all the ttyUSB devices.

grep is also useful for taming dmesg

Andy
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 12:21am 13 Jun 2023
Copy link to clipboard 
Print this post

Lovely, thanks for the pointers, chums.

I have now removed modemmanager using the extra m this time.  It completed without errors, so that should now be gone.

EDIT: @ Rob - Can download the file, but Mint does not know what to do with it.  Mint moans that the file has no application associated with it.  The file has NO extension, and the W10 machine I downloaded it on, just refers to it as filetype "File".

Do I need to rename and add an extension perhaps?
Edited 2023-06-13 10:26 by Grogster
Smoke makes things work. When the smoke gets out, it stops!
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2350
Posted: 02:21am 13 Jun 2023
Copy link to clipboard 
Print this post

right-click on the file's icon and select 'Properties' from the menu. this will bring up a window with three tabs, the right-most is the one you want, 'Permissions'. here you will find a checkbox with the text "Allow this file to run as a program".

check this checkbox, this will then allow the file to be run.

with linux, extensions don't have any special meaning in the same way as they do with windows, so no need to rename anything.


cheers,
rob   :-)
Edited 2023-06-13 12:23 by robert.rozee
 
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 571
Posted: 02:23am 13 Jun 2023
Copy link to clipboard 
Print this post

bring up nemo or other file mgr you use

right click on


click box




from here on in it should just run.


Quazee137
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 03:51am 13 Jun 2023
Copy link to clipboard 
Print this post

Excellent, thanks chums!

All up and running.
Smoke makes things work. When the smoke gets out, it stops!
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024