TeensyPi Networked Temperature Controller

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
The library files should be available here



The MEGA2560 has more flash and EEPROM, but less SRAM than the Teensy 3.0.

The SRAM is where all of the arrays for the chips, actions, and PIDs are stored, as well as much of the debug strings and the last compile used an estimated 8164 bytes of SRAM. I'd probably not chance it as-is. :drunk:

To make it work on the MEGA2560, you'd have to reduce the number of available chip, action and PID arrays, or strip out all of the debug code.

You'd also need level converters to use the 5v MEGA2560 with the 3.3v RPi.

Other than that, I can't think of a reason why it shouldn't compile and run. :D

Thx I'll give it a try and report back
 
Thx I'll give it a try and report back

OK, .ino file compiled without errors. Going to try to upload it, but first I have to setup RPi. I have a question regarding I2C level shifter. Your is I2C safe. What does that mean, and can I use any I2C level shifter? (I have a 2-ch level shifter)
 
OK, .ino file compiled without errors. Going to try to upload it, but first I have to setup RPi. I have a question regarding I2C level shifter. Your is I2C safe. What does that mean, and can I use any I2C level shifter? (I have a 2-ch level shifter)

I2C uses a pullup scheme that confuses some level shifters. As long as it's specifically made for I2C, it should be fine.
 
I2C uses a pullup scheme that confuses some level shifters. As long as it's specifically made for I2C, it should be fine.

Uf, I am confused now....nothing to do with level shifters, but the thing is, I downloaded your teensypi.img and loaded it to my sd card. RPi boots, everything is ok, I dont have wifi, it is connecting via eth, I can ping it, can ssh to it, but when I try to access it via browser, nothing happens? What I am doing wrong? nmap shows ports 22, 80 and 10000 open, but no web page is showing. Its killing me....:confused:
 
Uf, I am confused now....nothing to do with level shifters, but the thing is, I downloaded your teensypi.img and loaded it to my sd card. RPi boots, everything is ok, I dont have wifi, it is connecting via eth, I can ping it, can ssh to it, but when I try to access it via browser, nothing happens? What I am doing wrong? nmap shows ports 22, 80 and 10000 open, but no web page is showing. Its killing me....:confused:

What URL are you attempting to connect to? What is the IP address?
 
What URL are you attempting to connect to? What is the IP address?

DHCP server asigned the RPi 192.168.10.127.
This is the output of nmap:

Code:
zdravac@jamadol-desktop:~$ sudo nmap -v 192.168.10.127
[sudo] password for zdravac: 

Starting Nmap 5.21 ( http://nmap.org ) at 2013-04-23 09:08 CEST
Initiating ARP Ping Scan at 09:08
Scanning 192.168.10.127 [1 port]
Completed ARP Ping Scan at 09:08, 0.00s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 09:08
Completed Parallel DNS resolution of 1 host. at 09:08, 0.00s elapsed
Initiating SYN Stealth Scan at 09:08
Scanning teensypi.jamadol.local (192.168.10.127) [1000 ports]
Discovered open port 22/tcp on 192.168.10.127
Discovered open port 80/tcp on 192.168.10.127
Discovered open port 10000/tcp on 192.168.10.127
Completed SYN Stealth Scan at 09:08, 0.14s elapsed (1000 total ports)
Nmap scan report for teensypi.jamadol.local (192.168.10.127)
Host is up (0.0033s latency).
Not shown: 997 closed ports
PORT      STATE SERVICE
22/tcp    open  ssh
80/tcp    open  http
10000/tcp open  snet-sensor-mgmt
MAC Address: B8:27:EB:64:54:D4 (Unknown)

Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 0.21 seconds
           Raw packets sent: 1001 (44.042KB) | Rcvd: 1001 (40.054KB)

so all should be good. I can ping it. But when I enter "192.168.10.127" in web browser, nothing happens. No error, it just tries to load the page, but no luck.
 
Can you ssh into the RPi? If so, take a look at /var/www/htdocs and make sure that the php files are there, and the permissions are set. The user.group should be teensypi.www-data.
 
Can you ssh into the RPi? If so, take a look at /var/www/htdocs and make sure that the php files are there, and the permissions are set. The user.group should be teensypi.www-data.

SSH works. Files are there:

Code:
drwxrwxr-x  2 teensypi www-data  4096 Apr  7 16:42 .
drwxrwxr-x  9 teensypi www-data  4096 Dec 15 20:49 ..
-rw-rw-r--  1 teensypi www-data 10850 Mar 16 20:54 ActionData.php
-rw-rw-r--  1 teensypi www-data 20711 Mar 31 21:35 ActionDataWithMySQL.php
-rw-rw-r--  1 teensypi teensypi  5221 Apr  7 16:42 ActionStatus.php
-rw-rw-r--  1 teensypi www-data  2855 Mar 16 20:54 ActionUpdate.php
-rw-r--r--  1 teensypi teensypi  6764 Apr  6 17:35 CheckForNewRestore.php
-rw-rw-r--  1 teensypi www-data  6511 Mar 16 20:54 ChipData.php
-rw-r--r--  1 teensypi www-data  9387 Mar 16 20:54 PHP_GnuPlot.php
-rw-r--r--  1 teensypi www-data 12318 Mar 16 20:54 PidSetup.php
-rw-r--r--  1 teensypi www-data  6502 Mar 16 20:54 PidStatus.php
-rw-r--r--. 1 teensypi www-data  3412 Mar 16 20:54 SetupRestore.php
-rw-r--r--  1 teensypi www-data  7948 Mar 16 20:54 UpdateNames.php
-rw-rw-r--  1 teensypi www-data   207 Mar 16 20:54 accessDatabase.php
-rw-r--r--  1 teensypi www-data   181 Mar 31 19:47 checkForExec.php
-rw-rw-r--  1 teensypi www-data  1150 Mar 16 20:54 favicon.ico
-rw-rw-r--  1 teensypi www-data  1330 Mar 16 20:54 getAllStatus.php
-rw-r--r--  1 teensypi www-data   480 Mar 16 20:54 getCommand.php
-rw-rw-r--  1 teensypi www-data   274 Mar 16 20:54 getMaxChips.php
-rw-r--r--  1 teensypi www-data  2358 Mar 16 20:54 graphActions.php
-rw-rw-r--  1 teensypi www-data   255 Mar 16 20:54 head.html
-rw-r--r--  1 teensypi www-data   291 Mar 16 20:54 header.html
-rwxr-xr-x  1 teensypi www-data 28140 Apr  6 15:55 i2c_lcd
-rw-rw-r--  1 teensypi www-data  1462 Mar 16 20:54 index.php
-rw-r--r--  1 teensypi www-data   555 Mar 31 21:31 killall.php
-rw-rw-r--  1 teensypi www-data  1579 Mar 16 20:54 makeASocket.php
-rw-rw-r--  1 teensypi www-data   282 Mar 16 20:54 menu.html
-rw-r--r--  1 teensypi www-data    22 Mar 16 20:54 phpinfo.php
-rw-r--r--  1 teensypi www-data 14424 Mar 16 23:46 plotData.php
-rw-r--r--  1 teensypi www-data 14793 Mar 16 20:54 plotPidData.php
-rw-rw-r--  1 teensypi www-data   375 Mar 16 20:54 setActionSwitch.php
-rw-rw-r--  1 teensypi www-data   374 Mar 16 20:54 setSwitch.php
-rw-r--r--  1 teensypi www-data   104 Mar 31 21:31 startI2CLCD.php
-rw-rw-r--  1 teensypi www-data  1466 Mar 16 20:54 style.css
-rw-rw-r--  1 teensypi www-data 11435 Mar 16 20:54 updateActionStatus.php
-rw-rw-r--  1 teensypi www-data 12218 Mar 23 07:29 updateActionStatusWithMySQL.php
-rw-r--r--  1 teensypi www-data 11362 Mar 16 20:54 updatePidStatusWithMySQL.php
-rw-rw-r--  1 teensypi www-data  3736 Mar 16 20:54 updateStatus.php

hope files are all there. I noticed that ActionStatus.php & CheckForNewRestore.php belong to teensypi group not www-data. Is this relevant?


Changed ownership of those files, and its still the same.

In the meantime, I was snooping around a little; whats interesting is that /var/log/apache2/access.log is empty (no acess, right?), also other_vhosts_access.log. error.log shows no error.

dmesg - nothing suspicious. What to look for next?

And I almost forgot, I did "cat /proc/meminfo" once and it says MemFree: 9800 kB, the next time I entered the same command I got "-su: fork: Cannot allocate memory"

I guess I'll try setting the LAMP server from scratch if I soon don't fix this.
 
SSH works. Files are there:

Code:
drwxrwxr-x  2 teensypi www-data  4096 Apr  7 16:42 .
drwxrwxr-x  9 teensypi www-data  4096 Dec 15 20:49 ..
-rw-rw-r--  1 teensypi www-data 10850 Mar 16 20:54 ActionData.php
-rw-rw-r--  1 teensypi www-data 20711 Mar 31 21:35 ActionDataWithMySQL.php
-rw-rw-r--  1 teensypi teensypi  5221 Apr  7 16:42 ActionStatus.php
-rw-rw-r--  1 teensypi www-data  2855 Mar 16 20:54 ActionUpdate.php
-rw-r--r--  1 teensypi teensypi  6764 Apr  6 17:35 CheckForNewRestore.php
-rw-rw-r--  1 teensypi www-data  6511 Mar 16 20:54 ChipData.php
-rw-r--r--  1 teensypi www-data  9387 Mar 16 20:54 PHP_GnuPlot.php
-rw-r--r--  1 teensypi www-data 12318 Mar 16 20:54 PidSetup.php
-rw-r--r--  1 teensypi www-data  6502 Mar 16 20:54 PidStatus.php
-rw-r--r--. 1 teensypi www-data  3412 Mar 16 20:54 SetupRestore.php
-rw-r--r--  1 teensypi www-data  7948 Mar 16 20:54 UpdateNames.php
-rw-rw-r--  1 teensypi www-data   207 Mar 16 20:54 accessDatabase.php
-rw-r--r--  1 teensypi www-data   181 Mar 31 19:47 checkForExec.php
-rw-rw-r--  1 teensypi www-data  1150 Mar 16 20:54 favicon.ico
-rw-rw-r--  1 teensypi www-data  1330 Mar 16 20:54 getAllStatus.php
-rw-r--r--  1 teensypi www-data   480 Mar 16 20:54 getCommand.php
-rw-rw-r--  1 teensypi www-data   274 Mar 16 20:54 getMaxChips.php
-rw-r--r--  1 teensypi www-data  2358 Mar 16 20:54 graphActions.php
-rw-rw-r--  1 teensypi www-data   255 Mar 16 20:54 head.html
-rw-r--r--  1 teensypi www-data   291 Mar 16 20:54 header.html
-rwxr-xr-x  1 teensypi www-data 28140 Apr  6 15:55 i2c_lcd
-rw-rw-r--  1 teensypi www-data  1462 Mar 16 20:54 index.php
-rw-r--r--  1 teensypi www-data   555 Mar 31 21:31 killall.php
-rw-rw-r--  1 teensypi www-data  1579 Mar 16 20:54 makeASocket.php
-rw-rw-r--  1 teensypi www-data   282 Mar 16 20:54 menu.html
-rw-r--r--  1 teensypi www-data    22 Mar 16 20:54 phpinfo.php
-rw-r--r--  1 teensypi www-data 14424 Mar 16 23:46 plotData.php
-rw-r--r--  1 teensypi www-data 14793 Mar 16 20:54 plotPidData.php
-rw-rw-r--  1 teensypi www-data   375 Mar 16 20:54 setActionSwitch.php
-rw-rw-r--  1 teensypi www-data   374 Mar 16 20:54 setSwitch.php
-rw-r--r--  1 teensypi www-data   104 Mar 31 21:31 startI2CLCD.php
-rw-rw-r--  1 teensypi www-data  1466 Mar 16 20:54 style.css
-rw-rw-r--  1 teensypi www-data 11435 Mar 16 20:54 updateActionStatus.php
-rw-rw-r--  1 teensypi www-data 12218 Mar 23 07:29 updateActionStatusWithMySQL.php
-rw-r--r--  1 teensypi www-data 11362 Mar 16 20:54 updatePidStatusWithMySQL.php
-rw-rw-r--  1 teensypi www-data  3736 Mar 16 20:54 updateStatus.php

hope files are all there. I noticed that ActionStatus.php & CheckForNewRestore.php belong to teensypi group not www-data. Is this relevant?


Changed ownership of those files, and its still the same.

In the meantime, I was snooping around a little; whats interesting is that /var/log/apache2/access.log is empty (no acess, right?), also other_vhosts_access.log. error.log shows no error.

dmesg - nothing suspicious. What to look for next?

And I almost forgot, I did "cat /proc/meminfo" once and it says MemFree: 9800 kB, the next time I entered the same command I got "-su: fork: Cannot allocate memory"

I guess I'll try setting the LAMP server from scratch if I soon don't fix this.

Take a look at /var/www/logs/error.log and /var/www/logs/access.log. Are you just getting a blank screen, or is the page not loading? I'm beginning to suspect a problem with one of the php scripts.
 
Take a look at /var/www/logs/error.log and /var/www/logs/access.log. Are you just getting a blank screen, or is the page not loading? I'm beginning to suspect a problem with one of the php scripts.

I can't look at those files right now, but the page isn't loading. I use google chrome, and that pointer on the tab is just turning round'n'round. It never stops. Browser doesn't report an error. I would be satisfied with an error of any kind, but I'm not getting one.

Before blaming the php scripts, maybe, on my end it has to do with apache server. I don't know what u did with the SD card image before u made it available for download, I guess u did some cleaning of personal files, databases and such... Maybe something is missing here that is vital for apache daemon to function properly... dont know, I installed a fresh copy of occidentalis v0.2 on my sd card, and am going to try to enable LAMP on it, and see what happens. If u have some other suggestion on what distro to use for start, please do. I'm willing to try it.

thx and sorry for bothering u
 
I can't look at those files right now, but the page isn't loading. I use google chrome, and that pointer on the tab is just turning round'n'round. It never stops. Browser doesn't report an error. I would be satisfied with an error of any kind, but I'm not getting one.

Before blaming the php scripts, maybe, on my end it has to do with apache server. I don't know what u did with the SD card image before u made it available for download, I guess u did some cleaning of personal files, databases and such... Maybe something is missing here that is vital for apache daemon to function properly... dont know, I installed a fresh copy of occidentalis v0.2 on my sd card, and am going to try to enable LAMP on it, and see what happens. If u have some other suggestion on what distro to use for start, please do. I'm willing to try it.

thx and sorry for bothering u

Right now, I'm at a loss :mad:

I just downloaded the image zip file from my website, unzipped it, and dd'd it onto an SD card, plugged it into a RPi/Teensy3.0 setup, and it fired right up. I use the Chrome, Firefox and Opera browsers to access the TeensyPi. I can access it both by its hostname and its IP address.

I just noticed that you're using "teensypi.jamadol.local". Have you modified /etc/hostname and /etc/hosts to reflect the name change?

I originally used Occidentalis 2.0, but I didn't like all the additional programs and cruft that I figured I'd never use, so I went with the stripped-down Moebius distro, and rolled my own.

Please keep me informed, this is not a bother at all. I want this stuff to work right. ;)
 
Right now, I'm at a loss :mad:

I just downloaded the image zip file from my website, unzipped it, and dd'd it onto an SD card, plugged it into a RPi/Teensy3.0 setup, and it fired right up. I use the Chrome, Firefox and Opera browsers to access the TeensyPi. I can access it both by its hostname and its IP address.

I just noticed that you're using "teensypi.jamadol.local". Have you modified /etc/hostname and /etc/hosts to reflect the name change?

I originally used Occidentalis 2.0, but I didn't like all the additional programs and cruft that I figured I'd never use, so I went with the stripped-down Moebius distro, and rolled my own.

Please keep me informed, this is not a bother at all. I want this stuff to work right. ;)

Thanks for the hint on Moebius, I geather that's going to be my next step, if this doesnt work soon.

Concerning /etc/hostname:

Code:
teensypi@teensypi /etc $ cat hostname
teensypi

and /etc/hosts:

Code:
teensypi@teensypi /etc $ cat hosts
# RaspberryPI hosts configuration file
127.0.0.1       localhost teensypi teensypi
127.0.1.1	teensypi

I suppose thats alright cause I can ping RPi via hostname:

Code:
zdravac@jamadol-desktop:~$ ping teensypi
PING teensypi.jamadol.local (192.168.10.127) 56(84) bytes of data.
64 bytes from teensypi.jamadol.local (192.168.10.127): icmp_req=1 ttl=64 time=0.569 ms
64 bytes from teensypi.jamadol.local (192.168.10.127): icmp_req=2 ttl=64 time=0.663 ms
64 bytes from teensypi.jamadol.local (192.168.10.127): icmp_req=3 ttl=64 time=0.667 ms

So, I tried again with your image, dd it to SD card and tried hhtp access. At first, the browser didn't show a page, but when I killed the teensypi_daemon the page showed up with the error: "socket_connect() failed. Reason: () Connection refused" (logo and the menu also showed up). After that teensypi_daemon respawns and when I try to refresh the web page, again nothing happens. How much RAM does your RPi have? Mine has 256M. Maybe thats the reason for malfunctioning??
 
I had similar problems with the web pages not loading but the device being accessible otherwise. It turned out to be a poor solder point on one of the sensors initially and then an underpowered bus for my sensors. I was using 1a total for everything which just wasn't enough. Using a 2a power supply solved my problem.
 
Thanks for the hint on Moebius, I geather that's going to be my next step, if this doesnt work soon.

Concerning /etc/hostname:

Code:
teensypi@teensypi /etc $ cat hostname
teensypi

and /etc/hosts:

Code:
teensypi@teensypi /etc $ cat hosts
# RaspberryPI hosts configuration file
127.0.0.1       localhost teensypi teensypi
127.0.1.1	teensypi

I suppose thats alright cause I can ping RPi via hostname:

Code:
zdravac@jamadol-desktop:~$ ping teensypi
PING teensypi.jamadol.local (192.168.10.127) 56(84) bytes of data.
64 bytes from teensypi.jamadol.local (192.168.10.127): icmp_req=1 ttl=64 time=0.569 ms
64 bytes from teensypi.jamadol.local (192.168.10.127): icmp_req=2 ttl=64 time=0.663 ms
64 bytes from teensypi.jamadol.local (192.168.10.127): icmp_req=3 ttl=64 time=0.667 ms

So, I tried again with your image, dd it to SD card and tried hhtp access. At first, the browser didn't show a page, but when I killed the teensypi_daemon the page showed up with the error: "socket_connect() failed. Reason: () Connection refused" (logo and the menu also showed up). After that teensypi_daemon respawns and when I try to refresh the web page, again nothing happens. How much RAM does your RPi have? Mine has 256M. Maybe thats the reason for malfunctioning??

I have one 256MB and several 512MB and the software works on both (just checked).

Try changing the /etc/hostname from teensypi to teensypi.jamadol, ditto with /etc/hosts.
 
I had similar problems with the web pages not loading but the device being accessible otherwise. It turned out to be a poor solder point on one of the sensors initially and then an underpowered bus for my sensors. I was using 1a total for everything which just wasn't enough. Using a 2a power supply solved my problem.

Good point, I use a 5v/5a switching supply
 
I had similar problems with the web pages not loading but the device being accessible otherwise. It turned out to be a poor solder point on one of the sensors initially and then an underpowered bus for my sensors. I was using 1a total for everything which just wasn't enough. Using a 2a power supply solved my problem.

I started with 1A power supply, but as you say, that's not enough. Switched to 2,1A. Still are not able to see web pages. Other ways of access are working.
 
Good point, I use a 5v/5a switching supply

I'll try to get 5A power supply, but I'm guessing 2,1A should be good enough. The thing is when I kill the teensypi_daemon process, and before it respawns again, I can see web pages.

Regarding hosts and hostname files; my local domain name is "jamadol.local" hostname is still "tensypi". Anyway I tried your suggestion, but it didn't help.

Still the same, I guess teensypi_daemon is in some way interfering with apache server.
 
I'll try to get 5A power supply, but I'm guessing 2,1A should be good enough. The thing is when I kill the teensypi_daemon process, and before it respawns again, I can see web pages.

Regarding hosts and hostname files; my local domain name is "jamadol.local" hostname is still "tensypi". Anyway I tried your suggestion, but it didn't help.

Still the same, I guess teensypi_daemon is in some way interfering with apache server.

The teensypi_daemon controls the serial communications between the Teensy 3.0 board and the RPi. Give this a try:

Shut down the Apache Server:
Code:
sudo apachectl stop

Kill the teensypi_daemon
Code:
sudo killall teensypi_daemon

Wait a few seconds for the daemon to re-appear, and verify that its there:
Code:
ps aux | grep teensypi_daemon | grep -v grep

Go to /var/www/htdocs

Send a command to the Teensy 3.0 board:
Code:
sudo php getCommand.php 7

and post the result here.

What you should see is a comma-delimited list of values, listing either the current temperature or state of each temp sensor or switch.

Let me know how that works out.
 
Although a 5-amp power supply would be great for the Pi, it really isn't necessary. For that matter, neither is a 2-amp. The Pi needs 5 volts, +/- 5%, to operate correctly. With the Pi operating under a reasonable load, measure the voltage on the board between TP1 and TP2; it should be between 4.75 and 5.25 volts (within this range, higher is probably better). If it's lower than 4.75, you need more power. A 1-amp supply, if it's well-regulated and able to output 5.0 volts at 1 amp, should be entirely adequate for the Pi. The problem is that so many supplies are marked rather optimistically.
 
Although a 5-amp power supply would be great for the Pi, it really isn't necessary. For that matter, neither is a 2-amp. The Pi needs 5 volts, +/- 5%, to operate correctly. With the Pi operating under a reasonable load, measure the voltage on the board between TP1 and TP2; it should be between 4.75 and 5.25 volts (within this range, higher is probably better). If it's lower than 4.75, you need more power. A 1-amp supply, if it's well-regulated and able to output 5.0 volts at 1 amp, should be entirely adequate for the Pi. The problem is that so many supplies are marked rather optimistically.

True this if all you are running is the RPi. I, on the other hand, am running a multiple 4x20 LCD, numerous LEDs, and have plans for other power-hungry devices, and I don't have room for numerous wall warts.

I've converted one of my old PC power supplies to work as a bench supply for other projects.
 
Here are the I2C RGB LCD boards that I designed:
LCD_Cards.png


The upper board is the current iteration.

They are compatible with the Adafruit I2C RGB LCD boards, but can also be expanded to include up to eight of the LCDs on the I2C bus.

The software I've written will support either the RGB LCDs or the standard HD44780 LCD.

More info at my web site.

:ban:
 
The teensypi_daemon controls the serial communications between the Teensy 3.0 board and the RPi. Give this a try:

Shut down the Apache Server:
Code:
sudo apachectl stop

Kill the teensypi_daemon
Code:
sudo killall teensypi_daemon

Wait a few seconds for the daemon to re-appear, and verify that its there:
Code:
ps aux | grep teensypi_daemon | grep -v grep

Go to /var/www/htdocs

Send a command to the Teensy 3.0 board:
Code:
sudo php getCommand.php 7

and post the result here.

What you should see is a comma-delimited list of values, listing either the current temperature or state of each temp sensor or switch.

Let me know how that works out.

I did everything you said. The result is:

Code:
teensypi@teensypi /var/www/htdocs $ sudo php getCommand.php 7

Number of Arguments:2
getCommand.php
7

I don't know what is wrong here, but the web page is visible only when the teensypi_daemon is not running. I even tried a different SD card, but with no luck.

Also I noticed that teensypi_daemon is taking 90-97% of cpu time. Is that normal? Does that have anything to do with the fact that I am only running RPi, and no MEGA (or Teensy) on the other side of serial?
 
I did everything you said. The result is:

teensypi@teensypi /var/www/htdocs $ sudo php getCommand.php 7

Number of Arguments:2
getCommand.php
7


I don't know what is wrong here, but the web page is visible only when the teensypi_daemon is not running. I even tried a different SD card, but with no luck.

Also I noticed that teensypi_daemon is taking 90-97% of cpu time. Is that normal? Does that have anything to do with the fact that I am only running RPi, and no MEGA (or Teensy) on the other side of serial?

Now it makes more sense...

Yeah, things will work much better when you have at least a Teensy 3.0 or Mega2650 hooked up and have at least one sensor or switch attached to the 1-Wire mini-lan.

The teensy_daemon runs continuously, and if nothing else is pre-empting it, will appear to be consuming a lot of resource. Once you have other parts of the TeensyPi system engaged, things will settle down.
 
My switchboards arrived from HK and the look great. Unfortunately I think I bought the wrong size/watts versions. I bought 1/2W and from the board outline and contacts they look big. Can you confirm which wattage you designed the board for jimmaugh?

LCD boards shipped 9 days later so hoping to have them next week!

Thx!
 
jsbird said:
My switchboards arrived from HK and the look great. Unfortunately I think I bought the wrong size/watts versions. I bought 1/2W and from the board outline and contacts they look big. Can you confirm which wattage you designed the board for jimmaugh?

LCD boards shipped 9 days later so hoping to have them next week!

Thx!
Should clarify that I'm talking about the wrong wattage resistors.
 
My switchboards arrived from HK and the look great. Unfortunately I think I bought the wrong size/watts versions. I bought 1/2W and from the board outline and contacts they look big. Can you confirm which wattage you designed the board for jimmaugh?

LCD boards shipped 9 days later so hoping to have them next week!

Thx!

I use either 1/4 watt or 1/8 watt resistors, whichever is available at the time. The 1/2 watt resistor will work electronically, just don't know if they'll fit in the mounting holes.
 
Now it makes more sense...

Yeah, things will work much better when you have at least a Teensy 3.0 or Mega2650 hooked up and have at least one sensor or switch attached to the 1-Wire mini-lan.

The teensy_daemon runs continuously, and if nothing else is pre-empting it, will appear to be consuming a lot of resource. Once you have other parts of the TeensyPi system engaged, things will settle down.

Hi Jim!

I am trying to get MEGA2560 to work with your sketch. Is there something I have to adjust, since you are using this sketch on Teensy? (eeprom addresses and such) cause only thing I get on serial monitor is

Code:
Serial Debug running at 115200 baud
Serial1 Debug running at 115200 baud

and nothing else. No eeprom messages, what I would expect, regarding it's in your code beetwen serial and serial1 stuff in void setup(). I have one wire temp sensors on pin 9 connected, btw.
 
Hi Jim!

I am trying to get MEGA2560 to work with your sketch. Is there something I have to adjust, since you are using this sketch on Teensy? (eeprom addresses and such) cause only thing I get on serial monitor is

Code:
Serial Debug running at 115200 baud
Serial1 Debug running at 115200 baud

and nothing else. No eeprom messages, what I would expect, regarding it's in your code beetwen serial and serial1 stuff in void setup(). I have one wire temp sensors on pin 9 connected, btw.

OK, I'm assuming that you did everything mentioned here, especially the level converters.

Go into the Teensy3.0 (or in your case Mega2560) code and look for the following:

Code:
const uint8_t maxChips       = 36; // Maximum number of Chips
const uint8_t maxActions     = 12; // Maximum number of Actions

I would probably set those values to at least half of what they are now.

Then comment out half of the chip and action structures:
Code:
chipStruct chip[maxChips] =
{
  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 }
};



chipActionStruct action[maxActions] =
{
  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
//  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
//  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
//  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
//  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
//  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
//  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 }
};

And maybe ony enable two PIDs for now:
Code:
const uint8_t maxPIDs = 2;
uint8_t pidCnt = 0;

typedef struct
{
  bool       pidEnabled;
  chipStruct *tempPtr;
  double     pidSetPoint;
  chipStruct *switchPtr;
  double     pidKp;
  double     pidKi;
  double     pidKd;
  int        pidDirection;
  uint32_t   pidWindowSize;
  uint32_t   pidwindowStartTime;
  double     pidInput;
  double     pidOutput;
  PID       *myPID;
}chipPIDStruct;

chipPIDStruct ePID[maxPIDs] =
{
  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL },
//  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL },
//  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL },
//  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL },
//  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL },
//  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL },
//  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL },
  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL }
};

Then find the following:

Code:
const uint8_t allDebug      = 0x01; 
const uint8_t pidDebug      = 0x02; 
const uint8_t eepromDebug   = 0x04; 
const uint8_t chipDebug     = 0x08; 
const uint8_t serial1Debug  = 0x10; 
const uint8_t serialDebug   = 0x20; 

uint8_t setDebug = 0x0;

and set setDebug t0 0x08, recompile, upload and run it. When you start the Serial monitor, it should display some info regarding the Chips on the 1-wire mini-lan.

The reason you're reducing the number of chips, actions, and PIDs is that the arrays chew up big gobs of SRAM which you'll probably need to get the debug code running. Stange things happen when you run out of SRAM.
 
OK, I'm assuming that you did everything mentioned here, especially the level converters.

Go into the Teensy3.0 (or in your case Mega2560) code and look for the following:

Code:
const uint8_t maxChips       = 36; // Maximum number of Chips
const uint8_t maxActions     = 12; // Maximum number of Actions

I would probably set those values to at least half of what they are now.

Then comment out half of the chip and action structures:
Code:
chipStruct chip[maxChips] =
{
  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
//  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 },
  { {0,0,0,0,0,0,0,0}, 0, 0 }
};



chipActionStruct action[maxActions] =
{
  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
//  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
//  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
//  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
//  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
//  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
//  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 },
  { FALSE, NULL, -255, NULL, 'F', 0, 0, 255, NULL, 'F', 0, 0 }
};

And maybe ony enable two PIDs for now:
Code:
const uint8_t maxPIDs = 2;
uint8_t pidCnt = 0;

typedef struct
{
  bool       pidEnabled;
  chipStruct *tempPtr;
  double     pidSetPoint;
  chipStruct *switchPtr;
  double     pidKp;
  double     pidKi;
  double     pidKd;
  int        pidDirection;
  uint32_t   pidWindowSize;
  uint32_t   pidwindowStartTime;
  double     pidInput;
  double     pidOutput;
  PID       *myPID;
}chipPIDStruct;

chipPIDStruct ePID[maxPIDs] =
{
  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL },
//  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL },
//  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL },
//  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL },
//  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL },
//  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL },
//  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL },
  { FALSE, NULL, 70, NULL, 0, 0, 0, 0, 5000, 0, 0, 0, NULL }
};

Then find the following:

Code:
const uint8_t allDebug      = 0x01; 
const uint8_t pidDebug      = 0x02; 
const uint8_t eepromDebug   = 0x04; 
const uint8_t chipDebug     = 0x08; 
const uint8_t serial1Debug  = 0x10; 
const uint8_t serialDebug   = 0x20; 

uint8_t setDebug = 0x0;

and set setDebug t0 0x08, recompile, upload and run it. When you start the Serial monitor, it should display some info regarding the Chips on the 1-wire mini-lan.

The reason you're reducing the number of chips, actions, and PIDs is that the arrays chew up big gobs of SRAM which you'll probably need to get the debug code running. Stange things happen when you run out of SRAM.

OK, I did as you suggested, cut down the number of chip, actions, and pids. But now I am getting some compile warnings (on lines where Serial.print(F()); is used. It says: "TeensyPi.ino:278: warning: only initialized variables can be placed into program memory area") But, sketch compiles, and when uploaded it gives the same result as earlier, no serial debug from EEPROM part in setup().

Now, something in that part of code is bothering me.

Code:
  Serial.print(F("Serial Debug running at "));
  Serial.print(baudRate);
  Serial.println(F(" baud"));
this returns: "Serial Debug running at 115200 baud" so this is OK
Code:
  eeResult = EEPROM.read(EEPROMidAddr);
 // Serial.println(eeResult, HEX);
  if((setDebug & eepromDebug) || (setDebug & allDebug))
  { 
    Serial.print(F("eeResult = 0x"));
    Serial.println(eeResult, HEX);
  }
  
  if(eeResult != 0x55)
  {
    if((setDebug & eepromDebug) || (setDebug & allDebug))
    { 
       Serial.println(F("No EEPROM Data"));
    }
  
    eepromReady = FALSE;
    findChips();
    saveStructures();
  }else{

    if((setDebug & eepromDebug) || (setDebug & allDebug))
    { 
      Serial.println(F("Getting EEPROM Data"));
    }

    chipCnt = EEPROM.read(EEPROMccAddr);
    readStructures();
    if((setDebug & eepromDebug) || (setDebug & allDebug))
    { 
      Serial.println(F("EEPROM Data Read Completed"));
    }
  
    eepromReady = TRUE;
    
  }
  
  if((setDebug & eepromDebug) || (setDebug & allDebug))
  { 
    Serial.print( (sizeof(chipStruct) / sizeof(byte) ) * maxChips);
    Serial.println(F(" bytes in chip structure array"));
    Serial.print( (sizeof(chipActionStruct) / sizeof(byte) ) *maxActions);
    Serial.println(F(" bytes in action structure array"));
    Serial.print( (sizeof(chipPIDStruct) / sizeof(byte) ) *maxPIDs);
    Serial.println(F(" bytes in pid structure Array"));
  }
this returns nothing?? If you noticed in the second line I put "Serial.println(eeResult, HEX);" and when uncommented it returns "55" thus "if(eeResult != 0x55)" is not executed.

Also " if((setDebug & eepromDebug) || (setDebug & allDebug))" doesn't get executed as well because setDebug = 0x08, eepromDebug = 0x04, allDebug = 0x01, and combined as in if statement gives 0
Code:
  Serial1.begin(baudRate);
  Serial.print(F("Serial1 Debug running at "));
  Serial.print(baudRate);
  Serial.println(F(" baud"));
this returns: "Serial1 Debug running at 115200 baud" which is also OK

PS
I just changed setDebug to 0x04 not 0x08 as you suggested, and now EEPROM part gives some feedback. Here it is:

Code:
 Serial Debug running at 115200 baud
eeResult = 0x55
Getting EEPROM Data
Entering readStructures
EEPROMchipAddr = 0x40
Read 168 bytes from address Ox40
EEPROMactionAddr = 0xF0
Read 174 bytes from address OxF0
EEPROMpidAddr = 0x1A0
Read 123 bytes from address Ox1A0
readStructures() EEPROM Data Read of 465 bytes Completed
Exiting readStructures
0x7A9: 0x28, 0x5E, 0xC7, 0x47, 0x04, 0x00, 0x00, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0xF7
0x7B9: 0xF3, 0x47, 0x04, 0x00, 0x00, 0xF9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x7C9: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x7D9: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x7E9: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x7F9: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x809: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x819: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x829: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x839: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x849: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x23A: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x24A: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x25A: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x26A: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x27A: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x28A: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x29A: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x2AA: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x2BA: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x2CA: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x2DA: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x2E8: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x2F8: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x308: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x318: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x328: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x338: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x348: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
0x358: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

EEPROM Data Read Completed
168 bytes in chip structure array
174 bytes in action structure array
123 bytes in pid structure Array
Serial1 Debug running at 115200 baud
Does this make sense to you?

Also I wanted to check one other thing, how to connect MEGA2560 and RPi; if I got it right it should be like this:

Code:
MEGA RX1 pin 19 - level shifter ch1 - RPi GPIO14 (TX0)
MEGA TX1 pin 18 - level shifter ch2 - RPi GPIO15 (RX0)
MEGA pin 8 - level shifter ch3 - RPi GPIO17
Am I right about this? If that's the case, unfortunately I have to delay the whole thing for 2 weeks, since I have only one 2ch level shifter :(
 
OK, the chip structure array shows two ds18b20 chip have been detected, so that part of the code appears to work. I'll examine the code this evening.

The extra control pin is serial flow control. With just two chips it may not be a problem, but you need the level shifter for the long run.
 
OK, the chip structure array shows two ds18b20 chip have been detected, so that part of the code appears to work. I'll examine the code this evening.

The extra control pin is serial flow control. With just two chips it may not be a problem, but you need the level shifter for the long run.

Don't I need a level shifter when connecting flow control pin (no matter how many chips (sensors) I have), since MEGA pin8 is 5V, and RPi GPIO17 pin is 3,3V?

BTW I just checked my RPi, and some strange things are going on here. After 22hrs of uptime, I can see web page "sensor/switch status" with the message "Unable to select database" but when I click on lets say "Action status" it only shows "Unable to select database" text, without the logo pic, menu and other stuff, only that text. Also this is my ps output (maybe I'm wrong, but it looks like a lot of graphActions.php processes)

Code:
teensypi@teensypi ~ $ ps axf
  PID TTY      STAT   TIME COMMAND
    2 ?        S      0:00 [kthreadd]
    3 ?        S      0:00  \_ [ksoftirqd/0]
    5 ?        S<     0:00  \_ [kworker/0:0H]
    6 ?        S      0:09  \_ [kworker/u:0]
    7 ?        S<     0:00  \_ [kworker/u:0H]
    8 ?        S<     0:00  \_ [khelper]
    9 ?        S      0:00  \_ [kdevtmpfs]
   10 ?        S<     0:00  \_ [netns]
   12 ?        S      0:00  \_ [bdi-default]
   13 ?        S<     0:00  \_ [kblockd]
   14 ?        S      0:00  \_ [khubd]
   15 ?        S<     0:00  \_ [rpciod]
   16 ?        S      0:00  \_ [khungtaskd]
   17 ?        S      0:06  \_ [kswapd0]
   18 ?        S      0:00  \_ [fsnotify_mark]
   19 ?        S<     0:00  \_ [nfsiod]
   20 ?        S<     0:00  \_ [crypto]
   27 ?        S<     0:00  \_ [kthrotld]
   28 ?        S<     0:00  \_ [VCHIQ-0]
   29 ?        S<     0:00  \_ [VCHIQr-0]
   30 ?        S<     0:00  \_ [VCHIQs-0]
   31 ?        S<     0:00  \_ [iscsi_eh]
   32 ?        S<     0:00  \_ [dwc_otg]
   33 ?        S<     0:00  \_ [DWC Notificatio]
   35 ?        S<     0:00  \_ [deferwq]
   36 ?        S      0:00  \_ [kworker/u:2]
   37 ?        S      8:19  \_ [mmcqd/0]
   38 ?        S      0:01  \_ [jbd2/mmcblk0p2-]
   39 ?        S<     0:00  \_ [ext4-dio-unwrit]
  239 ?        S<     0:00  \_ [bcm2708_spi.0]
  395 ?        S      0:01  \_ [flush-179:0]
 1594 ?        S      0:00  \_ [kworker/0:2]
 2750 ?        S<     0:00  \_ [kworker/0:1H]
29356 ?        S      0:11  \_ [kworker/0:0]
    1 ?        Ss     0:03 init [2]  
  154 ?        Ss     0:00 udevd --daemon
  278 ?        S      0:00  \_ udevd --daemon
  285 ?        S      0:00  \_ udevd --daemon
 1471 ?        S      0:44 /usr/sbin/ifplugd -i eth0 -q -f -u0 -d10 -w -I
 1492 ?        S      0:10 /usr/sbin/ifplugd -i lo -q -f -u0 -d10 -w -I
 1707 ?        Ss     0:00 dhclient -1 -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
 1731 ?        S      0:01 /usr/sbin/syslogd --no-forward
 1802 ?        Ss     0:09 /usr/sbin/apache2 -k start
14112 ?        S      0:01  \_ /usr/sbin/apache2 -k start
14114 ?        S      0:00  \_ /usr/sbin/apache2 -k start
14115 ?        S      0:00  \_ /usr/sbin/apache2 -k start
14116 ?        S      0:00  \_ /usr/sbin/apache2 -k start
 5654 ?        S      0:00  \_ /usr/sbin/apache2 -k start
 5655 ?        S      0:00  \_ /usr/sbin/apache2 -k start
 5706 ?        S      0:01  \_ /usr/sbin/apache2 -k start
 5707 ?        S      0:01  \_ /usr/sbin/apache2 -k start
 5708 ?        S      0:00  \_ /usr/sbin/apache2 -k start
 5713 ?        S      0:01  \_ /usr/sbin/apache2 -k start
 1863 ?        Ss     0:00 /usr/bin/dbus-daemon --system
 1864 ?        Ss     0:01 /usr/sbin/cron
 2635 ?        S      0:00  \_ /USR/SBIN/CRON
 2636 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 2637 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 2663 ?        S      0:00  \_ /USR/SBIN/CRON
 2664 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 2665 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 2720 ?        S      0:00  \_ /USR/SBIN/CRON
 2721 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 2722 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 2775 ?        S      0:00  \_ /USR/SBIN/CRON
 2776 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 2777 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 2826 ?        S      0:00  \_ /USR/SBIN/CRON
 2827 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 2828 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 2881 ?        S      0:00  \_ /USR/SBIN/CRON
 2882 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 2883 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 2940 ?        S      0:00  \_ /USR/SBIN/CRON
 2941 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 2942 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 2994 ?        S      0:00  \_ /USR/SBIN/CRON
 2995 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 2996 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3055 ?        S      0:00  \_ /USR/SBIN/CRON
 3056 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3057 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3108 ?        S      0:00  \_ /USR/SBIN/CRON
 3109 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3110 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3158 ?        S      0:00  \_ /USR/SBIN/CRON
 3159 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3160 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3237 ?        S      0:00  \_ /USR/SBIN/CRON
 3238 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3239 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3291 ?        S      0:00  \_ /USR/SBIN/CRON
 3292 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3293 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3341 ?        S      0:00  \_ /USR/SBIN/CRON
 3342 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3343 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3395 ?        S      0:00  \_ /USR/SBIN/CRON
 3396 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3397 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3445 ?        S      0:00  \_ /USR/SBIN/CRON
 3446 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3447 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3524 ?        S      0:00  \_ /USR/SBIN/CRON
 3525 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3526 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3574 ?        S      0:00  \_ /USR/SBIN/CRON
 3576 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3577 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3634 ?        S      0:00  \_ /USR/SBIN/CRON
 3635 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3636 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3684 ?        S      0:00  \_ /USR/SBIN/CRON
 3685 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3686 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3738 ?        S      0:00  \_ /USR/SBIN/CRON
 3739 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3740 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3813 ?        S      0:00  \_ /USR/SBIN/CRON
 3814 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3815 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3867 ?        S      0:00  \_ /USR/SBIN/CRON
 3868 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3869 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3917 ?        S      0:00  \_ /USR/SBIN/CRON
 3918 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3919 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 3971 ?        S      0:00  \_ /USR/SBIN/CRON
 3972 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 3973 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4021 ?        S      0:00  \_ /USR/SBIN/CRON
 4022 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4024 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4106 ?        S      0:00  \_ /USR/SBIN/CRON
 4107 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4108 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4156 ?        S      0:00  \_ /USR/SBIN/CRON
 4157 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4158 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4210 ?        S      0:00  \_ /USR/SBIN/CRON
 4211 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4212 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4260 ?        S      0:00  \_ /USR/SBIN/CRON
 4261 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4262 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4314 ?        S      0:00  \_ /USR/SBIN/CRON
 4315 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4316 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4390 ?        S      0:00  \_ /USR/SBIN/CRON
 4391 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4392 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4442 ?        S      0:00  \_ /USR/SBIN/CRON
 4444 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4445 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4493 ?        S      0:00  \_ /USR/SBIN/CRON
 4494 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4495 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4543 ?        S      0:00  \_ /USR/SBIN/CRON
 4544 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4545 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4597 ?        S      0:00  \_ /USR/SBIN/CRON
 4598 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4599 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4672 ?        S      0:00  \_ /USR/SBIN/CRON
 4673 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4674 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4722 ?        S      0:00  \_ /USR/SBIN/CRON
 4723 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4724 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4777 ?        S      0:00  \_ /USR/SBIN/CRON
 4778 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4779 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4827 ?        S      0:00  \_ /USR/SBIN/CRON
 4828 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4829 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4880 ?        S      0:00  \_ /USR/SBIN/CRON
 4881 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4882 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 4955 ?        S      0:00  \_ /USR/SBIN/CRON
 4956 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4957 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 5005 ?        S      0:00  \_ /USR/SBIN/CRON
 5006 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 5007 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 5058 ?        S      0:00  \_ /USR/SBIN/CRON
 5059 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 5060 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 5110 ?        S      0:00  \_ /USR/SBIN/CRON
 5111 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 5112 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 5160 ?        S      0:00  \_ /USR/SBIN/CRON
 5161 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 5162 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 5229 ?        S      0:00  \_ /USR/SBIN/CRON
 5230 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 5231 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 5283 ?        S      0:00  \_ /USR/SBIN/CRON
 5284 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 5287 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 5339 ?        S      0:00  \_ /USR/SBIN/CRON
 5340 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 5341 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 5389 ?        S      0:00  \_ /USR/SBIN/CRON
 5390 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 5391 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 5438 ?        S      0:00  \_ /USR/SBIN/CRON
 5439 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 5440 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 5490 ?        S      0:00  \_ /USR/SBIN/CRON
 5491 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 5492 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 5540 ?        S      0:00  \_ /USR/SBIN/CRON
 5541 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 5542 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 5589 ?        S      0:00  \_ /USR/SBIN/CRON
 5590 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 5591 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 5638 ?        S      0:00  \_ /USR/SBIN/CRON
 5639 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 5640 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 5690 ?        S      0:00  \_ /USR/SBIN/CRON
 5691 ?        Ss     0:00  |   \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 5692 ?        S      0:00  |       \_ /usr/bin/php /var/www/htdocs/graphActions.php
 5739 ?        S      0:00  \_ /USR/SBIN/CRON
 5741 ?        Ss     0:00      \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 5742 ?        S      0:00          \_ /usr/bin/php /var/www/htdocs/graphActions.php
 1908 ?        S      0:02 avahi-daemon: running [teensypi.local]
 1909 ?        S      0:00  \_ avahi-daemon: chroot helper
 1968 ?        Ss     0:00 /usr/sbin/sshd
 6001 ?        Ss     0:00  \_ sshd: teensypi [priv]
 6016 ?        S      0:00      \_ sshd: teensypi@pts/1
 6017 pts/1    Ss     0:01          \_ -bash
 6062 pts/1    R+     0:00              \_ ps axf
 2567 ?        S      0:30 /bin/sh /usr/bin/checkForTeensyPi
 6061 ?        S      0:00  \_ sleep 5
 2578 ?        Ss     0:00 startpar -f -- rc.local
 2582 ?        Rs   1297:41 /usr/bin/teensypi_daemon
 5680 tty1     Ss     0:00 /bin/login --         
 5685 tty1     S+     0:01  \_ -bash

I'll try rebooting I see what happens...

yes, after reboot, webpage is not responsive, and as time goes by number of
Code:
 4024 ?        S      0:00  \_ /USR/SBIN/CRON
 4025 ?        Ss     0:00      \_ /bin/sh -c /usr/bin/php /var/www/htdocs/graphActions.php
 4026 ?        S      0:00          \_ /usr/bin/php /var/www/htdocs/graphActions.php
processes is growing.

and....after about 30 minutes, webpage appears, but again with "Unable to select database" error. :confused:
 
Don't I need a level shifter when connecting flow control pin (no matter how many chips (sensors) I have), since MEGA pin8 is 5V, and RPi GPIO17 pin is 3,3V?

I did not mean to imply that it was ok to hook up the flow control pin without a level shifter, only that the flow control might not be needed with only two sensors. Seems that I'm wrong though...

Also this is my ps output (maybe I'm wrong, but it looks like a lot of graphActions.php processes)

The graphActions.php is called once a minute by cron to check if any actions are active, and if so to capture that data and save it for future graphing. Apparently without the flow control, the socket fails and the program sits there waiting for a response, spawning new versions of itself as time goes by, which in turn boogers up the database access.

You could try a voltage divider network for the time being. If you have two 1k resistors, solder them in series, and place the two resistors between pin 8 of the Mega2560 and ground, and then connect the junction of the two resistors to the RPi GPIO-17. That isn't an ideal situation, but it might work if you want to try.
 
I did not mean to imply that it was ok to hook up the flow control pin without a level shifter, only that the flow control might not be needed with only two sensors. Seems that I'm wrong though...



The graphActions.php is called once a minute by cron to check if any actions are active, and if so to capture that data and save it for future graphing. Apparently without the flow control, the socket fails and the program sits there waiting for a response, spawning new versions of itself as time goes by, which in turn boogers up the database access.

You could try a voltage divider network for the time being. If you have two 1k resistors, solder them in series, and place the two resistors between pin 8 of the Mega2560 and ground, and then connect the junction of the two resistors to the RPi GPIO-17. That isn't an ideal situation, but it might work if you want to try.

So, we're on the same page about this, I also was thinking about a voltage divider for the flow control pin. I'm going to try this and post back.

The thing that bugs me is that the webpage shows up 30 mins or so after rebooting RPi, not before.
 
I just got back my latest board from Seeed Studios, a Combo Switchboard that contains everything needed to get an Action started on the TeensyPi. Here's a photo:
Combo-Switchboard.png


With this board you can connect one or more DS18B20 Tenp Sensor Probes available from ebay, Brewers Hardware and other vendors, and two DS2406 switches, and hook it right up to the TeensyPi.

The outputs to the SSR can sink about 20ma. If you need more juice, use the LED outputs, replacing the LEDs with wires to your device. The transistors can sink about 50 ma @ 5VDC safely.

I've posted the Eagle and Gerber files in a single Switchboard.zip file on my github site.
 
Any thoughts on how difficult it would be to add a higher temp sensor for smoker control? Doesn't appear 1 wire is feasible over 240deg or so

I'm playing with an Adafruit Thermocouple Amplifier MAX31855 breakout board right now, and there seems to be some stability issues right now, but I've just started playing with it.

The Adafruit Thermocouple Amplifier MAX31855 breakout board uses SPI to communicate, so it won't work over the 1-wire lan :( , so there would be additional cabling involved.
 
I'm playing with an Adafruit Thermocouple Amplifier MAX31855 breakout board right now, and there seems to be some stability issues right now, but I've just started playing with it.

The Adafruit Thermocouple Amplifier MAX31855 breakout board uses SPI to communicate, so it won't work over the 1-wire lan :( , so there would be additional cabling involved.

OK, got a question for the gang:

If you had a need for one or more type K thermocouples in the TeensyPi in order to run a wider range of temperatures, what's the maximum number of thermocouples, DS18B20s and DS2406's you think you'd use?

The reason I'm asking, is there's a delicate balance between getting a timely reading from the thermocouple, reading the DS18B20s, controlling the DS2406 Switches, and keeping the serial interface from over-running the buffer. I'm doing this as a worst-case scenario, but I'm interested in what you all think is important.

Feel free to chime in. :tank:
 
OK, got a question for the gang:

If you had a need for one or more type K thermocouples in the TeensyPi in order to run a wider range of temperatures, what's the maximum number of thermocouples, DS18B20s and DS2406's you think you'd use?

The reason I'm asking, is there's a delicate balance between getting a timely reading from the thermocouple, reading the DS18B20s, controlling the DS2406 Switches, and keeping the serial interface from over-running the buffer. I'm doing this as a worst-case scenario, but I'm interested in what you all think is important.

Feel free to chime in. :tank:

I'm using MAX6675 with K-type thermocouple, and I'm satisfied with it, and for my application I need only 1. I just have to say that I'm not brewing beer :( (but might consider it in the future), I am trying to make a central heating control, so all the temperatures are in the range of DS18B20 except the smoke temp, which is usually around 200 deg C.
 
I'm using MAX6675 with K-type thermocouple, and I'm satisfied with it, and for my application I need only 1. I just have to say that I'm not brewing beer :( (but might consider it in the future), I am trying to make a central heating control, so all the temperatures are in the range of DS18B20 except the smoke temp, which is usually around 200 deg C.

I didn't look at the library for that chip, but I'm sure that the setup would be similar.
 
jimmayhugh said:
OK, got a question for the gang:

If you had a need for one or more type K thermocouples in the TeensyPi in order to run a wider range of temperatures, what's the maximum number of thermocouples, DS18B20s and DS2406's you think you'd use?

The reason I'm asking, is there's a delicate balance between getting a timely reading from the thermocouple, reading the DS18B20s, controlling the DS2406 Switches, and keeping the serial interface from over-running the buffer. I'm doing this as a worst-case scenario, but I'm interested in what you all think is important.

Feel free to chime in. :tank:

I would use two; one to measure the temp of the meat and one to measure temp in the kettle. I may use an additional to measure ambient temp but would use DS18B20 for that. I'd like to use the DS18B20 for the meat too but I think the probe diameter would be too large.

In that scenario, I wouldnt need the probes to be all that speedy or precise.
 
Back
Top