So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Marmachine
#62042 Hi Folks,

I just found myself crying out loud in this newbie corner, cos that is what i am.
Got my ESP8266 (on a base module) connected to my Arduino UNO and i have managed to get a response in the terminal window.

So far i've been trying to upload several sketches to do some trial and error, even ended up in a very creative way to upload to the ESP module (https://www.youtube.com/watch?v=P_ecAFpUADU), but really i don't really know what i am doing and with Google i don't really find my way this time.

But anyway, here's what i have, got connected to my router and i can PING to my ESP8266, so it's there.
Next thing i want to do is send over some values using a sketch on my UNO.
The "values" are data from different sensors connected to my UNO as well, i want to send them to Domoticz (my home domotica system).

To set temperature, for example, i can directly set device parameters via JSON by calling the next url:
http://192.168.1.xxx:xxxx/json.htm?type ... value=TEMP

I'd like to do the same thing for Barometric Pressure, Lux and Humidity.

My Question(s):
Maybe someone knows a good tutorial or something to that might help me in the right direction?
Below some device info, it's current wifi mode:1 seems to be connected, however when i restart i see "jump to run user2 @ 81000" and some strange stuff... but still connected though.

AT+GMR current firmware
Code: Select allAT version:1.2.0.0(Jul  1 2016 20:04:45)
SDK version:1.5.4.1(39cb9a32)
Ai-Thinker Technology Co. Ltd.
Dec  2 2016 14:21:26


Code: Select all ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 1856, room 16
tail 0
chksum 0x63
load 0x3ffe8000, len 776, room 8
tail 0
chksum 0x02
load 0x3ffe8310, len 552, room 8
tail 0
chksum 0x79
csum 0x79

2nd boot version : 1.5
  SPI Speed      : 40MHz
  SPI Mode       : DIO
  SPI Flash Size & Map: 8Mbit(512KB+512KB)
jump to run user2 @ 81000

Œã ä ƒnì“{ƒûo|ä Œ �|;l„ã{“dÄl Œ  ìd` Äã;›$ìd Œ 
 $` ŒãsÛl �ž
Ai-Thinker Technology Co. Ltd.

ready
WIFI CONNECTED
WIFI GOT IP
User avatar
By jeffas
#62069 You say that you've been uploading sketches to the ESP, but you also show us what version of AT firmware you are running. Are you wanting to use AT commands from the arduino, or run your own sketch on the ESP? You can't do both, because when you upload a sketch to the ESP, it replaces the AT firmware.
User avatar
By Marmachine
#62075 Here's what i got so far, running on the Arduino:

Code: Select all#include <SoftwareSerial.h>

const byte rxPin = 2; // Wire this to Tx Pin of ESP8266
const byte txPin = 3; // Wire this to Rx Pin of ESP8266

// We'll use a software serial interface to connect to ESP8266
SoftwareSerial ESP8266 (rxPin, txPin);

void setup() {
  delay(1000); // Let the module self-initialize
 
  Serial.begin(115200);
  ESP8266.begin(115200); // Change this to the baudrate used by ESP8266
 
  Serial.println("Sending AT command...");
  // actual sending AT command
  ESP8266.println("AT");

  // display output
  while (ESP8266.available()){
     String inData = ESP8266.readStringUntil('\n');
     Serial.println("Got reponse from ESP8266: " + inData);
  }

  delay(10000); // Let the module self-initialize
 
  Serial.println("Sending AT+CIFSR=? command...");
  // actual sending AT+CIFSR=? command
  ESP8266.println("AT+CIFSR=?");

  // display output
  while (ESP8266.available()){
     String inData = ESP8266.readStringUntil('\n');
     Serial.println("Got reponse from ESP8266: " + inData);
  }

  delay(10000); // Let the module self-initialize
 
  Serial.println("Sending AT+GMR command...");
  // actual sending AT+GMR command
  ESP8266.println("AT+GMR");

  // display output
  while (ESP8266.available()){
     String inData = ESP8266.readStringUntil('\n');
     Serial.println("Got reponse from ESP8266: " + inData);
  }

  delay(10000); // Let the module self-initialize

  Serial.println("Sending AT+UART_DEF? command...");
  // actual sending AT+UART_DEF? command
  ESP8266.println("AT+UART_DEF?");

  // display output
  while (ESP8266.available()){
     String inData = ESP8266.readStringUntil('\n');
     Serial.println("Got reponse from ESP8266: " + inData);
  }
 
  delay(10000); // Let the module self-initialize
}

void loop() {

  //... here i want to send various data to Domoticz
  //... example http://192.168.1.xxx:xxxx/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=TEMP

}


Below is the response in serial monitor:

Sending AT command...
Sending AT+CIFSR=? command...
Got reponse from ESP8266: AZCH¬HèjªHüAZ¥¨RÔ*©új
Got reponse from ESP8266: OK
Sending AT+GMR command...
Sending AT+UART_DEF? command...
Got reponse from ESP8266: AJ+GS•¨H4Q {Y.®ZËKŠr’r‚rƒBRÕ±�Š’‚Š²’‚Ò‚¢Ò¢ªJj
Got reponse from ESP8266: SDK versioo:1.AZ¥UXRE



I'm not sure what is on the ESP8266 right now, can i check and delete what ever might be on there by using an AT command or can only be done by uploading BareMinimum for example?
I'm waiting for an FT232RL FTDI USB To TTL Serial Converter Adapter Module to arrive, hope that will make life easier to connect my ESP8266 directly instead of the setup like in the video.
User avatar
By Marmachine
#62076
jeffas wrote:You say that you've been uploading sketches to the ESP, but you also show us what version of AT firmware you are running. Are you wanting to use AT commands from the arduino, or run your own sketch on the ESP? You can't do both, because when you upload a sketch to the ESP, it replaces the AT firmware.


    So when there is a sketch on the ESP8266, it won't respond to AT commands anymore?
    Could that be reversed or cleared? How?
    I want to use AT commands from a sketch on the Arduino since i have several sensors connected to it and i want to send that data.