Use Yun as a sensor and send signals via wifi

Hi,

I am working on a project which uses the Arduino Yun and load cells to measure weight. I want to send this information via wifi to a computer with a local server. What would be my best bet to do this? I'm open to a variety of suggestions, but the Yun and the computer cannot be connected via usb (which is what I've seen many people do in examples). I know about spacebrew, noduino, and johnny five.

I know about spacebrew, noduino, and johnny five.

But not about the built in WiFi!

Mark

Could you go in deeper or provide references I can look at? I'm a total noob in this field. Thanks.
Steven

How about looking at the getting started guide for the Yun.

Mark

Hi,

I've just spent some time figuring out running Node.js + Johnny-Five on Yun. I think this approach would fit your needs (among other approaches). Below is my suggestion:

  • On Yun, install node.js then install these modules: Johnny-Five, serialport, socket.io-client.
  • Also on Yun, write a node.js program to read sensor data via Johnny-Five and send it to another computer via a socket connection with the help of socket.io-client (Yun and the computer are not connected with USB cable, the data transfer over wifi).
  • On your computer, write a node.js program to run a socket server with socket.io to receive the sensor data sent from Yun.
  • How you process the received data depends on your case. For example you can have another program also connecting to the socket server and "subscribe" to the events emitted by the socket server, then it can receive sensor data along with the events.
    You can also consider running the socket server (3) on Yun and have the program (4) connect directly to Yun to receive data. But keep in mind that Yun may not have enough processing power to handle all the workload. This also might impose a limit that your computer need to connect to the same wifi with Yun. In my case I run the socket server (3) on a separate server which has a public IP address so I can have many programs (4) in different locations connect to the socket server and read the sensor data via Internet.

Note: installing Johnny-Five on Yun is not as simple as it may look like. The Yun's storage capacity needs to be expanded with micro SD card, and there will be compiling errors when installing the firmata module via npm (I had to install the firmata module on another Ubuntu computer then copy the files to Yun). There are other issues...that I can't remember right now :cold_sweat: If you encounter problems on this just reply and let's see how we can help.

steven77723:
I am working on a project which uses the Arduino Yun and load cells to measure weight. I want to send this information via wifi to a computer with a local server.

What kind of data rate and data volume are you looking at? Streaming continuous live data at a high sample rate would use a very different mechanism than if you just needed to send an occasional sample.

You mention the computer has a sever: what kind of server is this? A web server, database server, file storage server, something else?

What would be my best bet to do this?

There are MANY different ways to accomplish this. Knowing a bit more about the data volume, frequency, and server abilities will help narrow it down.

Plan B.

Reading Weighing scale data from USB host in Yun

http://forum.arduino.cc/index.php?topic=284254.msg1993789#msg1993789

Use python script to communication remote mysql

http://forum.arduino.cc/index.php?topic=206746.msg1524874#msg1524874