2

I have been doing an app for the pebble watch during the penn state hackathon. On campus I was getting the information from a local server(thats what i thought) using node.js and displaying that information on the watch. It worked perfect. Now, I am back at my home and for some reason the link for the http server changed, and now, when I get the ajax request (from this updated link) it fails, saying that the ajax request failed:null (null as the error I suppose) any ideas why??

The previous link that I was running was:http://client-75-102-97-252.mobility-up.psu.edu:3000

Now I am running on:http://Kevin-Cs-MacBook-Pro-2.local:3000

And it doesn't work.

I am using the ajax function as described in the Pebble.js API

ajax(
{
    url: 'http://Kevin-Cs-MacBook-Pro-2.local:3000/Kevin/medicine',

    type: 'json'
  },

  function(data, status, request) {
    console.log('Quote of the day is: ' + data.contents.medicine);
  },

  function(error, status, request) {
    console.log('The ajax request failed: ' + error);
  }
);

I’m not sure what is happening. Thanks, Kevin

Kevin Cohen
  • 1,211
  • 2
  • 15
  • 22
  • 1
    Try opening the URL from a web browser on your phone to make sure that the connection to your macbook is working. – sarfata Apr 14 '15 at 10:54
  • 1
    I solved it, the problem was with cloud pebble because it wasn't getting anything from the server, apparently it interfered. I downloaded the Pebble SDK, ran it locally and it worked! – Kevin Cohen May 16 '15 at 23:11

1 Answers1

0

The problem was with cloud pebble because it wasn't getting anything from the server, apparently it interfered. I downloaded the Pebble SDK, ran it locally and it worked

Kevin Cohen
  • 1,211
  • 2
  • 15
  • 22