How to monitor/troubleshoot modem serial programming and communication? - serial-port

The company I am working for has it's own ARM embedded device and currently I am starting a project with it to communicate with a dial-up modem. The modem and the device are to be connected via serial TXD and RXD ports.
My question is, how do I go about troubleshooting communications between the ARM device and the modem? For instance, before even starting with the ARM device, I connected the modem to a laptop via TTL USB connector and sent commands to the modem using Putty. I know how to use the ARM device software to send commands to the modem, however there is no screen on the ARM device so there is no way for me to know for 100% certainty if a command was sent to the modem or not. I guess what I am really asking, is there a way to use a laptop just as a "window" or "viewer" to monitor communications between the modem and the ARM device?

Related

How to connect Arduino with Internet?

I have gone through several links online but I have not found any appropriate solution to it. I am wondering if there is a way to connect an Arduino with WiFi without using any shield or any other external hardware. My laptop is connected to WiFi and the arduino board is connected to the laptop with an USB cable. I want to access/run the data for the Arduino using WiFi. Is there a way to do it?
Hope my query makes a sense.
Thanks.
Let's restate your question for clarity - you want to share the laptop's Internet connection (e.g. via WiFi) with the Arduino connected to the laptop with a USB cable, with no additional hardware?
Assuming I restated it correctly, the Arduino's USB connection provides a virtual "serial port" for communication. This means you can use an "IP over serial" solution for Internet access. One such common and widely supported solution is PPP.
However, programing the Arduino with IP over PPP stack requires significant amount of memory and is probably an overkill for whatever it is you're trying to do.
You're probably better off designing a custom-tailored protocol for the serial communication between the Arduino and a small gateway program you can program and run on the laptop.
If you're bent on a complex solution that provides full Internet access to the Arduino, the steps to achieve what you're after are:
Program the Arduino with a TCP/IP over PPP protocol stack, running on the serial port. You'll probably need an Arduino MEGA.
Setup the laptop to be a PPP endpoint on the Arduino's serial port. For a Windows machine you can refer to this page for information on how to do that.
Once the PPP link is up, you can setup the laptop's OS to share Internet access to the PPP link.

USB to USB serial communication from PC to PC

I am currently connecting 2 PCs using serial communication and at this time I am using a USB to Serial converter, then a serial cable, then another USB to Serial converter going into the other PC in order to get the communication sent and received.
Is there a way to program the USB ports as COM ports without these converters and still be able to transfer the serial data over the USB using software rather than hardware, thus eliminating the need for the conversions and rather have just a straight USB cable to USB cable connection?
Thanks!

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.

What kind of port is the USB port?

I am developing a serial port communication java-J2ME-J2SE application. There is a mobile phone and a computer ( running Windows XP ). These two machines are communicating through the phone mobile's cable. And the phone mobile's cable is a USB cable. So what is the type of the port : is it COM1 or something else ?
I looked the device manager and I found that the mobile phone ( Alcatel OT-806D ) is in port COM4. Here is a captured image of the device manager:
An USB port is a kind of serial port that computers and devices can use to communicate. It defines the connectors and cables, as well as the physical and link layer protocols that devices must use to communicate over USB. In this sense, it's similar to Ethernet, Firewire or other communication protocols.
At a physical level, USB is a serial protocol, meaning that bits are sent in a serial fashion. Old serial RS-232 ports (traditionally named COMx under Windows) are not related to modern USB architecture. Old serial ports used a simpler and slower communication protocol (RS-232) that was usually handled by a family of chips called UARTs, whereas USB communication requires more complex hardware.
So, the physical and link-layer characteristics of these two protocols are very different. While both are serial protocols, USB allows for several devices to share the same bus (traditional serial ports don't) and communication speed is much higher in USB. Error detection and correction, flow control and other data transfer concerns are better handled in USB.
COM ports are a Windows abstraction to represent any communication port. In other operating systems other names are used. In Linux, the COM1 port is represented by the device /dev/ttyS0.
Note that this is no more than an abstraction. It is possible (and often done) to use serial ports that are not using the traditional, physical, serial port. In fact, you can create operating system drivers that provide serial ports that are in fact communicating over Ethernet, USB, IP or any other communication layer. The COM port at operating system level is no more than an abstraction to represent a communications port.
Mobile phones offer a variety of services through their USB port. This often includes raw serial communication (which you can use in your application), but in many other cases the USB port provides other "profiles" (usb mass storage, headphones, or whatever). All those profiles are standarized so you can plug your phone to a computer and establish a "serial communication" channel, among other things, without having to code communication drivers for the computer or the phone.
So, to answer your question, no, an USB port is not a COM port. It is an USB port. You can use it for serial communications, but you can also use it for other things.
USB means Universal Serial Bus. Generally all os the USB connections on PC will be linked on the same bus. All devices connected to the bus are assigned virtual port numbers. These port numbers will change depending on what is connected to the bus.
However, you won't be communicating with the phone directly but with any driver that is installed for it, unless you're writing the driver itself.
Some phones are not controllable in any way, others may appear as a modem, because that is the functionality that their manufacturer has assigned them through the drive.
My current phone installs as a device in itself (for use with a manufacturers piece of software), a modem and a storage device.
Have a look here for some more information.
um, depends what you mean by "type of port". I think you want to know the name of the port, but what you really need to know is what protocol your phone will understand.
You need to know what protocol (if any) the phone can communicate with over USB. Just because you can connect the phone to a USB cable doesn't mean that you can control the phone. This depends on the phone. Not all phones are built to understand the same protocols.
Also, USB is a serial bus because it transmits data serially on a single line (as opposed to transmitting in parallel over multiple lines), but it doesn't (necessarily) use the same RS-232 protocol as a computer's serial port. If you had a RS-232 device connected to a USB port, then you would connect to it using COM1 (or COM2 or COM3, your operating system assigns this port name).

Resources