Core sending Prowl notification

Hi Guys,
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.

Jim

Here is the prowl section of the code:

void sendGetRequest()
{
   if (myTCP.connect("api.prowlapp.com", 80))
        {
        Serial.println(F("Outgoing Notification"));
        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");
        myTCP.stop();
        }
        TimeOfNotification = (millis()/1000);
        sentOnce = 1;

        
}

I would try replacing “api.prowlappl.com” with IPAddress(209.20.72.170) 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(?)

1 Like

@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?

Jim

Take a look at these posts, they should give you some ideas on how to set up the webhooks: http://docs.spark.io/webhooks/
http://community.spark.io/t/webhooks-super-simple-motion-activated-push-notifications/10322
http://community.spark.io/t/webhooks-tutorial-get-your-unread-gmail-count/10565
http://community.spark.io/t/webhooks-sending-a-text-message/10560

I’m not sure what you mean by “web app side”, could you elaborate that a bit further perhaps?

Hi @jimbol

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.

  ...
  delay(3000);
  myTCP.stop();
  ...

Hey @bko,
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.
J

1 Like

Hi @Moors7,
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.
Thx,
Jim

1 Like