Virtual Com Port Server Setup Help Request

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

supwiddiss

Occasional Visitor
Looking for a little step by step from the Linux gurus to setup a virtual serial port over IP using a Prolific Technology Inc. USB-Serial Controller. It's an FTDI USB to DB9 adapter.
It shows on my RT-AC68P when plugged into the USB2 port.
I've installed Entware and I've been stumbling around the 'net trying to get detailed guides to get it setup as a com port to use with one of the Windows applications to control a serial port device.

The device is a satellite positional controller which has it's own application to read/write information to it.
The cable works fine attached to the controller and my pc.

I've found a few Linux programs and downloaded them and placed them on the USB memory stick. I can see the files using Windows network browser and in Putty.
The programs are .ipk files. So far I cant seem to find the commands to install ipk files.
Or how to run them once installed.

I also found and installed the following. The show in Putty using opkg list-installed:

usbip_legacy - 0.1.7-4
usbip_legacy-server - 0.1.7-4
usbutils - 013-2

But running them to configure so far is a fuzzy area I can't seem to figure out.
Nor if the possibility to install .ipk files if in fact setting up a USB Serial port over IP is better using one of those apps.

Can anyone help?
 

PeterR

Regular Contributor
I think running the Virtualhere USB server daemon on your router may be an easier route. They have a free limited functionality version that may serve the purpose. It works for me to share an Epson scanner on the network.
 
Last edited:

supwiddiss

Occasional Visitor
I think running the Vitualhere USB server daemon on your router may be an easier route. They have a free limited functionality version that may server the purpose. It works for me to share an Epson scanner on the network.
Would love to try it. It looks like I can run 1 device on the free version. Problem is, how to choose the right version and how to get it installed on my router. From the looks of it once installed I change settings from the config text file. But to get it installed? And to get it running.
I've used the USB printer option in the AC68 before.
I'm just a real, real rusty Linux user/
 

PeterR

Regular Contributor
Would love to try it. It looks like I can run 1 device on the free version. Problem is, how to choose the right version and how to get it installed on my router. From the looks of it once installed I change settings from the config text file. But to get it installed? And to get it running.
I've used the USB printer option in the AC68 before.
I'm just a real, real rusty Linux user/
I'm running it on an AC68U, you need this version https://www.virtualhere.com/sites/default/files/usbserver/vhusbdarm

My USB flash drive is mounted as 'USB', I installed the daemon in the entware/bin directory

Open a terminal
:
Code:
cd /tmp/USB/entware/bin
wget https://www.virtualhere.com/sites/default/files/usbserver/vhusbdarm
chmod +x vhusbdarm

Create a script in /jffs/scripts , I named mine 'vhusbd to start the daemon with an editor you're familiar with

Code:
/mnt/USB/entware/bin/vhusbdarm -c /root/vhusb.conf -i -b

set it executable (chmod +x vhusbd)

edit services-start and add the line:

Code:
/jffs/scripts/vhusbd startup &

You can start the daemon from the command line with:

Code:
/jffs/scripts/vhusbd
 

supwiddiss

Occasional Visitor

https://www.virtualhere.com/sites/default/files/usbserver/vhusbdarm


My USB flash drive is mounted as 'USB', I installed the daemon in the entware/bin directory

Okay. My USB flash drive with entware installed shows as:
/tmp/mnt/sda1
That was after cd ../ then ls.
Do I need to be in the entware/bin directory to proceed with your following?


Open a terminal
:
Code:
cd /tmp/USB/entware/bin
bin#
I managed to get into the /tmp/mnt/sda1 directory
When I cd /entware/bin I get:
-sh: cd: can't cd to /entware.
It looks like Merlin named the entire USB as entware on sda1.
So I cd /bin. Is that correct? Managed to enter the /bin# directory.
wget https://www.virtualhere.com/sites/default/files/usbserver/vhusbdarm
chmod +x vhusbdarm

Here's where it gets fun. Or not so fun. I put the first line in and on hitting enter I get this:


[email protected]:/bin# wget https://www.virtualhere.com/sites/default/files/usbserver/vhusbdarm
--2021-10-12 21:34:33-- https://www.virtualhere.com/sites/default/files/usbserver/vhusbdarm
Resolving www.virtualhere.com... 147.182.241.161
Connecting to www.virtualhere.com|147.182.241.161|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 349948 (342K) [application/octet-stream]
vhusbdarm: Read-only file system

Cannot write to 'vhusbdarm' (Success).
[email protected]:/bin#
[email protected]:/bin# chmod +x vhusbdarm[/CODE]

I know I screwed up somehow. But how?
Am I missing a step to change the directory from read only?
I got no further than this.



Create a script in /jffs/scripts , I named mine 'vhusbd to start the daemon with an editor you're familiar with

I've edited files in nano before. But never created any. I don't have favorite one due to not really needing one on a regular basis.
So, I need assistance here. I'm seeing CODE from a copy/paste.
I'll try it all again from keyboard entry.
Ok, I'm lazy!


Code:
/mnt/USB/entware/bin/vhusbdarm -c /root/vhusb.conf -i -b

set it executable (chmod +x vhusbd)

edit services-start and add the line:

Code:
/jffs/scripts/vhusbd startup &

You can start the daemon from the command line with:

Code:
/jffs/scripts/vhusbd


Appreciate your patience. Just trying to learn as I go.
Maybe Enigma 2 makes me lazy or is it an .ipk installer is just so much more easy?
 

PeterR

Regular Contributor
Okay. My USB flash drive with entware installed shows as:
/tmp/mnt/sda1
That was after cd ../ then ls.
Do I need to be in the entware/bin directory to proceed with your following?

From what I can infer, you don't have anything on your USB flash drive (sda1), you can save vhusbdarm there if you like, i.e.
Code:
cd /tmp/mnt/sda1
wget https://www.virtualhere.com/sites/default/files/usbserver/vhusbdarm

then adjust the vhusbd script accordingly

Code:
/tmp/mnt/sda1/vhusbdarm -c /root/vhusb.conf -i -b
 

supwiddiss

Occasional Visitor
Actually I do have Entware installed on sda1. I've also created an FTP share directory on it.
"From what I can infer, you don't have anything on your USB flash drive (sda1), you can save vhusbdarm there if you like, i.e."

Here is the directory structure of the flash drive and it showing in Windows network.

Putty_Dir.jpg



WIndows1.jpg


I'll try your new steps and see what happens. And get back to you. Thanks!

I guess. Give me a fish and I'll eat for the day. Teach me to fish and we can go fishing!
Please excuse my unfamiliarity in getting simple things like this installed and working.
 

supwiddiss

Occasional Visitor
A success and a failure. Permission Denied.
Searching the net for a solution to solve it. Nothing so far.
In Enigma2 I could easily set permissions using Filezilla.
Suggestions?

Permission_Denied.jpg
 

supwiddiss

Occasional Visitor
You need to:
Code:
chmod 755 vhusbdarm
I knew that! A little different in Filezilla, but the same.
Anyway. I located the .conf file and opened it in nano.
Am I not supposed to be able to edit the com port number and icp/ip port from here?
Read before I asked.
I was able to run the vhusbdarm -c /root/vhusb.conf -i -b command.
A bit stumped on the -i -b though.
I'm able to run the server. While running Putty is occupied until I terminate the application.
And on the client side I'm not able to see a virtual com port in devmgr.
Nano.jpg
 

PeterR

Regular Contributor
You need to download the Virtualhere client from the Virtualhere website for whatever platform you're using - windows, android ....
 

supwiddiss

Occasional Visitor
You need to download the Virtualhere client from the Virtualhere website for whatever platform you're using - windows, android ....
As stated I do have the client installed on Windows 10 and it launches with no virtual com ports listed.

This is getting a little confusing so could you please step back a bit and hopefully make things a bit more clear.
I have a USB drive on the Asus router. It is formatted and Entware is installed on it as per instructions.
In the Asus GUI I also have a subdirectory as an FTP Share.
In Putty I can ls both directories. And the same in Windows. I can see both directories (folders) and browse files in them.

In other words I can ls sda1 and I have "entware" and the FTP share directory "storage".

Are you saying I need to create a sub-directory in the Entware/bin directory ( sda/entware/bin/vhusbdarm) and THEN run the wget https://www.virtualhere.com/sites/default/files/usbserver/vhusbdarm script?

OR just install vhusbdarm in the bin directory?
In the entware directory there is already the vhusbdarm file. IF I try to mkdir vhusbdarm I get an error "file already exists"......thats cool. Why won't it let me create a directory?

You also mentioned to chmod 755 vhusbdarm. I did. Still getting can't do this and can't do that errors.


Since Entware doesn't obviously have a virtual serial port application I believe I need to just reformat and start all over.
And if you could explain what "/tmp/mnt/sda1/vhusbdarm -c /root/vhusb.conf -i -b" is doing?
Not finding info. on the -b and -b switches any place.

You mentioned "then adjust the vhusbd script accordingly".
The only place that .conf file exists is in the root bin directory of the router (not on the USB).
And as you see above there are no places to set com port assignment or port.
Is this a limitation of the free version? Where would I find the port assignments?
The Windows client is not showing ANY virtual (or real) com ports.

A little confusing? Well you're correct!
 

supwiddiss

Occasional Visitor
Most of the errors are in screenshots above in my replies.
I guess the assumption is that I (was) working in the root of my flash drive.
Installing Entware and an FTP share changed that. I attempted to familiarize myself with Linux commands to simply reformat the drive. Surely not a task for a noob like me.
Although In Ubuntu and other flavors working in terminal hasn't been that difficult.

AMTM saved my life and some hair pulling. I have the drive reformatted in one partition with EXT4.
So, ready to give it another go.

Looking up commands and switches like the -i & -b and what they do is kind of difficult. Never found out what they do.
Nor if vhusbdarm can be placed anywhere I please and the config file can be placed someplace else.
Some places say it the vhusb.conf file is in the router under /bin.
I'm of the belief that I'm supposed to find it in the root of the flash drive along with the vhusbdarm program. So, conflicting info there.

As for the errors I listed the flash drive and saw vhusbarm and vhusbdarm.1
I tried to mkdir to create a subdirectory named vhusbdarm.
That's where one error popped up telling me that the file already existed.
I didn't want to create a file, a new directory yes!

PeterR makes it look simple. Not really so much. And the Virtualhere site has iffy install/config instructions.
The easiest task was installing and running the client under Windows.
But errors there with "install a driver" and "no driver found".
My device attached to the FTDI USB to serial adapter doesn't require any drivers and I need a simple com port for it to communicate with my laptop. Instead of running 3 meters of USB cable extension.

So. USB formatted in 1 partition with EXT4. Let's see what happens.
 

PeterR

Regular Contributor
Looking up commands and switches like the -i & -b and what they do is kind of difficult. Never found out what they do.
Nor if vhusbdarm can be placed anywhere I please and the config file can be placed someplace else.
Some places say it the vhusb.conf file is in the router under /bin.
I'm of the belief that I'm supposed to find it in the root of the flash drive along with the vhusbdarm program. So, conflicting info there.
You can place vhusbdarm (and also the config file) wherever you have write permissions.

The FAQ is a good place to start reading https://www.virtualhere.com/configuration_faq.

Output from 'vhusbdarm -h' on my router:

Code:
ASUSWRT-Merlin RT-AC68U 386.4_alpha1-g8f4afe6890 Wed Aug 11 16:44:26 UTC 2021
[email protected]:/tmp/home/root# /tmp/mnt/USB/entware/bin/vhusbdarm -h
vhusbdarm v4.3.3
VirtualHere USB Server for Unknown
Use USB Devices over the network
(C) VirtualHere Pty. Ltd 2010-2021
https://www.virtualhere.com

usage: vhusbdarm [-bhliqnu] [-c <configuration file>] [-r <log file>]

options:
   -b run as daemon in the background
   -c configuration file
   -h display this usage
   -l display license text
   -i prefer ipv6 (dual/stack)
   -r log to file instead of syslog

[email protected]:/tmp/home/root#

I suggest you run vhusbdarm from the command line when debugging, it may help to see any messages.


As for the errors I listed the flash drive and saw vhusbarm and vhusbdarm.1
I tried to mkdir to create a subdirectory named vhusbdarm.
That's where one error popped up telling me that the file already existed.
I didn't want to create a file, a new directory yes!

PeterR makes it look simple. Not really so much. And the Virtualhere site has iffy install/config instructions.
The easiest task was installing and running the client under Windows.
But errors there with "install a driver" and "no driver found".
My device attached to the FTDI USB to serial adapter doesn't require any drivers and I need a simple com port for it to communicate with my laptop. Instead of running 3 meters of USB cable extension.

So. USB formatted in 1 partition with EXT4. Let's see what happens.
 

supwiddiss

Occasional Visitor
Don't know what really happened but it is working and I see Com 5 on my pc.
I'm able to open the satellite motor control application and use it.
For giggles, is your vhusbd.conf file populated? Mine is empty.
Care to share what you might have in it?
For the longest time the client application showed my router ip but there were no Com Ports listed in device manager.

Oh. I spent lots of time surfing the FAQ and the help forums.

I do thank you for you guys' patience. I was a bit frustrated for something so simple.
 

PeterR

Regular Contributor
Don't know what really happened but it is working and I see Com 5 on my pc.
I'm able to open the satellite motor control application and use it.
For giggles, is your vhusbd.conf file populated? Mine is empty.
Care to share what you might have in it?
For the longest time the client application showed my router ip but there were no Com Ports listed in device manager.

Oh. I spent lots of time surfing the FAQ and the help forums.

I do thank you for you guys' patience. I was a bit frustrated for something so simple.
This is my vhusb.conf file, the parameters are listed in the FAQ.

ID 04b8:014a is an Epson scanner, I disallow access to the USB flash drive

Code:
It=1632853801
EasyFindId=R1eEF7tvHB8gGxuJEFLgQc
EasyFindPin=73GksF
AllowedDevices=04b8:014a
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top