how to test serial port communication in windows with rxtx? - serial-port

I am using RXTX with Java to connect to serial port. But now i have to test whether the communication is working properly or not? How to do this. Do i need modem or can we test any way in my local with out modem.
this is the program i want to test http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port

On Windows you can use a 'null modem emulator' called com0com. This registers 2 dummy com ports onto the OS, which will communicate between each other.
So, you'd need to connect to it 'twice', one for each end of the serial connection.
com0com also has variants called com2tcp & hub4com, if that's more appropriate for you.
HTH

Uh, no you don't need a modem(?). You can use a null modem serial cable to do loopback testing from one COM port to another. You can do this on a single PC or two different computers. If you don't have enough COM ports, use a USB to serial converter.

Related

Underlying hardware beneath virtual Com port

I have a device connected to USB port via USB cable to my PC and in device Manager it says - > "XYZ corp Virtual COM port (COM A)"
Is this is same as Serial Com Port.?What is the underlying hardware under it both at device side and Host Side - a Uart or a USB or both at either end respectively?
It sounds like your USB device uses a driver that provides a serial port interface inside your computer. This means that other software can use the serial port APIs that Windows provides to connect to it and use it as a serial port. That software doesn't need to know the details of your USB device; it just needs to know about using serial ports in Windows. Windows ships with a driver that is often used to do this, and that driver is named usbser.sys. Your device might be using usbser.sys or it might be using some other driver.
The serial data is transferred via your computer's USB port and a USB cable. If you look at the signals on the USB cable, you will not see typical serial signals: you will see regular USB packets that just happen to be carrying that data needed for a serial port.
The USB device on the end of that cable might then translate that data into serial signals and act like a normal serial port, or that data might just be used directly inside the device. Without a link to the product in question, it is hard to tell you more than that.

Developing my own modem

I would like to develop my own modem for a custom communication network that will be detectable on the serial port by PC automatically. What I'm uncertain about is the protocol part of the AT commands and how to make it work seamlessly so that computer will detect the modem automatically.
I plan to use ftdi UART to USB converter to interface my microcontroller with the PC using standard serial interface. The PC will then use AT commands to communicate with the microcontroller that will in turn connect to another microcontroller over radio tranceiver and establish a two way serial connection over radio. The idea is that the PC on the other end will run PPPD and listen on it's own modem connection for incoming call and then bridge the connection with it's other internet interface that is connected to internet. The first computer will get it's own IP address using PPPD and will be connected to internet over this custom microcontroller based modem.
But how do I implement the communication protocol between my controller and PC? What commands do I absolutely need to implement? How do I make sure that the computer recognises my controller which is connected over ftdi usb to serial adapter as a functional modem?
Where can I find a speciffication of the minimum command set that is required of a modem?
In practice linux usually discovers a 3G modem automatically for example. Does that have to do with the actual USB identifier of the modem? Is it possible to have linux automatically discover an ordinary serial port modem? I'm thinking that the modem will be sending an AT idle ping repeatedly when it's plugged in so that linux should be able to detect it.

How to connect 2 GSM Modems

I want to know how can i use 2 GSM Modems in one computer (using Windows) ?
Those modem have a usb connector but the system plug them as Mobile Modem in COM Port.
The probleme is how to use 2 Modems togeteher in different ports.
The modem reference is ls100 and it made by Lonsai i connected 2 modems in my computuer but in devices manager i found the COM Port of the first one that i put. did some one have an idea how to detect 2 COM Ports ?
Thank you.
If you are using serial port then that is not possible ofcourse. However, if you are using USB to connect the modem, you can use different COM ports. Here are some steps you can try and debug the issue:
Please refresh your device manager settings and see if you can find another COM port.
Plug in the modems one by one to see if the COM Port appears for both. Note what number has been assigned to each modem.
Try using different USB ports on your PC.
Try using a different terminal to see the COM Ports or multiple terminals for each modem

Create connection based on usb cable between 2 computers

I have 2 linux computers. For security, I want to setup a link between them, then program a library for sending/receiving data over this connection. I know that we can use USB networking cable for connection. But I am not sure is it possible to send and receive data on this link, does it depend on cable manufacturer? And Can I program library without using cable driver?
You can't use a USB cable to connect two computers with standard USB interfaces. Standard USB interfaces on computers are host interfaces and you can only connect a host to a device, not another host.
The "cable" described in the article it's not just a cable, the correct name would be USB host-host bridge controller and it powered by a chip designed and manufactured by Prolific - PL 2501. It's described also in the article.
As David Schwarz said with dumb cable (only the wires) you cannot setup a link between two PCs, because USB it's master/slave bus, where a device it's the slave and other the host. The PC it's designed to always be the host (the master).
The response it is that you cannot setup a link or do networking between two PCs using a dumb USB cable. You can do this only using a bridge like the one described in the article.

USB to Serial emulation

I bought this magnetic strip reader writer (MSRE106) and I use USB adapter to connect it to my laptop because I have no serial port in my computer. But now I have a problem since the software of the device recognizes only serial ports on windows. After looking up I found someone that wrote a python script for Linux (found here The Script).
Still even in this python script in the settings file it has this variable
## Com port.
COM = "COM1"
How can I change this to be one of my USB ports instead of a serial one because I have none
This script is made to use serial port as well, which means you can't just modify COM="USB1" or whatever to use your USB adapter. If you have a look at line 264 a serial port is open using function SerialPort().
To fix this issue you must install your USB adapter's driver that will emulate a serial port and create a fake COM1 you can use with this script or the original software of the MSRE106.

Resources