Ss Brewing Technologies Giveaway!

Home Brew Forums > Home Brewing Beer > DIY Projects > TeensyPi Networked Temperature Controller
Reply
 
LinkBack Thread Tools
Old 03-06-2013, 02:07 AM   #201
jimmayhugh
Turgid Member
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
jimmayhugh's Avatar
Recipes 
 
Join Date: Feb 2011
Location: Las Vegas, NV
Posts: 581
Liked 46 Times on 41 Posts
Likes Given: 2

Default

The Teensy 3.0 and RPi both have initialization routines that they have to go through. In the RPi's case it's a complete boot of a full LAMP stack in a Linux OS. It takes a finite amount of time to get that all up and running. Once the RPi is up and running, the cron program can take up to a full minute to start the teensypi_daemon program that initializes the serial socket between the Teensy 3.0 and RPi.

The Apache webserver comes online before the MySQL database is initialized and started. Any attempts to access the Teensy 3.0 board at that point will probably result in a "Database not found" error.

Attempts to access Teensy 3.0 prior to the teensypi_daemon starting will probably result in "socket error" or "file or directory not found" errors.

These items can be addressed, but to me they are currently lower priority since the system does work if given the opportunity to get it's house in order. This is also why I've left the error messages on the webpage instead of using "die" or logging the errors straight to a file.

If I'm starting up from a dead start, I normally power everything up, and then open an ssh connection to the teensypi.local address. Since openssl starts after both Apache and MySQL when I am successfully logged in, I am reasonably assured that the teensypi_daemon will start in a minute or less.

You could also use the ssh terminal to view the apache error log to see exactly when the teensypi_daemon comes on line. On the command line enter

tail -f /var/www/log/error.log

and press enter. Now open a web page to teensypi.local. If the teensypi_daemon isn't yet running, you'll see a running error trail that will show the time. When the time crosses the :59 second mark, the cron program should fire, the daemon should start, and the page should refresh with the chip data.

I realize that I'm more familiar with the process and perhaps accept some of its quirks more easily that the rest of you , but rest assured that I am more than willing to work with anyone that is trying to get their system fully operational.

jimmayhugh is offline
 
Reply With Quote Quick reply to this message
Old 03-06-2013, 02:12 AM   #202
redbenn
Feedback Score: 0 reviews
Recipes 
 
Join Date: Dec 2009
Location: Chicago
Posts: 133
Liked 3 Times on 3 Posts

Default

For me that does not seem to be the problem. I can access everything on the TeensyPi (ssh, phpmyadmin, html pages, ftp, etc) just not pages with the MakeASocket.PHP include. I created some dummy .php pages to confirm it wasn't PHP. I have it hooked up to a monitor to confirm the boot is complete.

__________________
redbenn is offline
 
Reply With Quote Quick reply to this message
Old 03-06-2013, 02:19 AM   #203
jimmayhugh
Turgid Member
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
jimmayhugh's Avatar
Recipes 
 
Join Date: Feb 2011
Location: Las Vegas, NV
Posts: 581
Liked 46 Times on 41 Posts
Likes Given: 2

Default

The Teensy 3.0 led is ON when serial communications with the RPi is enabled, and OFF when the serial channel is restricted. Serial communications are restricted during the times that chips are being interrogated or written to, or when EEPROM is being written to.

If you have a small number of chips on the 1-wire bus, the LED will probably be ON most of the time, as chip interrogation and writes take very little time. When I'm running the full complement of 36 chips, the LED is very dim.

jimmayhugh is offline
 
Reply With Quote Quick reply to this message
Old 03-06-2013, 02:24 AM   #204
jimmayhugh
Turgid Member
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
jimmayhugh's Avatar
Recipes 
 
Join Date: Feb 2011
Location: Las Vegas, NV
Posts: 581
Liked 46 Times on 41 Posts
Likes Given: 2

Default

Quote:
Originally Posted by redbenn View Post
For me that does not seem to be the problem. I can access everything on the TeensyPi (ssh, phpmyadmin, html pages, ftp, etc) just not pages with the MakeASocket.PHP include. I created some dummy .php pages to confirm it wasn't PHP. I have it hooked up to a monitor to confirm the boot is complete.
Open a ssh terminal and type

ps aux | grep teensypi_daemon | grep -v grep

and press enter.

You should get just one teensypi_daemon result. If you have more than one (this happens sometimes, though I'm not sure why yet) look at the PID value of each daemon and then kill both with

sudo kill -9 PID#1 PID#2

where PID#1 and PID #2 are the actual PID values. Then allow cron to restart the daemon.

Gotta go, SWMBO's giving me the stink-eye, and dinner's getting cold.
jimmayhugh is offline
 
Reply With Quote Quick reply to this message
Old 03-06-2013, 03:43 PM   #205
jsbird
HBT_SUPPORTER.png
Feedback Score: 0 reviews
Recipes 
 
Join Date: Oct 2012
Posts: 39
Likes Given: 2

Default

Quote:
Originally Posted by jimmayhugh View Post
The COSM feed is redbenn's baby, so maybe he could chime in on that.

As for the onboard data collection, it only runs when the Action or PID is enabled. If it ran all the time, it would rack up a huge mysql database file in a fairly short period of time, and since I haven't yet provided a web page to allow the data to be removed from the database. I felt that was a prudent step to take.

Ran my rice cooker test last night and didn't have any issues with the onboard data collection. Ran it in the standard temp control mode so I'm anxious to test the PID tonight. Apologies for modifying the logo but I needed to make it family friendly (plus I impressed myself with figuring out how to do it....). I'll work on the COSM feed tonight as well. Looking forward to some sous vide eggs (148deg for an hour) as the first tangible (and edible!) output of my build, assuming the PID tuning goes well! I can't start my eKettle build until I have a working control system so I'll keep testing.
photo.jpg  
__________________
jsbird is offline
 
Reply With Quote Quick reply to this message
Old 03-06-2013, 06:19 PM   #206
jimmayhugh
Turgid Member
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
jimmayhugh's Avatar
Recipes 
 
Join Date: Feb 2011
Location: Las Vegas, NV
Posts: 581
Liked 46 Times on 41 Posts
Likes Given: 2

Default

No need to apologize, this is free and open software. All I ask is that if you improve or add a useful feature, make the source code available.

__________________
TeensyNet Networked Controller
ButtCrack Brewery
And This Is Why We Drink...
jimmayhugh is offline
bregiz Likes This 
Reply With Quote Quick reply to this message
Old 03-08-2013, 12:07 AM   #207
HornetSparky
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jan 2012
Location: Virginia Beach, VA
Posts: 81
Liked 24 Times on 15 Posts
Likes Given: 2

Default

Have you looked at using an Arduino Ethernet or wifi shield to post the data to a home server? As I have a NAS/media server running at my house, that seems to make sense. I was reading the installation wiki and noticed that the RPi communicates with the Arduino via the serial bus. I have put this on my project to do list, though notably without a date and will ultimately (and hopefully) get sufficiently familiar with the hardware and code to make the arduino-only config happen. Just curious if you had looked at any of that and had any initial guidance for me.

Great work! Spectacular project.

__________________
HornetSparky is offline
 
Reply With Quote Quick reply to this message
Old 03-08-2013, 01:31 AM   #208
jimmayhugh
Turgid Member
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
jimmayhugh's Avatar
Recipes 
 
Join Date: Feb 2011
Location: Las Vegas, NV
Posts: 581
Liked 46 Times on 41 Posts
Likes Given: 2

Default

Quote:
Originally Posted by HornetSparky View Post
Have you looked at using an Arduino Ethernet or wifi shield to post the data to a home server? As I have a NAS/media server running at my house, that seems to make sense. I was reading the installation wiki and noticed that the RPi communicates with the Arduino via the serial bus. I have put this on my project to do list, though notably without a date and will ultimately (and hopefully) get sufficiently familiar with the hardware and code to make the arduino-only config happen. Just curious if you had looked at any of that and had any initial guidance for me.

Great work! Spectacular project.
I originally started this project using a Freetronics Ether10, and then a Freetronics EtherMega. I moved to the RPi since I could get a full linux / LAMP stack for what I was paying for a real arduino ethernet shield. When I found the Teensy 3.0 board, the project morphed into what it is now.

While I could serve a small number of web pages with an Arduino/ethernet shield combo, it drastically reduced the number of devices I could control and made changes and naming of devices problematic. The Teensy 3.0 / RPi configuration is scalable and highly modifyable (see redbenn's upcoming UI as an example).
__________________
TeensyNet Networked Controller
ButtCrack Brewery
And This Is Why We Drink...
jimmayhugh is offline
 
Reply With Quote Quick reply to this message
Old 03-08-2013, 02:38 AM   #209
HornetSparky
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jan 2012
Location: Virginia Beach, VA
Posts: 81
Liked 24 Times on 15 Posts
Likes Given: 2

Default

Sorry--I don't know how I got the Teensy and Arduino boards swapped as I read the wiki and the thread. What I was really getting at was using my existing LAMP server with a controller board. The part that I haven't skinned, though, is the connection between the controller board (Teensy or whatever) and the server. More thinking to come on that topic, I suppose.

__________________
HornetSparky is offline
 
Reply With Quote Quick reply to this message
Old 03-08-2013, 02:21 PM   #210
jimmayhugh
Turgid Member
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
jimmayhugh's Avatar
Recipes 
 
Join Date: Feb 2011
Location: Las Vegas, NV
Posts: 581
Liked 46 Times on 41 Posts
Likes Given: 2

Default

Quote:
Originally Posted by HornetSparky View Post
Sorry--I don't know how I got the Teensy and Arduino boards swapped as I read the wiki and the thread. What I was really getting at was using my existing LAMP server with a controller board. The part that I haven't skinned, though, is the connection between the controller board (Teensy or whatever) and the server. More thinking to come on that topic, I suppose.
You could use any Linux LAMP stack, you'd just need to control one of the serial ports via the teensypi_daemon, and use level shifters to get the TTL/RS-232 down to 3v3 for the TeensyPi or 5v for an Arduino Mega2560.
__________________
TeensyNet Networked Controller
ButtCrack Brewery
And This Is Why We Drink...
jimmayhugh is offline
 
Reply With Quote Quick reply to this message
Reply



Quick Reply
Message:
Options
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arduino - Networked Temperature Monitor jimmayhugh DIY Projects 81 01-27-2013 12:22 AM
Temperature Controller sy2088 Equipment/Sanitation 3 10-25-2012 06:28 PM
Lux Temperature Controller scoots DIY Projects 9 07-06-2012 01:38 PM
temperature controller from deas fridge - use as external controller on live fridge? BrewingChemist DIY Projects 1 05-22-2012 10:21 PM
Johnson Analog Temperature Controller Temperature Profile Coastarine Equipment/Sanitation 4 10-11-2010 03:58 PM