MatChev04:
Du 3.3Kohm sa passe?(j'ai pas de 2.2Kohm)
Oui ça ira. Quand vous faites ce montage, la formule suivante s'applique:
donc si R1 est identique à R2 et Vin vaut 5V vous aurez Vout = 5 x R/ 2R = 5 x 1/2 = 2.5V
Sur l'ESP 2.5V sont reconnus comme un HIGH donc un HIGH à 5V se transforme bien en un HIGH pour un processeur à 3.3V de l'autre côté
Bien sûr si Vin vaut 0V vous aurez Vout = 0 x R/ 2R = 0 V, donc un LOW reste bien un LOW
Il s'agit peut être du moment ou l'ESP01 tente de se connecter à la box (les pics de courant les plus intenses sont là !! )
Dans ce cas pour aider l'alimentation 3,3V à répondre , dans tous les cas , à la demande temporaire ajouter un condensateur de 10µF (ou plus) en parallèle sur le 3,3V (condensateur 'réservoir')
qu'est ce qui s'affiche exactement ?
RST est-il toujours en l'air ?
Comment est alimentée l'alimentation 3V3 ?
,
reste un doute : que donne SoftSerial à 115200 bauds ?
appart le fet que sa ecris n'importe quoi, sa fonctionne.
mon alim est alimenter par un alimentions 12V, 0.35A.
Et non plus rien est en l'air seulement les réponse sont...
J'ai un peu alléger le code parce que ESP se conect directement.
#include <SoftwareSerial.h>
SoftwareSerial ESP8266(10, 11);
/*
* Server Ip = 192.168.1.31
* Client IP = 192.168.4.1
*
*/
/****************************************************************/
/* INIT */
/****************************************************************/
void setup()
{
Serial.begin(9600);
ESP8266.begin(115200);
initESP8266();
}
/****************************************************************/
/* BOUCLE INFINIE */
/****************************************************************/
void loop()
{
while(ESP8266.available())
{
Serial.println(ESP8266.readString());
if(ESP8266.find("+IPD,")){
delay(1000);
int connectionId = ESP8266.read()-48; // subtract 48 because the read() function returns
// the ASCII decimal value and 0 (the first decimal number) starts at 48
String webpage = "<h1>Hello</h1><h2>World!</h2><button>LED1</button>";
String cipSend = "AT+CIPSEND=";
cipSend += connectionId;
cipSend += ",";
cipSend +=webpage.length();
cipSend +="\r\n";
ESP8266.println(cipSend);
initESP8266();
ESP8266.println(webpage);
initESP8266();
webpage="<button>LED2</button>";
cipSend = "AT+CIPSEND=";
cipSend += connectionId;
cipSend += ",";
cipSend +=webpage.length();
cipSend +="\r\n";
ESP8266.println(cipSend);
initESP8266();
ESP8266.println(webpage);
initESP8266();
String closeCommand = "AT+CIPCLOSE=";
closeCommand+=connectionId; // append connection id
closeCommand+="\r\n";
}
}
}
/****************************************************************/
/* Fonction qui initialise l'ESP8266 */
/****************************************************************/
void initESP8266()
{
Serial.println("**********************************************************");
Serial.println("**************** DEBUT DE L'INITIALISATION ***************");
Serial.println("**********************************************************");
envoieAuESP8266("AT+RST");
recoitDuESP8266(2000);
Serial.println("**********************************************************");
envoieAuESP8266("AT+CWMODE=3");
recoitDuESP8266(2000);
Serial.println("**********************************************************");
envoieAuESP8266("AT+CIPMUX=1");
recoitDuESP8266(1000);
Serial.println("**********************************************************");
envoieAuESP8266("AT+CIPSERVER=1,80");
recoitDuESP8266(1000);
Serial.println("**********************************************************");
Serial.println("***************** INITIALISATION TERMINEE ****************");
Serial.println("**********************************************************");
Serial.println("");
}
/****************************************************************/
/* Fonction qui envoie une commande à l'ESP8266 */
/****************************************************************/
void envoieAuESP8266(String commande)
{
ESP8266.println(commande);
}
/****************************************************************/
/*Fonction qui lit et affiche les messages envoyés par l'ESP8266*/
/****************************************************************/
void recoitDuESP8266(const int timeout)
{
String reponse = "";
long int time = millis();
while( (time+timeout) > millis())
{
while(ESP8266.available())
{
char c = ESP8266.read();
reponse+=c;
}
}
Serial.print(reponse);
}
un exemple du " n'importe quoi" avec les diverses modifications ?
Un apparent "n'importe quoi" a sa logique qui , si on arrive à la comprendre , renseigne sur le pb
C'est un symptôme, pas "n'importe quoi", en cachant le symptôme on s'interdit de comprendre.
Si je comprend bien maintenant le code est OK, il est possible de se connecter au serveur, d'agir sur la LED...
C'est bien ça ?
Alor se matin j'ai réessayer et il y avais plus rien qui fonctionais ,les led de l'esp fontionnais mais il ne repond plus du tout au requete de l'arduino. >:(
Comme indiqué 115200 bauds en SoftSerial donne un fonctionnement aléatoire.
Faire qui est indiqué par Kayel pour se débarrasser du pb, ou utiliser une carte qui dispose d'un port série matériel libre et éviter ainsi le recours à SoftSerial