I have two (2) FTDI USB to Serial adapters each with a unique identifier. In my work with PIC microcontrollers and M.S. Windows O.S. apps I have established working code to send async. serial commands from a P.C. app to the PIC. I read on the "net" that people use an app called "moserial" specifically for communicating with embedded systems like this.
Recently I downloaded and installed "moserial" on my pioneering setup of Ubuntu MATE. I say "pioneering" because I am just beginning to do things with version 18.04 of MATE on an older ASUS laptop (K50i.) The install appears to have succeeded and I can open the "moserial" app on my desktop and look around at the various features. In may ways it is similar to the terminal emulator app I have on my Windows P.C.'s
The task I need help with is the connecting of the FTDI devices. I sometimes use the two FTDI adapters connected with a null modem and two terminal emulator apps to just test each setup by messaging back and forth between them. For instance one appears to the O.S. as COM3 and the other as COM4.
So I did the FTDI setup on MATE and used an FDTI provided test program to read the device internal data and it worked as required. I then did a lsusb with the two devices plugged in and got this good listing. See IMAGE 1 below.
I opened "moserial" and looked at all the devices listed in my /dev directory. I recall reading that it should be something like "ttyUSB0" It turns out that when both devices are plugged in the "Device" dropdown list offers /dev/ttyUSB0 and /dev/ttyUSB1. See IMAGE 2 below.
I selected both devices in individual tests and got an error.
So even with either device showing up in the Port Setup menu. See IMAGE 3 below.
Do I still have to execute some command line instructions to get the hardware to be recognized by the app? Do I have to mount the devices as is typical for UNIX?
Sorry I had to get creative with the screenshots since I was allowed only one embedded graphic object.
I used to control Cisco equipment using their USB and serial2usb adapters. Shame for me, I do not remember which terminal emulator has been used for the purpose. Something good and simple with short (2 letters?) name.
The procedure:
connect usb cable to PC
tail dmesg to see which usb device came into action
chmod /dev/ to grant r/w rights to myself/everyone
The first bullet point- I have done this and a lsusb command reports the two devices as ttyUSB0 & ttyUSB1.
The Second bullet point: I haven't attempted this because without the correct command syntax I don't know how to use your suggestion.
The third bullet point: An install procedure I got from FTDI instructs me (during the driver install) to enter "chmod 0755" to make the devices available to all users even though mine is a single user system.
The third bullet point is exactly what I am posting about- I have launched the emulator and it does not connect even after selecting the ttyUSB0 or ttyUSB1 devices in the drop down menu.
I don't understand (given my present level of experience with Linux) what belonging to a dialup group means nor do I know what 666 perms is referring to. I need more information on this procedure and what the significance is.
So as it stands today I still don't have a working solution but I would like to share where this endeavor is heading.
I looked at the link provided by ugnvs on 31 Jan and in particular noticed the "putty" solution proviced in that link. In previous attempts (a few years ago) trying a Linux set up on a spare computer I recall running across the "putty" way to hook up to a terminal. These days there is a reason I am interested in moserial as I said in my first post. Others seem to use it while developing serial comms with embedded systems.
In the M.S. P.C. world we first used "Hyperterminal" and then M.S. dropped it's inclusion in the native O.S. Getting a licensed edition was pretty pricey. I searched around and as I used "Visual Studio C#" I was able to find at no charge desktop apps coded in that development space. I found a good one and use it even now.
For the embedded development I found that some implementations in the PIC microcontroller would work smoothly if a string of characters coming from the desktop app was terminated with newline, or linefeed or carriage return ASCII codes. Thus I tweaked the terminal emulator program in C# to allow me to choose which ever one I wanted before sending the string out the port.
I don't know how customizable the various terminal emulators available for MATE are. I would like to eventually be able to tweak and compile such emulator code to run on MATE. In fact if I ever expected a Linux O.S. to replace what I have with M.S. desktop apps I would have to be able to do just that.
Devices in /dev/tty* have dialout as group so you need to be part of that group in order to access them. if you look in /etc/group you will find a dialout group. Permissions 660 for /dev/ttyUSB0 shown here.
crw-rw----+ 1 user dialout 188, 0 Feb 2 12:22 ttyUSB0
I would look into Arduino IDE 1.8.19 which makes programming much easier than using cu or minicom or some other serial program.
I finally had time to try your suggestions and ran into a difficulty. I found out that there is no dialout group in etc directory on my system. I have attached two screenshots one shows that the two hardware devices can be found in the dev directory.
As the second screenshot shows no dialout directory has yet been established. Is there still some obscure command line input which has been missed in the preparation of the USB port availability to the O.S.?
Keeping in mind that this is a new virgin setup of MATE, is there a suite of setup procedures I have yet to install? What I am learning about MATE is that while some things are set up automatically after running install scripts for apps, the reality is that there are many more things that are not.
I am reading up on chmod to determine the right syntax to use when changing permissions. I remember some of this stuff from my experience with UNIX from a couple decades ago but the exact syntax escapes me now.
What @pavlos_kairis wrote in his earlier post, in this topic, is that "(...) if you look in /etc/group you will find a dialout group. (...)". What Pavlos meant by that, is that if you look in the file called group that is located inside the /etcdirectory, you will find that, among the many lines of that file, there is a line for a group called dialout
So, if you type the following command now, you will probably find that the user afb is NOT (yet) part of the dialout group:
groups afb
To add your user afb to that dialout group (as one of the secondary groups of the user afb) please type the following command:
sudo usermod -a -G dialout afb
After you do that, if you then type again the following command, you will most likely find that the dialout group is now one of the groups associated with the afb user:
groups afb
I hope this helps. Please, keep us posted
UPDATE (7th February 2025): I've edited this post of mine to add the missing sudo in the beginning of the usermod command. Thanks for the alert, @pavlos_kairis
you need sudo usermod since it writes to /etc/group
after the change you need to logout/login.
user@um24:~$ groups
user adm cdrom sudo dip plugdev users lpadmin
user@um24:~$ sudo usedmod -a -G dialout user
logout/login
user@um24:~$ groups
user adm dialout cdrom sudo dip plugdev users lpadmin
Just to report back that all of you peoples' help resulted in working moserial (with qualifications.)
Two FTDI USB/Serial port devices connected with a null modem showing as ttyUSB0 & TTYUSB1 running two instances of "moserial." There were some quirks in the application that I need to figure out but serial ASCII text was definitely crossing between the connections. I can see why this app is useful to embedded code developers because it offers several string termination characters just like how I modified a MS Windows app I have for a terminal emulation.
pavlos,
I though I might show you the result of my typing the "groups" command. I have a question about one item on the list. Mainly do you know what it is and is it "Friendly"?