What is the AT command to reset USB cellular modem? - command

What is the AT command sequence used to reset a USB cellular modem?
Is there a single AT command that can be used? Or does it require a sequence of several in order to reset a USB cellular modem?
I have a Huawei E272 and E220 however I am also interested in a general command sequence if there is any standard AT command.

Resetting the modem is a manufacturer-specific AT command.
There is a spec available online for Huawei AT commands here.
Look at section 3.10 +CFUN
The EXECUTION command is used to set the MS mode or restart the MS
AT+CFUN has 2 parameters:
AT+CFUN=[fun[,rst]]
These 2 parameters fun and rst are defined as follows:
fun:
0 Set as minimum functionality mode (set the RF off but keep
the SIM power on, previous mode must not be offline)
1 Set as online mode (default value) (previous mode must not be offline)
4 Set as offline mode (previous mode must not be FTM)
5 Set as offline FTM (previous mode must be online)
6 Reset MS (previous mode must be offline)
7 Set as RFoff mode (about radio frequency)
rst: Whether to restart MS before setting
0 Not restart MS before setting. (Default)
1 Restart MS before setting. (fun must be 1)

There seems to be a generally used or defacto standard AT command for turning off and turning on a USB cellular modem.
To turn the modem off use: AT+CFUN=0 and to turn the modem on use: AT+CFUN=1. The AT command must be terminated by a carriage return and it must be sent through the Virtual Serial Port that is assigned to the USB modem.
I used the following procedure to test with a PANTECH UML290 USB cellular modem with Verizon as the carrier.
First step was to determine the Virtual Serial Port in use through which I would send the AT commands. I used the Device Manager application from the Control Panel to find the USB modem and to then see what COM port it was using.
Next I used the HyperTerm application to open a connection to the Virtual Serial Port assigned to the USB modem as shown in Device Manager. The HyperTerm application is an older modem and serial ports application that came with Windows XP and earlier. For Windows 7 and later see HyperTerminal Alternatives for Windows 7.
I then used AT+CFUN=0 to turn off the USB modem. Then I used ipconfig /all to examine the LAN adapters in my system which showed the PANTECH UML290 as "Media disconnected"..
I then used AT+CFUN=1 to turn the USB modem back on. I used the ipconfig /all command to display the status of the LAN adapters in my system. After using the command a second time after a few seconds wait, the displayed status showd the PANTECH UMO290 up and running..
For a fuller description of the AT+CFUN=0 command see page 12 of AT Commands GSM Reference Guide from MultiTech Systems which has this to say:
This command selects the mobile station’s level of functionality. When
the application wants to stop the product with a power off, or if the
application wants to force the product to execute an IMSI DETACH
procedure, then it must send: AT+CFUN=0 (equivalent to AT+CPOF). This
command executes an IMSI DETACH and makes a backup copy of some
internal parameters in SIM and in EEPROM. The SIM card cannot then be
accessed. If the mobile equipment is not powered off by the
application after this command has been sent, a re-start command
(AT+CFUN=1) will have to issued to restart the whole GSM registration
process. If the mobile equipment is turned off after this command,
then a power on will automatically restart the whole GSM process. The
AT+CFUN=1 command restarts the entire GSM stack and GSM functionality:
a complete software reset is performed.
This description appears to apply to how this AT command is generally implemented by USB cellular modem providers.
Addendum I: Command Line Utility
I wrote a simple command line utility with Visual Studio C++ that can be used to send a command string to a serial port. The source is located in my Github repository at https://github.com/RichardChambers/writereadport
The utility can be used in a shell or command file and has both a command line interface for a single AT command or a console mode. It is primitive but does the job I needed at the time.

ITU V250 (https://www.itu.int/rec/T-REC-V.250-200307-I/en) specifies ATZ as beeing the reset command:
6.1.1 Reset to default configuration
Syntax
Z[< value>]
Description
This command instructs the DCE to set all parameters to their factory defaults(...)
If you issue the command ATZ, you should have you modem reset and get an OK. Read the spec for more information about the <values> parameter if needed.

Related

UART serial access with Rpi 3

I am trying to establish a serial connection between the RPI3 and an Arduino. Because that wasn't working I connected a USB to TTY cable from my laptop to the Rx/Tx pins of RPI. I was eventually able to use PuTTy to connect to it.
I am running Android Things on the RPI and the android code I have running is supposed to be a loopback (reading from UART and writing back what was read).
Here is where I am confused....
When PuTTy connected I was presented with a command line console on the RPI.
How do I get the Rx/Tx pins on the RPI to just be serial connections into and from my application and NOT a way to log into the console?
Is that a bad idea? I suppose if I ever needed to log into the RPI this would make it more difficult...
I figured out what I was doing wrong...
When following the setup directions at the below site I was using the Bluetooth mode instead of the Application mode. When I followed the directions for Application mode I was able to start using UART0 for serial comms
Set the console attribute to the following in cmdline.txt:
console=tty0
Add the following line in config.txt:
dtoverlay=pi3-disable-bt
Remove the following lines from config.txt:
enabled_uart=1
core_freq=400
https://developer.android.com/things/hardware/raspberrypi.html#disabling_the_console
Beginning with Developer Preview 3, in which USB-Serial devices support added, You can use external USB-UART dongles like this instead of UART of Raspberry Pi 3.

How to setup Xbee without X-CTU(official tool)

I try to make two raspberry pi communicate (text) with each other via XBee S2 module. Instead of using XBee shield, I connected XBee and pi with dupont lines(PIN: 3.3V, Tx, Rx, Ground).
Under pi, install minicom and
minicom -b 9600 -D /dev/ttyAMA0
I could enter XBee command mode, where I got reply 'OK' when I type some commands. My test architecture is shown below.
(C)PI-XBee (R)XBee-PI
I set same PANID and destination address as source address of each other. However, I cannot get the message from each other in minicom.
Did I miss something? Or I did need to setup with X-CTU.
Did you exit command mode before sending data (I think the command is ATCN, or just let command mode time out)? Are the modules joined to the same network? Check AI (association indicator, should be zero), SC (scan channels, identical on both modules), CH (channel) and OI (operating PAN ID). The read-only CH and OI should be the same on both modules if they're on the same network. Use ATNR to reset the network on the coordinator, and then on the router to force it to rejoin the network. Be sure to use ATWR to write your settings if you want them to stick after power cycling.
Edit: Turns out both modules had Router firmware installed, so they were both trying to join a network. The S2B has different firmware files for Coordinator and Router/End Device node types. The S2C has a single firmware and uses the setting of ATCE to select coordinator (1) or router/end device (0) operation.

Win 10 IoT: WindowsIoTCoreWatcher.exe does not show my Raspberry PI device

I have a Raspberry PI with Win 10 IoT installed.
The device is connected through Ethernet, I can ping it
I've connected through Powershell, changed admin password. Followed instructions here: http://ms-iot.github.io/content/en-US/win10/samples/PowerShell.htm
I can connect to the device's web based interface http://ip:8080
However, WindowsIoTCoreWatcher.exe does not show or list my device. I tried Refresh button, run as admin. Still no result.
How can I fix the issue?
Thank you,
WindowsIoTCoreWatcher listens for UDP broadcasts that are sent every five seconds by a process running on the device: C:\Windows\System32\ebootpinger.exe. It appears that this process occasionally dies or stops broadcasting, particularly if the device has not been rebooted in several days. It can be restarted with the PowerShell command (e.g. in a remote interactive session):
Start-Process ebootpinger.exe

How can I debug Windows in one VM from another VM using VirtualBox?

I am working on some start-up (pre-logon) code for Windows 7, and would like to be able to debug it (if only to see how it really works, as Microsoft's documentation is terrible).
My environment is VirtualBox on a Linux host, with three Windows VMs (a Windows 2008 domain controller, a Windows 7 dev machine, and a Windows 7 test machine), and I'd like to be able to debug the startup process of the test machine remotely from the dev machine using a virtual serial connection two virtual machines.
[I have, in another life, debugged Linux kernel drivers in one linux VM from another using VMware workstation on a Windows host so I know that this sort of thing is potentially doable.]
I've seen people using windbg to debug Windows in a VirtualBox VM from the host, but I need to do it from a second guest (because my host is non-Windows). Has anyone figured out how to do that?
Edit:
I had tried the obvious approach before I posted. I created a virtual serial port in each VM configuration and attached them both to the same host pipe, to be created by the dev VM (debugger) and used by the test VM (debugee). I then ran
bcdedit /dbgsettings serial debugport:1 baudrate:115200
bcdedit /debug {current} on
in the test VM and shut it down. Ran windbg in the dev VM selected kernel debugging (on the correct serial port) and restarted the test VM. Some messages appeared about not having any symbols available and the test VM hung.
I have since found this article: http://www.benjaminhumphrey.co.uk/remote-kernel-debugging-windbg-virtualbox/ which (although that guy is using a Windows host) seems to describe exactly the method I'd tried, but his test VM doesn't hang. The output I get in the wndbg window is the same as his, but stops before the line staring "Windows XP Kernel ..."
I'm now less sure that this problem is related to VirtualBox and more unsure as to whether I'm using windbg correctly. Any help would be appreciated.
Another Edit I have tried attaching the virtual serial port of the Test VM to a host file, and I get some debugging output in the file. I have tried setting the virtual serial ports of the two VMs to point to a host pipe and running a terminal (rather than WinDbg) in the Dev VM, and I get debugging information in the terminal.
I think I've now determined that this is definitely a problem with WinDbg rather than VirtualBox (I'll remove the virtualbox tag and replace it with windbg) but I'm not sure why WinDbg isn't talking.
More information:
I've just upgrade Upgrading to VirtualBox 4.2.4 (not sure whether the version matters) and have looked at this again.
I rebuilt the test VM and was more patient!
It now seems that the test VM is running - and I do eventually get some output in the windbg window - but it takes about 15 minutes for the debuggee OS to boot! This is clearly not useful for day-to-day kernel debugging. I have no idea why this should be so slow ... there is no perceptible slowdown if I run a simple terminal in the dev VM instead of windbg (though, of course, the debug information is then mostly garbage).
Any ideas?
I realize this is one helluva necro, but...
Have you tried setting up the debugee for kernel-mode network debugging? I'm thinking that the slowdown is in a large part because serial is so g.d. slow.
http://msdn.microsoft.com/en-us/library/windows/hardware/hh439346%28v=vs.85%29.aspx
If/when M$ decides to rot away that link, these parts of above article are what you need to do to get this set up:
Setting Up the Target Computer
To set up the target computer, follow these steps:
Verify that the target computer has a supported network adapter.
Connect the supported adapter to a network hub or switch using standard CAT5 or better network cable. Do not use a crossover cable, and do not use a crossover port in your hub or switch.
In an elevated Command Prompt window, enter the following commands, where w.x.y.z is the IP address of the host computer, and n is a port number of your choice:
bcdedit /debug on
bcdedit /dbgsettings net hostip:w.x.y.z port:n
bcdedit will display an automatically generated key. Copy the key and store it on a removable storage device like a USB flash drive. You will need the key when you start a debugging session on the host computer.
Note We strongly recommend that you use an automatically generated key. However, you can create your own key as described later in the Creating Your Own Key section.
If there is more than one network adapter in the target computer, use Device Manager to determine the PCI bus, device, and function numbers for the adapter you want to use for debugging. Then in an elevated Command Prompt window, enter the following command, where b, d, and f are the bus number, device number, and function number of the adapter:
bcdedit /set "{dbgsettings}" busparams b.d.f
Reboot the target computer.
And to connect to it, use the following steps:
Using WinDbg
On the host computer, open WinDbg. On the File menu, choose Kernel Debug. In the Kernel Debugging dialog box, open the Net tab. Enter your port number and key. Click OK.
You can also start a session with WinDbg by opening a Command Prompt window and entering the following command, where n is your port number and Key is the key that was automatically generated by bcdedit when you set up the target computer:
windbg -k net:port=n,key=Key
If you are prompted about allowing WinDbg to access the port through the firewall, allow WinDbg to access the port for all the different network types.
Using KD
On the host computer, open a Command Prompt window. Enter the following command, where n is your port number and Key is the key that was automatically generated by bcdedit when you set up the target computer:
kd -k net:port=n,key=Key
If you are prompted about allowing KD to access the port through the firewall, allow KD to access the port for all the different network types.

Issues loading page with CocoaHTTPServer using a WiFi module

I have a RN-171 WiFLy module (I'm very new to working with hardware, btw) and I need it to talk to an iPhone over WiFi.
To achieve that, I've chosen to host a web server on the iPhone using CocoaHTTPServer, set the RN-171 in Adhoc mode, join the network via the iPhone and then send requests to the iPhone server via the device.
The module works correctly when I try to load a page on my Mac (running on Apache). The device prints out *OPEN*, shows the returned HTML and then prints out *CLOSE*.
With the iPhone application, however, it simply hangs at *OPEN* for a while until it times out and then shows *CLOSE*. I've put a breakpoint in the application and can indeed see that it is hitting the iPhone server but for some reason the server is responding correctly.
I couldn't figure out the issue by stepping through the application but I'm guessing that the request isn't being closed or something.
set dns name www.rovingnetworks.com
set ip host 0
set ip remote 80
set ip proto 18
set com remote GET$/server.php?value=
set sys auto 10
set option format 1
set uart mode 2
save
reboot
The above are the commands I'm entering into the device to try and get it to connect taken from manual. In my case, I'm setting the dns name to the iPhone IP and the remote string to the GET$/index.html?value= however I'm not having any luck.
Any ideas?
I was using Picocom to talk to the device. I set the options to convert linefeeds and carriage returns to CRLF and it worked correctly.