Hello!
New to this and really not happy about having to bother you all but I have been stuck searching and searching for two weeks now and while I have learned a ton I am really stuck on what I think is Serial issues. What I am trying to do "Seems" simple to me but I need to ask the pro's I guess.
I am trying to read an Analog sensor reading on Pin(0) of the Uno and send that reading that I converted from 0v-5v to a number value of 0-1023 over to the Huzzah ESP8266 via Serial connections from the Uno to the Huzzah. Then I want to send that information from the Huzzah set up as an AP to an iPhone app. First question has to be, Can I do this with the pieces I have?
If so then where I am stuck is getting the reading over to the Huzzah ESP via Serial Tx/Rx. I DO have the Uno reading the Analog sensor on Port 0 and reporting that to the Serial Monitor perfectly. I also have the Huzzah set up as an AP and that is also working perfectly. Now if I could just get my sensor reading over to the Huzzah and be able to read that from the Huzzah on the Serial Monitor, that would just leave how to get it to the iPhone.
I will be extremely happy to post any and all data that you need, just wanted to keep this post short and first see if I'm crazy that I should be able to do this first.
Thank You!
Yep, this make sense, one thing though, esp8266 has 3v3 logic right? And Uno has 5v logic, how is the conection doing?
Thanks for your input!! The Huzzah has a built in level shifter on the RX pin so it can take 5v. Cool huh? The standard ESP8266's out there don't do that.
kwburhans:
Thanks for your input!! The Huzzah has a built in level shifter on the RX pin so it can take 5v. Cool huh? The standard ESP8266's out there don't do that.
Level shifter? Yeah! It's impressive!
(Specifically, it is in fact a 1N4148! But that solves one problem for me. )
Good, now you should share your connections and your code in order to help.
kwburhans:
I am trying to read an Analog sensor reading on Pin(0) of the Uno and send that reading that I converted from 0v-5v to a number value of 0-1023 over to the Huzzah ESP8266 via Serial connections from the Uno to the Huzzah. Then I want to send that information from the Huzzah set up as an AP to an iPhone app. First question has to be, Can I do this with the pieces I have?
Actually, the first question is - why not simply use the analog input on the Huzzah?
Okay so here's the update. You're right Paul_B I have in fact gotten rid of the Uno and am just using the Huzzah's analog input and that works great.
So now I am reading the sensor data on the analog input via the serial monitor in IDE, AND I have set up the Huzzah as an AP. I can connect to the Huzzah with my iPhone by going to iPhone/Settings/Wi-Fi and selecting my Huzzah's SSID. I can then go to Safari on the iPhone and put in the Huzza's IP in the browser and receive a response from the Huzzah that I am in fact connected to it. This is much more streamed lined, smaller and less expensive.
I will post my code below.
Now, what I am trying to do is send that sensor data over to an iPhone app. I found this thread :
http://forum.arduino.cc/index.php?topic=102852.0
and was VERY excited to find it but it is so old that a lot of the links are broken and the hardware has all changed so much since it was posted that it's not making sense to me.
I have tried using Deveolpement sits like Appcelerator, EVO Things and Blynk but all seem to either not get me where I need to go. I do really like Appcelerator even though I have never written an iPhone app.
Here's my code for the Huzzah. I'm not even sure where to go next. I really appreciate the help as I am new to this whole thing and I feel like I'm close? I hope?
Code:
/* Create a WiFi access point and provide a web server on it. */
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
/* Set these to your desired credentials. */
const char *ssid = "iGauge WiFi";
const char *password = "none";
ESP8266WebServer server(80);
/* Just a little test message. Go to http://192.168.4.1 in a web browser
- connected to this access point to see it.
*/
void handleRoot() {
server.send(200, "text/html", "You are connected to iGauge
");
}
void setup() {
delay(1000);
Serial.begin(115200);
Serial.println();
Serial.print("Configuring access point...");
/* You can remove the password parameter if you want the AP to be open. */
WiFi.softAP(ssid);
IPAddress myIP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(myIP);
server.on("/", handleRoot);
server.begin();
Serial.println("HTTP server started");
}
void loop() {
server.handleClient();
//end WiFi code
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// print out the value you read:
Serial.println(sensorValue);
delay(4000); // delay in between reads for stability
}