Hi there, new to arduinos.
I have a project whereby 6x MAX6675 collect temperature data that's "bused" back to the Arduino Uno. Then, those 6x data points should be sent from the Arduino Uno to the feather Huzzah (ESP8266) using serial communication (Software Serial). The feather Huzzah sends that data over wifi to Adafruit io. Then, I want the feather to send back a message equivalent to "successfully sent to storage". Therefore, a message has to be sent, and a message has to be received back. Meanwhile, there is an LCD display that gives updates. To get help on this portion, I am breaking down the problem to just figuring out the arduino<-->huzzah serial communication.
I get no response back from the feather Huzzah when running my code and circuit.
connections:
(Arduino <--> to Huzzah)
pin 2 (denoted as Rx via Software Serial) <--> Tx (huzzah)
pin 3 (denoted as Tx via Software Serial) <--> 2x resistors to get ~3.3V <--> Rx (huzzah)
GND <--> GND <--> GND (huzzah)
Huzzah is power sourced from micro-USB plugged into wall outlet. hopefully, powering the huzzah (ESP8266) with the USB does not render the TX/RX pins unavailable. If so, then Software Serial needs to be used for the Huzzah as well.
I added serial print statements to help debug, and again it appears I'm not getting something back from the Huzzah.
Arduino Code
//LCD Display
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 10, 11, 12, 13);
//Serial communications with Huzzah (ESP8266)
#include <SoftwareSerial.h>
SoftwareSerial espSerial(2, 3); //RX, TX
String msg;
String response;
void setup(){
//start serial communication with computer
Serial.begin(9600);
//start serial communications with Huzzah (ESP8266)
espSerial.begin(9600);
//start up LCD
//set up the LCD's number of columns and rows:
lcd.begin(16, 2);
//print a message to the LCD.
lcd.clear();
lcd.print("startup comms...");
delay(2000);
lcd.clear();
}
void loop(){
//collect data
lcd.print("collecting..");
lcd.setCursor(0,1);
float h = 100;
float t = 23;
//send data to serial monitor
Serial.print("H: ");
Serial.print(h);
Serial.print(", ");
Serial.print("T: ");
Serial.print(t);
Serial.println(" C");
//send data to huzzah via software serial
msg = String("from arduino: ")+String("H= ")+String(h)+String("T= ")+String(t);
espSerial.println(msg);
Serial.println("data sent from arduino to huzzah");
//wait for huzzah to process information send something back
Serial.println("wait");
delay(30);
//print out response from Huzzah
if (espSerial.available() > 0) {
response = espSerial.readString();
Serial.print("I received from huzzah: ");
Serial.println(response);
// update LCD
lcd.setCursor(0,1);
lcd.print("sent to cloud!");
}
else {
Serial.println("no response from huz");
lcd.print("no response");
}
delay(1000);
lcd.clear();
}
Huzzah (ESP8266) Code
void setup() {
Serial.begin(9600);
}
void loop() {
String content = "";
char character;
while (Serial.available()) {
character = Serial.read();
content.concat(character);
}
if (content != "") {
Serial.write("g");
delay(30);
}
}
Serial Output:
"H: 100.00, T: 23.00 C
data sent from arduino to huzzah
wait
no response from huz
H: 100.00, T: 23.00 C
data sent from arduino to huzzah
wait
no response from huz
...
It appears my Huzzah is not doing much. Thank you, and I apologize because this topic probably comes up often with noobs.



