eta-sys
Newbie level 1
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.
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.