vulture2600:
I like this. I'd like to see some very basic examples of how you might set up a thermostat to run on the arduino side and display a temp value to a web page, and allow a button press to send a command to change a parameter back on the arduino.
I don't have any existing samples that would show something like this, anything I have is part of a much bigger project - including a snippet of code may not be helpful, and including the whole thing would just be confusing.
You mention running the thermostat on the Arduino side - I would approach a project like this from the opposite direction: put as much logic as possible on the Linux side. All of the control data, processing, and web interface is in one place, and you don't have to move as much data between the two sides of the Yun. The Arduino side would be just a dumb I/O processor, reading temperature and other sensors and sending the raw data to the Linux side, and receiving output states from the Linux side and controlling output signals.
That idea is similar to a project a posted about a while ago: HowTo: Using RRD - Round Robin Database
While that discussion goes into a tangent that is not necessarily applicable to what you want to do, the general architecture could be applicable to your project. This was a very simple lighting controller: it could control a relay to turn a lighting load on and off, and it had a current transformer to monitor how much power was being consumed by the lights. All of the logic to decide when to turn the light on and off, and to monitor the power consumption and determine if there was a burned out bulb or other problem, was all on the Linux side. The communications between the two sides was very simple: the sketch periodically read the analog input and sent the raw value to the Process object using println(), and the Linux side would respond with a 1 or zero value to indicate if the relay should be on or off. It was trivial for me since I had only one value to send in each direction, so the only delimiter I needed was a line terminator. If you have more than one value, you will need to come up with a format for the data: either a fixed number of characters where you just count characters, or use delimiters like commas, or something along those lines. This is basically the same issue you would have if you were using a straight serial connection.
For the web interface, I used the Python based Bottle framework. There are plenty of other options out there as well. Use whatever you are comfortable with. The sketch used a Process object to launch the Python script that ran the Bottle application and also handled the communications with the sketch. All of the control information was local to the Python script, and only the low-level control information was sent between the sketch and the Python script.
vulture2600:
Another question:
Serial.begin(9600) seems to be the default for bridge. Should I increase that to speed things up? Woudn't I have to modify something on the linux side so theyre the same speed?
Its easy to change on the serial monitor but I have no idea how to change it on the linux side.
The following is based on a real Yun board. Using a Yun Shield with some other Arduino board may be different, I have no direct experience with it.
Serial.begin(9600) initializes the USB serial port connection to your computer, and allows talking to the Serial Monitor or other terminal emulator. Since it is a USB connection that is managed directly by the '32U4 processor running the sketch, the baud rate is meaningless. You can use any value, and it makes no difference.
The communications to the Linux side is done using Serial1, which is a different interface that is managed by the Bridge library. You don't have to worry about the baud rate there, as it already uses a quite fast rate. (I don't remember the speed, but it's somewhere over a hundred thousand bits per second, if I recall correctly.)