i am going to use esp8266 as transmitter and smartphone as a receiver. Signal received from smartphone will be displayed on arduino serial.
my final result is to display rssi in arduino serial and plot a graph of rssi vs distance from smartphone and eps8266.
However, i have no idea about the code i need to use. wish somebody can help me
To measure RSSI on the ESP:
To measure the RSSI on the smartphone, just use the softAP:
https://tttapa.github.io/ESP8266/Chap07 - Wi-Fi Connections.html
Other factors like direction of the antennas, reflections and interference will have much more impact on the RSSI than distance.
Search for CNLohr's videos on the topic, he mounted an ESP8266 in a CNC machine to visualize the 3D RSSI map.
Pieter
Thanks for reply. i used the code. i insert my network name and password, but there is problem in compiling.
i am wondering what is the error or any mistake i made in connection of arduino with esp8266. wish you can give me advice or guideline.
That's not a compilation error, it's an error during upload, probably because you didn't put the ESP in programming mode (Pulling down GPIO0 while resetting):
https://tttapa.github.io/ESP8266/Chap06 - Uploading.html
Make sure that your hardware is correct first:
https://tttapa.github.io/ESP8266/Chap02 - Hardware.html
Check this out:
High Res Wifi Signal Mapping - YouTube
Pieter
EP8266 in which flavour?
Barebones ESP-12 module, the WiFi-for-Arduino ESP-01 module, development board (NodeMCU, WeMOS, ...) or other?
Also no screen shots please. Hard to read, can't copy/paste anything - just copy/paste errors or code and post it in between code [/] tags.
I am using esp8266 module 01 with arduino uno only.
esp8266 arduino
Vcc 3.3V
GND GND
RX RX
TX TX
EN 3.3V
I really have to clarify my wiring is correct or not since i saw difference source have different wiring.
This is the code i used with warning of espcomm_sync failed
and error of espcomm_open failed
espcomm_upload failed
#include <SPI.h>
#include <WiFi.h>
//SSID of your network
char ssid[] = "yourNetwork";
//password of your WPA Network
char pass[] = "secretPassword";
void setup()
{
WiFi.begin(ssid, pass);
if (WiFi.status() != WL_CONNECTED) {
Serial.println("Couldn't get a wifi connection");
while (true);
}
// if you are connected, print out info about the connection:
else {
// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print("RSSI:");
Serial.println(rssi);
}
}
void loop () {}
You need level translators between the Arduino RX/TX and the ESP RX/TX.
TX connects to RX and the other way around (which is logical: sending for one module is receiving for the other).
Plus indeed the need for level shifters on those lines; the ESP8266 is not rated for 5V signals.
Your response clearly shows that you haven't actually read the instructions I linked to. Please read them first, and follow them very carefully.
The code you posted is for the Arduino WiFi shield, not for an ESP8266.
wvmarle:
TX connects to RX and the other way around (which is logical: sending for one module is receiving for the other).
The RX and TX connections he used are correct for programming the ESP. You just need to add a 2.2kΩ resistor between RX and ground.
Pieter
Never expected programming to work different than normal communication between the devices... that's very confusing.
My USB/TTL converter I do have to connect RX to TX and TX to RX.
PieterP:
The RX and TX connections he used are correct for programming the ESP. You just need to add a 2.2kΩ resistor between RX and ground.Pieter
That is a level shifter. Not the greatest one, but it is a level shifter.
wvmarle:
Never expected programming to work different than normal communication between the devices... that's very confusing.
My USB/TTL converter I do have to connect RX to TX and TX to RX.
The Arduino's RX pin is the ATmega328P's RX pin, it's connected to the ATmega16U2*'s TX pin, that's why.
(*) the on-board USB-to-Serial adapter
aarg:
That is a level shifter. Not the greatest one, but it is a level shifter.
It works because the Arduino has a 1kΩ resistor in series with the ATmega16U2's TX pin.
Pieter
PieterP:
Your response clearly shows that you haven't actually read the instructions I linked to. Please read them first, and follow them very carefully.
The code you posted is for the Arduino WiFi shield, not for an ESP8266.
The RX and TX connections he used are correct for programming the ESP. You just need to add a 2.2kΩ resistor between RX and ground.Pieter
Thanks for your help. However, what I saw in the instructions is connection of esp8266 with USB serial converter. What I need to use is only esp8266 and arduino Uno. Sorry, I don't have USB serial converter.
As mentioned in my previous post, the Arduino Uno has an on-board USB-To-Serial adapter that you can use.
Connect TX to TX of the Arduino, RX to RX, add a 2k resistor between RX and ground, follow the schematic in my second reply, and then follow the instructions in the link provided there:
https://tttapa.github.io/ESP8266/Chap06 - Uploading.html
If you don't have a USB-to-Serial converter with DTR and RTS lines, you could also just use the reset and program buttons we added in the hardware chapter. To get the ESP in program mode, GPIO0 must be low while booting:
- press and hold the reset button
- press and hold the program button
- release the reset button, the ESP will boot in program mode
- release the program button
- upload the sketch.
Using the on-board 3.3V regulator of the Uno is not recommended.
Pieter
okay.i wll buy a 3.3V regulator and battery.
from the link, it mentioned
Enable the chip by connecting the CH_PD (Chip Power Down, sometimes labeled CH_EN or chip enable) pin to VCC through a 10KΩ resistor.
Disable SD-card boot by connecting GPIO15 to ground through a 10KΩ resistor.
Select normal boot mode by connecting GPIO0 to VCC through a 10KΩ resistor.
Prevent random resets by connecting the RST (reset) pin to VCC through a 10KΩ resistor.
Make sure you don't have anything connected to GPIO2 (more information in the next chapter).
the instruction is clear but in my esp8266 dont have GPIO15 but have GPIO2. so should i connect GPIO2 to ground of UNO through a 10KΩ resistor.
THANK YOU
bying
Bying:
Make sure you don't have anything connected to GPIO2
Ok.. I just connect to GPIO1 and ignore the GPIO15 since it don't have it?
It's connected on the breakout board already.
Hi. As I proceed my project, i plan to make my esp8266 as transceiver. Means I need to let smartphone connected to esp access point to create WiFi link or wlan.
However, my lecturer said I need to buy another arduino and esp8266 to act as receiver.then only my project is workable.
Any reference i can refer?
Thank you
Bying
Considering the high information density of your question and great insight you have given in what you're trying to do, I think I can best refer you to the highest density and most complete reference source out there, hoping that you do know what you're trying to accomplish.

