These AT commands give errors:
1-AT+CGDCONT?
2-AT+WIPCFG=1 //start IP stack , wiplib was't downloaded and I searched a lot but without any benefit.
3-how can I download wiplib libary ?
4-ATD*99# or ATD&99***1# give:
CONNECT 115200 then garbage then NON CARRIER
I searched a lot , but I didn't find the Solution .
Kindly help me.
The "garbage" you get after CONNECT 115200 is binary PPP traffic where the modem tries to establish a PPP connection with the computer. When there is noting on the computer that responds to this, the modem times out and prints NO CARRIER.
You need to send the AT commands through a dialer program that is capable of establishing a PPP connection.
Related
I am developing embedded microcontroller hardware using a Texas Instruments Starter Kit. I am writing the firmware for the Ethernet link between my microcontroller and x86 Windows desktop.
I have written my own Ethernet driver for the microcontroller and my own protocol driver. So I have absolute FULL control over what data is being transmitted to and from the microcontroller. Up until now, I have managed to write ARP, IP, and ICMP drivers.
I use Wireshark on Windows closely to monitor all data frames going in and out. Now when Wireshark is capturing, "ping" from the console works correctly, but when I stop capturing on Wireshark, my ping fails with "Destination host unreachable." I check the logs on my microcontroller; I see Windows is sending ARP requests, and the microcontroller is replying to them correctly. But the network driver in Windows is filtering them away. So no ICMP requests are being sent. When I check the MAC table using "arp" from the console, my microcontroller is in the list while capturing but not when not capturing its not in the list.
What could be the problem, and how can I debug this problem? Are there any tools/apps for Windows that give statistics on dropped/filtered packets?
I found the problem, there was a punny padding missing in my ICMP echo reply. I did a side by side comparision between a working ping with my wifi router vs my microcontroller on wireshark and found this difference. I thought it wasn't such a big deal, apparently not.
Although what has it got to do with wireshark capturing, I have no clue.
I am trying to use a Raspberry Pi 3 Model B to read values from an Allen Bradly PLC. I'm using the Pymodbus Modbus TCP protocol to communicate between them.
When I run a test client I get the following error:
pi#raspberrypi:/var $ python test1.py
Got here 1
Traceback (most recent call last):
File "test1.py", line 12, in <module>
request = client.read_holding_registers(0,1)
File "build/bdist.linux-armv7l/egg/pymodbus/client/common.py", line 109, in read_holding_registers
File "build/bdist.linux-armv7l/egg/pymodbus/client/sync.py", line 82, in execute
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[10.0.0.237:502]
Here is the code for the test client:
from pymodbus.client.sync import ModbusTcpClient
#modbus connection
client = ModbusTcpClient(host='10.0.0.237')
connection = client.connect()
#test print
print "Got here 1"
#read register
request = client.read_holding_registers(0,1)
print request
client.close()
I can ping the IP address of the PLC's ethernet card (10.0.0.237) just fine. (The PLC is on and shows up in RSLinx and RSLogix5000.) But when I try to check port 502 (which Modbus uses) with the command:
telnet 10.0.0.237 502
I get the error:
Trying 10.0.0.237...
telnet: Unable to connect to remote host: Connection refused
The research I've done told me to check whether that port is open, but that is for PCs, I don't know how you check/configure the ports on a PLC.
In addition, I am wondering if the problem is that I am trying to just use Modbus to go between the Raspbery Pi and PLC. I have found prosoft gateways that do the interfacing. But I couldn't find any information on whether those were just another option or whether they were required.
I am new to PLCs and networking, so any help would be appreciated.
I have not used Allen Bradley myself but I do use a multitude of other PLCs though and they all work more or less the same.
You dont open the port as you would in a router but rather activate modbus connectivity in the PLC. Most often its a setting but if Allen Bradley use their own proprietary bus system (e.g Saia S-Bus) you sometimes need a specific function block to enable modbus.
A quick google search for example showed that in micrologix 1400 theres a checkbox to enable modbus tcp under some channel setting.
Check in the PLC if there is a setting to enable modbus master/client (master=serial or RTU, client=TCP but sometimes manufacturers dont differentiate them).
To test the Raspberry Pi you can download a modbus server simulator and poll that.
To test the PLC with something other then the Pi you could download a modbus client/master. I personally use QmodMaster which is free and works well for testing purposes (search google).
Also, make sure youre polling using the right function code. This can be confusing as holding registers (which are addressed 4xxxx) use function code 03. Input registers (which are addressed 3xxxx) use function code 04.
A modbus gateway is used to enable serial modbus (RTU or ASCII) to communicate via TCP.
If both devices do have modbus tcp theres no need for a gateway. If for example you have a device which only has wired modbus (RS232/485/422) you can connect that to a gateway and the gateway to TCP.
I am connecting to my USB modem on a COM port and sending him commands:
AT+CGDCONT=1,"IP","internet"
AT$QCPDPP=1,1,internet,internet
AT_OWANCALL=1,1,1
AT_OHCIP?
modem is answering and I can see that leda are lighting as where there is connection established. I took these command by sniffing communication between GlobeTrotter Connect and COM port. LEDS are the same in both situations. But in Control Panel connection named with GlobeTrotter HSxPA Network Interface #2 is offline (no connection). What am I doing wrong?
When I'm watching GlobeTrotter program and in the same moment watching commands there is no more commands sent. When I click Disconnect in appliaction (GlobeTrotter) in the same moment I see that status if Local Network is changed, but no command are sent. Maybe I should enable it in Windows in my program?
Thanks for any help
Do you know for sure that the internet connection initiated as a Dial-Up Network (DUN) connection and not as an USB ethernet connection? The reason I ask is because for DUN then all communication is done with AT commands and what you have captured should be enough to reproduce. If the connection is an ethernet connection the AT commands are more likely to be only for configuration.
Of the four commands listed, only the first is a standard 27.007 command. DUN with standard commands would typically have invoked AT+CGACT to activate the connection. Maybe the
AT_OWANCALL command is similar, although that is just wild guessing from the name on my part. You should try to get some documentation for these proprietary commands.
I want to know some general communication strategies, which should be followed for a communication via COM (serial) Port.
I can read/write at the port, also can list all the available ports on the machine. I'm using Qt C++ with QSerialDevice. For testing on a windows machine with no physical serial port, I'm using VPSE (virtual port)
Typical Flow (assumed):
List all the available serial ports of the computer.
Find out at which port my device (micro-controller) is connected - how to do it?
Device found.
Start a thread for reading from the port, another thread for writing it.
Safely close connection
Finding out at which port the device is connected sounds challenging to me. How to achieve it? I guess, I will send a HELLO message to each ports, if my device replies a specific per-defined reply message I can be sure my device is connected at that port. Can I?
Also I think, to seperate threads are necessary because at any time I may receive message from the Micro-controller device.
Thanks for helping :)
I've been trying to do TCP communication using my Wavecom Fastrack modem. What I want to achieve is make the modem connect to a specified TCP server port to enable me to transfer data to and from the server. I found some information on than in the user's guide.
Basing on the information you can find on page 66 I created an application that opens the serial port to which the modem is connected and writes the following AT commands:
AT+WIPCFG=1 //start IP stack
AT+WIPBR=1,6 //open GPRS bearer
AT+WIPBR=2,6,11,"APN" //set APN of GPRS bearer
AT+WIPBR=2,6,0 //username
AT+WIPBR=2,6,1 //password
AT+WIPBR=4,6,0 //start GPRS bearer
AT+WIPCREATE=2,1,"server_ip_address",server_port //create a TCP client on port "server_port"
AT+WIPDATA=2,1,1 //switch do data exchange mode
This is exactly what the user's guide says. After the last command is sent to the modem, the device switches to data exchange mode and from then on everything what is written to the serial port opened by my application should be received by the server and everything the server sends should appear in the input buffer of that port.
The thing is that I did not manage to maintain stable bidirectional communication between the server and my modem. When I write some data to the serial port (only a few bytes), it takes a lot of time before the data appears on the server's side and in many cases the data does not reach the server at all.
I performed a few tests writing about 100 bytes to the serial port at once. Logging the data received by my server application I noticed that the first piece of data (8-35 bytes) is received after a second or two. The rest of the data appears in 2-5 seconds (either as a whole or in pieces of the said size) or does not appear at all.
I do not know where to look for the reason of that behaviour. Did I use wrong AT commands to switch the modem to TCP client mode? I can't believe the communication may be so slow and unstable.
Any advice will be appreciated. Thank you in advance.
what OS are you running? Windows does a pretty good job of hiding the messy details of communicating with the GPRS modem, all you have to do is create a new dial-up connection. To establish the connection you can make a call to the Win32 RasDial function. Once connected, you can use standard sockets to transfer data on a TCP port.
i have been using wavecomm modem for 2 years now.As far as i know from my experience is that if you are able to send some of the data then you can send all of the data.
the problem might be in the listening application which receives the data on the server side.
It could be that it is unable to deal with the amount of data that you are trying to send.
try sending the same data in smaller busts
with some delay in between them,then you might receive all data intact.