Finally pushed the minor php edits to you on GitHub. STILL waiting on my EEPROM and 1-Wire device orders!
Thanks, just merged them.
Finally pushed the minor php edits to you on GitHub. STILL waiting on my EEPROM and 1-Wire device orders!
Jimmay-
In an earlier post I stated that I had gtent the RPI, WIZ820io, the teensy 3.1, the teensynet v5.2 board, and the TL-WR70N, combo action board, and the RGB LCDs and boards. I need to get this on my rig and start rockin'. I can't get these boards to work together as l do not know how they connect to each other. Can I get some guidance on how to wire them? I am able to get the web page up, but no chips show up, and the LCD does not work. On another note, I had to use Openwrt on the 703n using relayd and there is enough room for LuCi. DD-WRT was not used. It is much easier to use the tp-link software instead, for those who might want to take that route.
OK, here goes...
I have included a pic of the current setup, and a schematic. I was able to compile only using linux (Debian 7- SolydK to be exact), not with Win 7. Teensynet.ino is compiled on a teensy 3.1. I am using the 16 G image you have provided on a 16 G Class 10 Sandisk Ultra card on the RPI.
I am able to get to the TeensyNet web page only using the image on the card with the RPI but no TeensyNet chips detected; I only get the Debian web page that says that Apache is working when I put the LAMP server "the hard way" on my laptop - no teensyNet web page at the same address that is the RPI.
I checked if the sensor was being found by the following linux commands after ssh'ing into the RPI:
teensynet@teensynet ~$ sudo modprobe w1-gpio
teensynet@teensynet ~$ sudo modprobe w1-therm
teensynet@teensynet ~$ cd /sys/bus/w1/devices/
ls - no sensor serial number, hence no chips found on the teensynet page.
I happened to touch the bottom of the action combo board, touching both contacts of the ds2406 and a LED, and it would llight up, otherwise I did not know if power actually got to the board, which it does. Lastly, there are 80 black squares on my LCD, which I assume that the LCD is working, but is not programmed. So close, yet so far. I hope the pics and description are sufficient.
// --------------------------------------
// i2c_scanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26 2013
// V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
// by Arduino.cc user Krodal.
// Changes by louarnold removed.
// Scanning addresses changed from 0...127 to 1...119,
// according to the i2c scanner by Nick Gammon
// http://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
// As version 4, but address scans now to 127.
// A sensor seems to use address 120.
//
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//
#include <FastWire.h>
uint32_t cnt;
void setup()
{
Wire.begin();
#if __MK20DX256__
Wire1.begin();
#endif
Serial.begin(115200);
Serial.println("\nI2C Scanner");
cnt = 0;
}
void loop()
{
byte error, error1, address;
int nDevices, n1Devices;
Serial.print(F("Count #"));
Serial.print(cnt);
Serial.println(F(" - Scanning..."));
nDevices = 0;
n1Devices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmission to see if
// a device did acknowledge to the address.
//Do Wire Devices
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at Wire address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknown error on Wire at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
// Do Wire1 Devices
#if __MK20DX256__
Wire1.beginTransmission(address);
error1 = Wire1.endTransmission();
if (error1 == 0)
{
Serial.print("I2C device found at Wire1 address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
n1Devices++;
}
else if (error1==4)
{
Serial.print("Unknown error on Wire1 at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
#endif
}
if (nDevices == 0)
{
Serial.println("No Wire I2C devices found\n");
}
#if __MK20DX256__
if(n1Devices == 0)
{
Serial.println("No Wire1 I2C devices found\n");
}
#endif
Serial.println("done\n");
cnt++;
delay(1000); // wait 1 second for next scan
}
I see the teensynet.ino code in the IDE, but I do not know how to change the values you have asked. As for the code for the I2C scanner, I should copy/paste, name the sketch something like I2C.ino and compile, right? I am not familiar with the code language. Please bear with me.
Jim, glad to see you posting here. I haven't given up on the project, though I'll likely back down from my previous effort to modular-ize the sketch code - my time got very scarce shortly after I created the git fork. I do think there's a lot of value in at least splitting the thermocouple lookup tables and associated functions into their own library.
I plan on making a combined smoker and sous vide controller out of a fairly robust TeensyNet, and I'd love to create some graphical front ends using HTML 5 canvas elements. That seems like much better use of my time than nitpicking your software design choices. I hope to have some time to dedicate to the project again next month.
const uint32_t resetDebug = 0x00000001; // 1
const uint32_t pidDebug = 0x00000002; // 2
const uint32_t eepromDebug = 0x00000004; // 4
const uint32_t chipDebug = 0x00000008; // 8
const uint32_t findChipDebug = 0x00000010; // 16
const uint32_t serialDebug = 0x00000020; // 32
const uint32_t udpDebug = 0x00000040; // 64
const uint32_t wifiDebug = 0x00000080; // 128
const uint32_t udpHexBuff = 0x00000100; // 256
const uint32_t chipNameDebug = 0x00000200; // 512
const uint32_t actionDebug = 0x00000400; // 1024
const uint32_t lcdDebug = 0x00000800; // 2048
const uint32_t crcDebug = 0x00001000; // 4096
const uint32_t ds2762Debug = 0x00002000; // 8192
const uint32_t bonjourDebug = 0x00004000; // 16384
const uint32_t sdDebug = 0x00010000; // 32768
// uncomment/comment any line to select/remove debug for that feature - yuri
const uint32_t debugAll =
//resetDebug |
//pidDebug |
//eepromDebug |
chipDebug |
findChipDebug |
//serialDebug |
//udpDebug |
//wifiDebug |
//udpHexBuff |
//chipNameDebug |
//actionDebug |
//lcdDebug | // problematic with no lcd connected
//crcDebug |
//ds2762Debug |
//bonjourDebug |
//sdDebug |
0x00000000; // filler to allow commenting of the line above
const uint32_t debugNone = 0x00000000;
uint32_t setDebug = debugAll;
// uint32_t setDebug = debugNone;
Thanks to both Jim and Yuri for taking time out for explanations... The last time I did programming was in fortran 77, with stacks of punch cards! Using either method of modding the teensynet.ino file, there is no output to the serial monitor for any chips, either the switches or sensors. I used a similar I2C scanner that used Wire.h rather than Fastwire.h as I tried to import the Fastwire library after the error that Fastwire.h was not found but the compile failed. Anyway, I did get output of the scanning of addresses in the teensy serial monitor, but no I2C addresses were found.
void setup(void)
{
Serial.begin(115200);
pinMode(2, OUTPUT);
pinMode(9, OUTPUT);
pinMode(13, OUTPUT);
pinMode(18, OUTPUT);
pinMode(19, OUTPUT);
pinMode(29, OUTPUT);
pinMode(30, OUTPUT);
}
void loop(void)
{
digitalWrite(2, LOW);
digitalWrite(9, LOW);
digitalWrite(13, LOW);
digitalWrite(18, LOW);
digitalWrite(19, LOW);
digitalWrite(29, LOW);
digitalWrite(30, LOW);
delay(1000);
digitalWrite(2, HIGH);
digitalWrite(9, HIGH);
digitalWrite(13, HIGH);
digitalWrite(18, HIGH);
digitalWrite(19, HIGH);
digitalWrite(29, HIGH);
digitalWrite(30, HIGH);
delay(1000);
}
#include <OneWire.h>
// OneWire DS18S20, DS18B20, DS1822 Temperature Example
//
// http://www.pjrc.com/teensy/td_libs_OneWire.html
//
// The DallasTemperature library can do all this work for you!
// http://milesburton.com/Dallas_Temperature_Control_Library
OneWire ds(2); // on pin 10 (a 4.7K resistor is necessary)
const uint8_t ds18S20ID = 0x10; // Maxim DS18S20 digital Thermometer device
const uint8_t ds2406ID = 0x12; // Maxim DS2406+ digital switch
const uint8_t ds1822ID = 0x22; // Maxim DS1822 digital Thermometer device
const uint8_t ds18b20ID = 0x28; // Maxim DS18B20 digital Thermometer device
const uint8_t ds2762ID = 0x30; // Maxim 2762 digital k-type thermocouple
const uint8_t max31850ID = 0x3B; // MAX31850 K-type Thermocouple chip
const uint8_t max31855ID = 0xAA; // Teensy 3.0 1-wire slave with MAX31855 K-type Thermocouple chip
void setup(void) {
Serial.begin(11500);
}
uint8_t x = 0;
const uint8_t chips = 16;
uint8_t addr[chips][8] =
{
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0}
};
void loop(void)
{
byte i;
byte present = 0;
byte data[12];
float celsius, fahrenheit;
if ( !ds.search(&addr[x][0]))
{
Serial.println("No more addresses.");
Serial.println();
ds.reset_search();
delay(250);
x = 0;
return;
}
Serial.print(F("ROM "));
Serial.print(x);
Serial.print(F(" = "));
for( i = 0; i < 8; i++) {
Serial.print(F("0x"));
if(addr[x][i] < 0x10) Serial.print(F("0"));
Serial.print(addr[x][i], HEX);
Serial.print(F(" "));
}
if (OneWire::crc8(addr[x], 7) != addr[x][7]) {
Serial.print(" !!CRC is not valid!!");
return;
}
// the first ROM byte indicates which chip
switch (addr[x][0]) {
case ds18S20ID:
Serial.println(" DS18S20 Thermoneter");
break;
case ds2406ID:
Serial.println(" DS2406+ Digital Switch");
break;
case ds1822ID:
Serial.println(" DS1822 Thermoneter");
break;
case ds18b20ID:
Serial.println(" DS18B20 Thermoneter");
break;
case ds2762ID:
Serial.println(" DS2762 Thermocouple");
break;
case max31850ID:
Serial.println(" MAX31850 Thermocouple");
break;
case max31855ID:
Serial.println(" MAX31855 Thermocouple");
break;
default:
Serial.println(" Unknown family device.");
return;
}
x++;
delay(100);
}
OK, Thanks, this is very helpful. The SDA and SDL lines alternate from 0v to +5v after loading the first program. The data line pegs the multimeter. Soldering has no bridging. Can I troubleshoot which bs170's related to the data line that might be defective? I tried to take an unpopulated board and follow the tracings.
I checked with the first script. Every line is pegging the multimeter. I removed the jumper, it is now alternating from 0 to +5v on all lines and boards.
I did a dumb novice thing (which l am a novice). The tantium capacitors were not all the same polarity in the board. One is soldered one way, the other is the opposite. I don't know what that does to the circuits, but the markings are so small, I now know I need a magnifying glass to figure out which leg is the positive one. I assume that is the cause of your head scratching.