Hardware for Prototyping a Works-With-Nest Device - nest-api

does anyone know of a hardware platform that is appropriate to use in prototyping a device that has the ambition to become WWN? I have looked at Proton/Spark-Core, but is there something out there that may be more appropriate/compatible with the Nest-API? Thanks.

Basically anything that can run a web service. All you'll need to do is make an HTTP GET and PUT over HTTPS. More advanced things like Firebase and REST Streaming can still be easily done with a Raspberry Pi. I'm pretty sure an Arduino with a mini-web server can handle GETS and PUTS.

Related

Stream audio from place 1 to place 2 over the internet

So I'm kinda stuck here.
I have a radio station, but we are mobile. So I have a studio on wheels. The problem is, we have an antenna, but we always have to place that really close to our studio. Now I want to make an device that can stream the audio from the audio mixer to the internet and can be received by another device in another network and send that signal to the antenna (audio output).
to make this clear, I made a schema with raspberry pi's;
I want this to be plug and play So I only have to plug in the device in the modem (or network we have) on both sides and the devices should find each other.
I don't know HOW I can do this, so I need to know a couple of things:
What hardware should I use?
What software should I use?
What is the best configuration to accomplish this?
Can I use 2 raspberry pi's?
How can I let the devices find each other over the internet?
There need to be some features;
The system needs to be able to buffer the audio for 5-10 seconds
It needs to be direct, so it's live and not a file that needs to be played
The system must be failless (beside the fact the internet can die).
Plug and play is a must, I don't want to have a really messy configuration to do. (if possible, without any kind of portforwarding).
I would really appreciate help and a decent explaination.
regards,
Robin
Well, it depends on your capabilities as a programmer.
If you're really fixated on the RPi for it's convenient form factor, there's a ton of community support, so I'd start with something like this project to kick start you in the right direction. If you already know python pretty well, modify away and have fun.
If you have no programming experience, you'll probably want to put a desktop in place of the RPi and launch some instances of VLC. It's not necessarily plug n play, but you can get close enough by getting a command line VLC to launch at startup.
Either way, the more difficult problem here is the "over the internet" part. This would really need to be a server-client model, but who is your server depends on who is more stationary (I'm guessing Location 2?) because the client will need to know the IP address of the server somehow. There are dozens of ways to make this happen, but at the end of the day, you'll want to use sockets accomplish the
It needs to be direct, so it's live and not a file
... which unfortunately gets complicated. See this answer for confirmation. Would love to help with some tips on implementation, but we need more information about your willingness to "dig into the code", the necessity of the RPi, and whether the stationary location has a static web address.

The relationship between Firmata, Arduino and Node js

This is a basic question of understanding. I'm trying to follow this explanation http://www.barryvandam.com/node-js-communicating-with-arduino/ but something there sounds a bit off to me.
As far as I understood before, I only need to push the standard Firmata code into the Arduino and code via Node.js to call actions and information from the Arduino.
But in this link they point our that I need to upload a code to the Arduino, which will obviously delete the Firmata code that is now there. wouldn't it result in loosing connection to the Arduino?
How does it work?
many thanks!
The example above does not use Firmata, though Firmata makes things easier. If you want to implement your own serial control protocol, there nothing stopping you.
However, if you load StandardFirmata on your Arduino, and then use the Firmata.js package in node, then you have a full-featured, well established serial protocol and an api to access the pins from.
There are Firmata controller implementations for most languages out there.
On top of Firmata.js, you might choose to use an abstraction called Johnny-Five. Johnny-Five abstracts the pins as components, with an intuitive API. Instead of controlling a servo by setting a pin value, you create a servo, and call servo.to(angle). It is kind of like jQuery but for hardware. It abstracts the platforms and devices in such a way that the shape of the interface is the same, but the hardware might be completely different. It is a very comfortable place to develop from.
Firmata is a set of functions that you can pre-load onto your Arduino that libraries like Johnny-Five can call to perform certain tasks.
As previously said by the author of the accepted answer, you don't have to use it, you can write your own logic to send and receive custom message.
In Node.js you can use the node-serialport library to send the message:
myPort.write();
Then read the message from the Arduino with the built in Serial library:
while(radio.available()){
radio.read(chr, 1);
}
Firmata is one way to communicate with an Arduino, you do not have to use it.
You can "talk" to Arduindo directly using the SerialPort module - which is what the linked example is doing.

Node.js and Arduino

I am new to arduino, however I have experience in web development, lately I have been using, meteor js and the mean stack for different projects. I am open to trying any language though.
What I am trying to do is build a simple application to control the led on the arduino over the web.
I am working with another person and the arduino will be behind a firewall so I am not sure how to access it via the internet. I do have access to a arduino yun that I can use for testing at home which does have linio connected via bridge, which I dont quite understand what that does.
Ive also heard of this, https://www.yaler.net/ but would like to stay away from third party builds as much as possible if I can do it myself.
Whats the common way to do this with a arduino behind a firewall. and how do i do this with a arduino yun, is it easier with a yun?
So this is kind of a vague question, because we don't know exactly what your setup is and what's up with your firewall. But I'll try to help you out.
What I am trying to do is build a simple application to control the
led on the arduino over the web.
So this means you will need a web server running on the Arduino with a REST http client perhaps. You can easily find a dozen ways to do this by googling Arduino and REST, but here is one way you might go about it. Honestly though, I really wouldn't want to set up a REST server without a library.
From there, you simply set up a REST endpoint that when called, turns on the LED.
Whats the common way to do this with an Arduino behind a firewall.
This isn't remotely constrained to Arduinos. All (?) servers are behind a firewall. You will need to talk with your network administrator and have them open up the 80 port (for instance) and have it forward the call on the public port to the local Arduino server.
is it easier with a yun?
It doesn't matter what Arduino board you're running. It obviously has to have an ethernet or wireless port/shield but otherwise it doesn't matter.
I shouldn't even bring up the fact that googling "arduino rest controlled led" brought this link up... Besides the firewall, that appears to be exactly what you're looking for or will at least get you going.

Simple Universal Plug and Play ( uPNP ) to find Raspberry Pi on Network

I have a RaspberryPi connected to my home network via WiFi with a dynamic ip address. I then have my iPhone connected to the same network also via WiFi. The Pi has a lightweight c++ HTTP server running on it that can execute commands. I now want to write an Objective-C app that can find the Pi on the network, regardless of it's ip address, and send it commands. So, Universal Plug and Play seems like the logical solution - but everything I find on Google is dealing with Media players and streaming audio/video content.
I just want the Pi to somehow simply broadcast on my network - "Hey, I'm RasberryPi and my IP Address is 192.168.0.5!".
Can somebody please suggest a package or solution to this problem? Thanks!
For the RPi side I would suggest GUPnP as long as you can fulfill the dependency requirements. It's a very modular framework so you don't need to load or use any of the multimedia related things if you don't need them. It's based on glib and libsoup and allows you to fairly easily define and implement your own UPnP services. Take a look at the BinaryLight example: It implements a BinaryLight Device that contains a SwitchPower service with several methods and two state variables (properties). You should be able to hit the ground running if you start with that. There's documentation on how to write a server.
The components you are going to need/want:
libgssdp, handles discovery, used by gupnp
libgupnp, the actual upnp implementation, used by your app
the dependencies (glib, gio, gmodule, libsoup, libxml)
Also possibly for testing (this on a desktop linux machine since it requires gtk):
gupnp-tools, contains gupnp-universal-cp
EDIT: If you really don't want to implement any UPnP functionality, it's possible you could just use GSSDP for the IP discovery. This could be very simple: see test-publish example.

Controlling an Arduino over the web with the lowest latency

I have an Arduino board in a location, and a webserver.
I also have a website that is supposed to control the Arduino. What technique would allow users to take control of the Arduino board with the least amount of latency?
I have Node.js, socketserver, Jabber in mind to experiment with, but is this the right direction?
You should have a look at Socket.IO for implementing WebSockets on server- and client-side.
There's a great project called duino for accessing Arduino with Node.js, you "only" have to pipe all communication through WebSockets.
Update: In the meantime I have published a framework for sending commands to an Arduino with Node.JS, JavaScript and WebSockets. Make sure to have a look at Noduino!
I had good luck using node-serialport to talk to the Arduino. Using the serial port results in very low latency, and I used it to build a photobooth. The code is on GitHub if you want to check it out, though it's very poorly organized as I was rushing to get this done for my wedding and well... corners were cut.

Resources