Getting started with the RN-XV WiFi Module & Node.js
The RN-XV WiFi module is a nifty little WiFi module designed to fit the same pinout as an XBee, so it’s intended to be a drop-in replacement.
Tonight I whipped up a little test of the module to get a joystick to talk to a Node.js server over WiFi. I attached +3V power and ground to the module (pins 1 and 10, respectively), pin 2 (TX) to Arduino digital pin 0 (RX), and pin 1 (RX) to Arduino digital pin 1 (TX). That’s all the hardware setup you need.
I used this WiFly library to handle the connection. All it does is talk to the WiFly module over serial and send control commands, so the library abstracts that a bit. Here’s the Arduino sketch I built:
And here’s the very basic Node.js server that just prints out the values it receives: