Android push occasional failure - push-notification

I have a cron job that runs every minute that sends a maximum of 60 GCM messages, occasionally (about 10 times per day), sending a push message fails with curl returning this error :
Curl failed: Unknown SSL protocol error in connection to android.googleapis.com:443
I have not found any particular pattern or managed to track down any reason for this. All ports are open (pushing works all the other times). Has anybody encountered this?

For anyone who comes across this issue, I fixed it by forcing curl to use SSSL V3. In PHP this is done via :
curl_setopt($ch, CURLOPT_SSLVERSION, 3);

Related

Can NOT launch a HTTP operation using SIM5320E

I want to send/receive data to/from website by using SIM5320E.
Connection between my PC and module SIM5320E is look good because the AT command responses OK. But the command to launch a HTTP operation gets ERROR.
It seems that my SIM5320E is NOT connected to 3G network. The GPRS is no longer available in Japan (DOCOMO) now.
How to active SIM4320E connect to 3G ?
This is my current result.
AT
OK
AT+COPS?
+COPS: 0,0,"NTT DOCOMO",2
OK
AT+CGSOCKCONT=1,"IP","line.me"
OK
AT+CSOCKSETPN=1
OK
AT+CSOCKAUTH=1,3,"line","line#line"
OK
AT+CHTTPACT=?
+CHTTPACT: "ADDRESS",(1-65535)
OK
// I got error from here
AT+CPING="google.com",1
OK
+CPING: 3,0,0,0,0,0,0
AT+CHTTPACT="google.com",80
+CHTTPACT: 237
ERROR
AT+CHTTPACT="www.google.com",80
+CHTTPACT: 237
ERROR
AT+CHTTPACT="stackoverflow.com",80
+CHTTPACT: 237
ERROR
Update 1: Also tried this
AT+CMEE=2
OK
AT+CHTTPSSTART
ERROR
AT+CHTTPSSTART\r\nAT+CHTTPSOPSE="pruebas.libelium.com",80,1\r\nAT+CHTTPSSEND=88\r\n"GET / HTTP/1.1"\r\nHost: pruebas.libelium.com\r\nContent-Length: 0"
ERROR
Update 2: Also tried
AT+CNMP?
+CNMP: 2
OK
AT+CNAOP?
+CNAOP: 2
OK
AT+CPSI?
+CPSI: WCDMA,Online,440-10,0x01C6,72728730,WCDMA IMT 2000,331,10736,0,4.5,70,31,45,500
OK
AT+CHTPSERV="ADD","www.google.com",80,1
OK
AT+CHTPUPDATE
OK
+CHTPUPDATE: 4 // Network error
Thanks!
I was able to download web site data using SIM5320E module. Haven't used SIM4320E though but should be quite similar.
Follow the exact steps in SIM5320e HTTPS Stack, can't make successful GET request which worked for me.
From what you have provided:
You have selected the correct module for DOCOMO band (2100Mhz) according to Cellular Bands in Japan. Since AT+CPSI? and AT+COPS? shows it's online with WCDMA so may assume it's connected to network. You can use AT+CREG? and AT+CGREG? to see whether your voice and data connections are registered with the network (It must be registered with the network)
If it's not connected to the network. Try AT+COPS=2 to force it to select a network.
AT+CHTTPSSTART can fail, if the HTTPS service has already been started. So you can use following commands to restart it.
AT+CHTTPSCLSE
AT+CHTTPSSTOP
AT+CHTTPSTART
If you still face problems, try using this Tutorial by SimComm. It doesn't contain the 3G connectivity stuff. But you can make sure your module works fine with your network. Once it's ensured, try following the steps mentioned above.
All the best!

Postfix handling Amazon SES Maximum Send Rate error

We have a postfix server which we were using to send emails. This server is used by many services. Thus for using Amazon SES, I've integrated our postfix server with SES SMTP interface ( using "http://docs.aws.amazon.com/ses/latest/DeveloperGuide/postfix.html" ). The configuration is working fine and mails are getting delivered properly.
Now, there is a limit of 5 email/sec, imposed by SES and it raises error '454 Throttling failure: Maximum sending rate exceeded ' if limit exceeds.
I'm a newbie to Postfix.
Kindly guide me with the configuration settings in Postfix to make postfix resend the mail when error '454 Throttling failure: Maximum sending rate exceeded' occurs.
Also, how to resend email, when occasionally 'Connection timed out' error occurs with relay server(Amazon SES).
This is not the actual answer you are asked,but you can bypass the issue with this,
You can add this lines in main.cf file
default_destination_concurrency_limit=1
default_destination_rate_delay=10s
This will increase the time delay but you don't get the error message.
You can also verify this link to learn more about postfix performance turning
I was wondering the same thing so I tried it out on a fresh postfix install. I found that no additional configuration was required and postfix did indeed retry sending the messages about 5 minutes after original throttling error was reported in the log file.

error +HTTPACTION:0,601,0

I m trying to access a website using sim900 GSM module.
This is the list of commands
AT+CSQ
+CSQ: 16,0
OK
AT+HTTPINIT
OK
AT+HTTPPARA="CID",1
OK
AT+HTTPPARA="URL","www.google.com"
OK
AT+HTTPACTION=0
OK
+HTTPACTION:0,601,0
AT+HTTPACTION=0
OK
+HTTPACTION:0,601,0
Unable to access google. 601 code shows Network error.
How to get rid of this error?
You need to setup the connection to the bearer. Here are the minimum setup commands that have worked for me (based on trial/error and searching around on the internet).
AT+SAPBR=3,1,"APN","wap.cingular"
AT+SAPBR=1,1
The correct value for the APN may be different for you, depending on your network and service provider. I'm using AT&T prepaid SIM cards. Once that's working, then you can do the HTTP setup commands as you already have...
AT+HTTPINIT
AT+HTTPPARA="URL","http://www.google.com"
AT+HTTPACTION=0
Status codes above 600 (and some in the 500 range) are unassigned in the HTTP standard. In the AT command manual for the SIM908, status meanings are given in the notes on the HTTPACTION command:
600 Not HTTP PDU
601 Network Error
602 No memory
603 DNS Error
604 Stack Busy
You can query the bearer connection status of CID 1 with AT+SAPBR=2,1 and the related parameters with AT+SAPBR=4,1. You can also check that you're attached to the GPRS network with AT+CGATT?. If everything indicates that you are connected and you are still getting a 601 status code, then check that your service plan has data and that it hasn't run out. I have found that even when my account has a few hundred k of data showing on the balance that I start to get a 601 status until I add more data to my prepaid phone plan. If the SIM module has been on the whole time and you add more data, you'll need to close and re-open your connection (AT+SAPBR=0,1 followed by AT+SAPBR=1,1) and then your HTTP* commands will start working again without having to set the HTTPPARA settings again and without having to restart with HTTPINIT.
I have found that when an http call is made to an https only website it will throw a 601 error on the sim. Beware some sim devices have ssl and some don't. Use AT+HTTPSSL=? to interrogate. device with ssl will respond like, 'HTTPSSL 1'. If you get an error your device doesn't have ssl. This took some work with the factory for me to determine this.
You must also use to hit ssl site. I am using the wifi101 ssl client.
fona.setHTTPSRedirect(true);
dy3
I have encoutered this error as well. The cause of the problem may be that there is not enough money in the phone number account. You may check it.
601 is some custom implemented Error code.
Here is the list of standard HTTP Status codes
+HTTPACTION:0,601,0
The above AT response code (601) for HTTP session start indicates that
there is a network error. Then make sure that the PDP context is setup
properly.
source
https://m2msupport.net/m2msupport/at-command-for-http-functions-for-remote-server-data-access/
I have spent many hours with this module right now.
My experience is that when you dont get a 200 reply from remote server, you should check IP address to verify you are still on the network sendng a ping to a working server (AT+CIPPING="XX.XX.XX.XX").
If it succeeds: Try AT+SAPBR=2,1 and AT+CIFSR. You should get same address for both commands.
If you dont get same address, login again to the netword/service with AT+CIPCSGP=1, "yourapn.com", "user", "password".
If nothing works, power down the module. Wait a couple of minutes, and restart again.
Just in case someone is affected by this problem and stumbles on this post 4 years later: in my case the module had a small "sticker" type antenna and it got somehow damaged.
I could connect to the network but when I tried to use HTTP over the GPRS networks I only got return code 601 (network error) or 603 (failed to resolve DNS).
Once I replaced the antenna with a new one, everything worked perfectly.
Again, in case somebody has the same problem. In my case it was a typo in url:
AT+HTTPPARA="URL"," http://www.google.com"
Did you notice the space before http? For several hours, I didn't notice it too.
Usually after this command AT+SAPBR=3,1,"CONTYPE","GPRS" you enter your "APN", "USR" & "PWD" details also using SAPBR=3,1 etc. These details must match the SIM card / mobile phone provider.
Then it is recommended to check that your device has now received an IP address. Sometimes this is not straight away. Use AT+SAPBR=2,1 to query and this will return your IP address which you should check for confirmation.
Once you have IP address you can enter AT+HTTPINIT, AT+HTTPPARA="CID",1 etc.
Now to use GET you have to include a "?" after the URL to provide your php script with a key=value pairing.
Thus in your case it is something like, AT+HTTPPARA="URL","http://<Public_Ip_Address>:8080/folder/savedata.php?A=1001" where A is the key and 1001 is the value.
Now send the AT+HTTPACTION=0 and you should get a +HTTPACTION: 0,200,1000 response where 200 is the OK and 1000 is the payload size. AT+HTTPREAD will allow you to read the response if it is required.
Change URL. 601 is a URL has been moved. Is a redirect.

Service not available, closing transmission channel. The server response was: 4.4.2 Timeout while waiting for command

I'm trying to send a message and we sometime get this error :
Service not available, closing transmission channel. The server response was: 4.4.2 Timeout while waiting for command.
Anyone know what to do with this? Because it only happens "sometime" and apperently, for no specific reason.
I saw many article saying :
442 The server started to deliver the message but then the connection was broke (Source : http://www.sorkincomputer.net/SMTP%20errors.htm)
This is typically a server side (the SMTP server you're delivering to) error or a network connectivity error. There isn't anything you can do about it via your code, you would need to get the related IT staff involved to figure out why your connection is getting closed or interrupted.

IIS file download hangs/timeouts - sc-win32-status = 64

Any thoughts on why I might be getting tons of "hangs" when trying to download a file via HTTP, based on the following?
Server is IIS 6
File being downloaded is a binary file, rather than a web page
Several clients hang, including TrueUpdate and FlexNet web updating packages, as well as custom .NET app that just does basic HttpWebRequest/HttpWebResponse logic and downloads using a response stream
IIS log file signature when success is 200 0 0 (sc-status sc-substatus sc-win32-status)
For failure, error signature is 200 0 64
sc-win32-status of 64 is "the specified network name is no longer available"
I can point firefox at the URL and download successfully every time (perhaps some retry logic is happening under the hood)
At this point, it seems like either there's something funky with my server that it's throwing these errors, or that this is just normal network behavior and I need to use (or write) a client that is more resilient to the failures.
Any thoughts?
Perhaps your issue was a low level networking issue with the ISP as you speculated in your reply comment. I am experiencing a similar problem with IIS and some mysterious 200 0 64 lines appearing in the log file, which is how I found this post. For the record, this is my understanding of sc-win32-status=64; I hope someone can correct me if I'm wrong.
sc-win32-status 64 means β€œThe specified network name is no longer available.”
After IIS has sent the final response to the client, it waits for an ACK message from the client.
Sometimes clients will reset the connection instead of sending the final ACK back to server. This is not a graceful connection close, so IIS logs the β€œ64” code to indicate an interruption.
Many clients will reset the connection when they are done with it, to free up the socket instead of leaving it in TIME_WAIT/CLOSE_WAIT.
Proxies may have a tendancy to do this more often than individual clients.
I've spent two weeks investigating this issue. For me I had the scenario in which intermittent random requests were being prematurely terminated. This was resulting in IIS logs with status code 200, but with a win32-status of 64.
Our infrastructure includes two Windows IIS servers behind two NetScaler load balancers in HA mode.
In my particular case, the problem was that the NetScaler had a feature called "Intergrated Caching" turned on (http://support.citrix.com/proddocs/topic/ns-optimization-10-5-map/ns-IC-gen-wrapper-10-con.html).
After disabling this feature, the request interruptions ceased. And the site operated normally. I'm not sure how or why this was causing a problem, but there it is.
If you use a proxy or a load balancer, do some investigation of what features they have turned on. For me the cause was something between the client and the server interrupting the requests.
I hope that this explanation will at least save someone else's time.
Check the headers from the server, especially content-type, and content-length, it's possible that your clients don't recognize the format of the binary file and hang while waiting for bytes that never come, or maybe they close the underlying TCP connection, which may cause IIS to log the win32 status 64.
Spent three days on this.
It was the timeout that was set to 4 seconds (curl php request).
Solution was to increase the timeout setting:
//curl_setopt($ch, CURLOPT_TIMEOUT, 4); // times out after 4s
curl_setopt($ch, CURLOPT_TIMEOUT, 60); // times out after 60s
You will have to use wireshare or network monitor to gather more data on this problem. Me think.
I suggest you put Fiddler in between your server and your download client. This should reveal the differences between Firefox and other cients.
Description of all sc-win32-status codes for reference
https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-
ERROR_NETNAME_DELETED
64 (0x40)
The specified network name is no longer available.

Resources