Pages: [1]   Go Down
Author Topic: Need advice: NodeJS + Arduino wirelessly  (Read 479 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello all, I am very new to Arudino scene, and working with microcontrollers. My background is in web development.

I am looking for advice on a simple project, I want to connect Arduino + NodeJS to allow me to turn on an LED remotely. So the idea being that I can hit a url in my browser, up comes my interface, and I can control my Arduino LED by clicking a button on the interface.

I've been able to successfully create this locally using Arduino Uno, Johnny-Five NodeJS framework, and Socket.IO. But now I want the same functionality, without having to connect the Arduino to the computer.

I've been looking at a few options, using XBee communication, but that means I would have to run the server on a separate machine (I also have a Raspberry Pi and Beagleboard, so I could use those).

Would the new Arduino Yun allow me to run a NodeJS server in Linux on the board, and then communicate with the Arduino outputs? Or should I wait for the new Arudino Gailleo?

I'm really new to Arduino, maybe it isn't even possible to do without running the NodeJS server else where, but any help is greatly appreciated.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 641
Posts: 50351
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why are you hung up on using NodeJS, whatever it is? The Arduino as server can serve up a form with submit buttons that can do what you want, without the need to use NodeJS.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why are you hung up on using NodeJS, whatever it is?
Its beside Websockets the biggest thing since years: https://www.udemy.com/blog/learn-node-js/
Johnny-Five at  NodeConf 2012:

@neilff, i don't know what exactly you want to do. Johnny-Five is great but i think for stuff like Home Automation i don't
like the idea of having the logic on the Server.
I'm also locking for the best way for my interface and i thing MQTT is the way to go.
With Johnny-Five there is to much data if you want to use Ethernet.
I also thing MQTT is more secure: http://readwrite.com/2011/11/22/ibms-andy-piper-part-2-how-mqt

At the moment I'm testing HiveMQ with Paho MQTT JavaScript Client (Eclipse/IBM).
HiveMQ has build in Websocket and there is no need for other stuff like node.js, socket.io, Mosquitto...
Sure you need a machine running with a MQTT Broker (HiveMQ) and for me the decision to make now
is if i use Paho MQTT JavaScript (client-side) or node.js (server-side).
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So the idea being that I can hit a url in my browser, up comes my interface, and I can control my Arduino LED by clicking a button on the interface.

That's easily possible if you use an Arduino with a network interface, or add a network interface shield. You will find example sketches for WiFi and Ethernet that show how to implement a web server and host a web page which enables a user to display status information and send commands to the Arduino.

Alternatively, if you aren't concerned what the web front end looks like you could probably use Firmata and avoid writing any code at all.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Pages: [1]   Go Up
Jump to: