PDA

View Full Version : Linux Mint terminal window to USB


rans6andrew
25th Mar 2015, 14:57
I want to open a terminal window on my Linux Mint desktop machine and have it take all of it's input (all text) from the USB port and send all of it's output (again all text) back to the same USB port.

I have put together the necessary hardware to get ASCII characters to and from the USB port using a bluetooth link from a netbook PC in another room.

I have sussed the PC end USB to Bluetooth signal. When inserted the PC detects new hardware and I have the FTDI driver file on the PC which installs itself and allows me to talk through the USB to the Bluetooth RF nodule via a TeraTerm serial comms terminal emulator.

When I plug the USB to Bluetooth hardware into the Linux machine it doesn't detect it, I don't know if it should or whether I need any specific drivers to be installed.

What do I need to get the final connectivity between the Linux Terminal window and the USB port, in both directions, up and running?


Rans6.........

mixture
25th Mar 2015, 15:14
take all of it's input (all text) from the USB port and send all of it's output (again all text) back to the same USB port.

You what ? :confused:

Have you really seriously eliminated all possible alternative engineering options before resorting to want to do the contortions described above ? Sounds awfully convoluted and 'hacky' to me !

The drawing board summons you my friend. :cool:

rans6andrew
25th Mar 2015, 15:38
I know it may sound a bit strange but.......

I am testing/evaluating several bluetooth radio links for something work related but I also want to be able access the C compiler on my Linux machine when I am in the other room with my netbook on my knee. Since I had to buy the Blue tooth hardware out of my own pocket..........

The editing and compiling of C programmes is all text input from the keyboard normally, most of the programmes I want to play with produce numerical or text output so why not combine the two activities?

Rans6...,

mixture
25th Mar 2015, 15:44
I also want to be able access the C compiler on my Linux machine when I am in the other room with my netbook on my knee

What's wrong with SSH over your LAN network ?

I'm going to re-read both your posts, but I'm awfully confused... :confused:

rans6andrew
25th Mar 2015, 16:08
I still need to play with the BT hardware

ExGrunt
25th Mar 2015, 17:51
Hi R6,

If I understand your request you have a USB bluetooth device which when connected to a PC initiates as a serial interface using a FTDI driver.

You are now trying to do the same thing on Linux mint. If that is correct then you need the FDTI driver which should be included in linux mint (If not then correct driver can be downloaded from ftdichip dot com site).

When you plug the USB in it should create a device in /dev eg: /dev/ttyUSB0 (note the device will appear and disappear when you connect and disconnect the USB port).

If you want a two way connection then you need a terminal programme (as opposed to a terminal session) such as minicom or cutecom

If you just want to read the output then the following command will output the device data to the command line:

cat /dev/ttyUSB0

Note you may get garbage if the serial parameters do not match.

HTH

EG

mixture
25th Mar 2015, 17:53
rans6andrew

So do I therefore understand it that you are basically looking to use bluetooth as an SSH alternative ?

If so, do what ExGrunt says and poke around the /dev/tty's

rans6andrew
25th Mar 2015, 20:20
I want to do more than a terminal program does, I think, as I want to be able to navigate the file system, invoke the C compiler, use a basic text editor, run the compiled file and see it's output. Perhaps this is expecting too much when it is all to be driven from a terminal emulator on a netbook. In the olden days, computer users would do everything on a single screen (no windows or overlays) connected by serial cable to a mainframe.
I want to do the same but replace the cable with my USB BT link.

Rans6.........

ExGrunt
25th Mar 2015, 21:22
Ran6,

So the USB/bt is a cable replacement. In which case you seem to need something like PuTTY (http://www.pprune.org/www.chiark.greenend.org.uk/~sgtatham/putty/)

As Mixture says that allows SSH into a linux box, it can be configured to run over a serial link.

If you install Cygwin/X (http://x.cygwin.com/) you can run linux graphical applications over PuTTY link so that they appear on you local laptop while actually running on the linux host

See here (http://www.cs.dartmouth.edu/~campbell/cs50/putty-cygwin-tutorial.pdf) for a HowTo guide - obviously you will have to substitute references to Ip addresses to a serial connection.

HTH

EG

mixture
25th Mar 2015, 22:29
rans6andrew,

You can certainly do an awful lot of stuff remotely these days,anything from power cycling and changing BIOS settings upwards....

The "issue" we have here is that you want to do it over Bluetooth. Something which theoretically shouldn't be an impossibility, but you'll need a good dose of persistence. But since you're into writing and compiling C programs, I'm sure you're happy to troubleshoot .....

Perhaps, if you wanted to keep your life modestly simple, you would connect your bluetooth adapter to the serial port rather than USB port on your computer. I'm pretty sure getting console port over bluetooth to serial is quite a common application that shouldn't be rocket science to setup.

Console over USB is a bit different, although you'll probably need drivers and/or config work .... maybe something along the lines of what's hinted at here on the bottom post by "jojopi" ...Raspberry Pi ? View topic - Console output on USB port (http://www.raspberrypi.org/forums/viewtopic.php?f=71&t=48683) (its a RaspberryPi thing I found on Google, but the concept is exactly the same for other Linux boxes will probably just need some tweaking). But I've never seen such a thing in action (spawning consoles on USB), so I can't vouch for the suggestions on that link .....

NonPilot31
25th Mar 2015, 22:53
If I understand it correctly
a) you want to use TeraTerm terminal emulator on a netbook PC as a remote serial console allowing you to log into your Linux machine.
b) instead of using a plain serial wire you plan to use a pair of USB bluetooth devices to transfer the characters between the netbook PC and the Linux machine.
c) you have already got the netbook PC end working

At the linux end first check that the USB bluetooth device is detected and shown by the "lsusb" command when plugged into a USB port.

Provided it is detected you next need to ensure that the correct linux driver is loaded to provide the /dev/ttyxxx serial device. I don't know much about this process. On Debian Linux drivers are loaded using the "modprobe" command and this command is normally ran automatically to load the correct driver when a device is detected. It can be ran manually to load the driver if device detection isn't configured to know the driver to load. ExGrunt (http://www.pprune.org/members/67706-exgrunt) in his message of 25th Mar 2015, 17:51 seems to know more about this than I do.

Once you have the /dev/ttyxxx serial device you could test it with a terminal program such as minicom, cutecom or Putty (this will just allow characters typed at one end to be displayed at the other). To actually allow you to login and run commands from the netbook PC you use the command "getty" (or similar). See Configure getty (http://www.tldp.org/HOWTO/Remote-Serial-Console-HOWTO/getty.html)

It should be possible to configure the Linux machine's device detection to both load the correct driver and start "getty" when it detects the USB bluetooth device and also send the hangup signal to the getty process (plus any child processes) and remove the driver when the USB bluetooth device is removed.

rans6andrew
26th Mar 2015, 23:21
Yes Nonpilot, that's about what I want to do. I'll try to understand the info you have given, it sounds about right but my Unix knowledge is lacking a little.

Ta,

Rans6.....

Guest 112233
16th Apr 2015, 20:32
Please see attached if its relevant

http://www.google.co.uk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCEQFjAA&url=http%3A%2F%2Fwww.ftdichip.com%2FSupport%2FDocuments%2FAp pNotes%2FAN_220_FTDI_Drivers_Installation_Guide_for_Linux%25 20.pdf&ei=9howVZKJHYzkaquigaAF&usg=AFQjCNGhsukr0sshuc9hcYYryL6QHjobYA&cad=rja

It might be of help - PS I'm an SSH Bloke

CAT III