Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SIM800 'PING' using embedded AT

Status
Not open for further replies.

eta-sys

Newbie level 1
Joined
Jun 11, 2014
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
15
Using AT command AT+CIPPING="..IP.." I can ping my IP successfully. I can see te response time in AT terminal and tcpdump log at my computer.

I try to enforce a SIM800H socket to send a PING using embedded AT and I fail.
According to SIM-documentation this can be done 2 ways:
1. creating a RAW socket with protocol set to SOC_IPPROTO_ICMP i.e.=1, with option 'SOC_IP_HDRINCL' set to FALSE. Then you should not provide an IP header in the data-to-send. I'm not sure should I provide ICMP header in my data, but as proto is set to SOC_IPPROTO_ICMP I decided not to include it.
As 'sendto' command description has an error
"SOC_NOTBIND : in case of sending ICMP Echo Request, shall bind before"

I do bind the pingSocket to my local address. As Ping does not need port, I set port to 0.
Binding passes, but next 'sendto( ... destIP) fails with error -10 ( illegal parameter).
I try to set port to 1, and socket seems to send my 32 bytes data anywhere, but I didn't receive them.

2. creating a RAW socket with protocol set to SOC_IPPROTO_RAW i.e.=255, with option 'SOC_IP_HDRINCL' set to TRUE. Then I create a whole message with IP header and IMCP header in data-to-send. Now I use pure 'soc_send' as I wrote all it needed. I get the error = -12 - Socket not connected!

If you have any suggestions please advise me.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top