Go Down

Topic: Arduino Yun Rest API + Node.js communication (Read 1 time) previous topic - next topic

nnitgd

May 11, 2017, 06:38 pm Last Edit: May 11, 2017, 06:48 pm by nnitgd
Hi, I have a question about Yun Rest API and Node.js communicatoin
I have Yun mini(No SD card).

I uploaded Bridge example in the Yun and I success to get sensor data with
Code: [Select]
http://192.168.43.117/arduino/digital/10

And then, I want to use this data in the localhost.
I tried with node.js to get data from arduino yun like that
Code: [Select]

var express = require('express');
var path = require('path')
var app = express();

app. get('/',function (req,res){
  res.send('Hello World!');
});

app.get('http://192.168.43.117/arduino/digital/10', function (req, res) {
    console.log(req)
 });


In the localhost:3000, I can see 'Hello World!'
But i cannot get the sensor data..

I guess it is not correct way. How can I get data from Yun???

Go Up