I’m trying to send a push notification from my Core. My internet connection is over a VSAT satellite link. The code works great with all other internet connections, but not over the VSAT. I think it’s because of the high latency of my connection (500-750 millisecs).
Can anyone help me with an idea to make this work? If I go to the prowl website, or the desktop app, it all works fine, but with the code below, from the core, the message never gets thru. It’s not a local network issue, because if I use another type of internet connection, it works.
Here is the prowl section of the code:
if (myTCP.connect("api.prowlapp.com", 80))
myTCP.write("POST https://api.prowlapp.com/publicapi/add?apikey=KeyHere=FISH%20ALARM&event=description=&priority=1&url=AppURL&Content Type: application/x-www-form-urlencoded\r\n\r\n");
TimeOfNotification = (millis()/1000);
sentOnce = 1;
I would try replacing “api.prowlappl.com” with IPAddress(22.214.171.124) in the myTCP.connect call and see if that helps.
We have had trouble in the past with DNS timeouts on the core on satellite links. If switching to an IP address fixes your problem, then you can choose to use the IP address or switch to DNS client that is not built-in to the TI CC3000 WiFi chip on the core. I would hope that Photon adds more flexibility to DNS handling.
Perhaps you could try out the webhooks feature, it might be less demanding on the connection(?)
@bko, thanks for the suggestion. I tried that, and it won’t work, either. It does work over a normal internet connection.
@Moors7, Maybe that would work. I haven’t tried the slightest little bit of web hook stuff, I wonder how hard it will be. Can anyone help me with setting up the web app side of that?
I would also try adding a long-ish delay before calling myClient.stop(). When you call stop you are tearing down the socket connection on the TI part asynchronously to the sending and on a slow link there could easily be a race condition.
Yeah, I’ve been trying that, but haven’t had any luck. I’ve put in a 5 second delay, and I can see that the delay is functioning, but still haven’t been able to get a single notification thru on the VSAT. It seems odd, that I’d see it work once in a while, but it’s consistently not working.
I may not be using the right terminology, I see the web hook as two things, one is having the core send the web hook, and the other is the cloud side code that I called the ‘web app’.
I’ll try to get thru some of the web hook instructions tonight.