I have a Raspberry Pi that is connected to my network and a Samsung Gear S that is connected to the same network. The Raspberry Pi is used as a server and the Gear S sends data to it. I currently need to insert the Raspberry Pi IP address manually in the Gear S app whenever I connect to another network. I've found that you can use raspberrypi.local and that the raspberry pi will recognize this address as it owns. My problem is that when I try to post something to the address "http://raspberrypi.local:8080/appdata/post" using Javascript, the post doesn't come true. I suppose that raspberrypi.local cannot be resolved.
I stumbled on mdns-js (https://www.npmjs.com/package/mdns-js) and I think this should solve my problem. I want to run the following example:
var mdns = require(['mdns-js']);
console.log("Require found");
var browser = mdns.createBrowser();
console.log("Browser created");
browser.on('ready', function () {
browser.discover();
});
browser.on('update', function (data) {
console.log('data:', data);
});
But I get the following error:
Error: Script error for "mdns-js"
http://requirejs.org/docs/errors.html#scripterror (require.js:140)
I use the require function from http://requirejs.org/. Anybody who can help me with this error or better solve my problem. Thanks