TXD ?
RXD ?
Ou
- Tx0
- Rx0
Sur ESP32 il y a plusieurs liaisons (dite) série.
Bonsoir @konbon
Cette carte semble être une nombreuses copies de carte DEVKit ESP32 d'Espressif,
TXD ou TX0 en GPIO1
RXD ou RX0 en GPIO3
(ces 2 bornes sont déjà câblées au circuit d'interface USB)
Il n'y a d'emplacement obligé pour les autres paires TX/RX
OK
Connexion avec SIM800L
#include <SoftwareSerial.h>
SoftwareSerial MySerial2(pinTXD, pinRXD); // je metterai quoi
?
ok 1 et 3 tanks
2 remarques sur ce bout de code douteux dans le cas d'un ESP32
Il est très rare qu'on ait besoin d'un SoftSerial avec un ESP32 vu qu'il possède 3 ports série hardware
Les GPIO1 et 3 étant déjà utilisés (pour le circuit d'interface USB) y mélanger les signaux reliés à un SIM800 n'est pas très futé ..... ne pas attendre un fonctionnement 100% sans problèmes
Je n'ai pas le lien , une recherche devrait montrer que le cas a été traité récemment sur ce forum avec un SIM800 relié sans SoftwareSerial vers une parie RX/TX autre que celle des GPIO1 et 3
Sur de nombreuse cartes ressemblant plus ou moins à la tienne
Serial est associé aux GPIO1(TXD0 ou TXD) et GPIO3 (RXD0 ou RXD)
Serial2 aux GPIO 17 (TXD2) et GPIO16 (RXD2) .....même si ça n'est pas écrit sur la carte
La disponiblilité de Serial2 rend inutile l'utilisation d'un substitut comme SofwareSerial
J'ai utilisé GPIO 17 et 16
#include <SoftwareSerial.h>
SoftwareSerial mySerial(16, 17); //SIM800L Tx & Rx is connected to Arduino #3 & #2
void setup()
{
//Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
Serial.begin(9600);
//Begin serial communication with Arduino and SIM800L
mySerial.begin(9600);
Serial.println("Initializing...");
delay(1000);
mySerial.println("AT"); //Once the handshake test is successful, it will back to OK
updateSerial();
mySerial.println("AT+CSQ"); //Signal quality test, value range is 0-31 , 31 is the best
updateSerial();
mySerial.println("AT+CCID"); //Read SIM information to confirm whether the SIM is plugged
updateSerial();
mySerial.println("AT+CREG?"); //Check whether it has registered in the network
updateSerial();
}
void loop()
{
updateSerial();
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
}
while(mySerial.available())
{
Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
}
}
RESULTAT : je reçois pas de msg sur mon gsm
AT
OK
AT+CSQ
+CSQ: 0,0
OK
AT+CCID
89232010611621577362f
OK
AT+CREG?
+CREG: 0,2
OK
Call Ready
SMS Ready
Bonjour @konbon
question GPIO réglée, c'était le sujet de ce fil de discussion (titre)
tu as réglé à ta façon (avec SoftwareSerial ) , l'échange d'informations entre ESP32 et SIM800 se fait
la SIM800 répond aux commandes AT reçues.
Ton problème est maintenant celui de l'utilisation d'un module SIM800 (carte SIM valide, avec ou sans code PIN, Alimentation du module.......),
Crées un nouveau fil de discussion sur ce nouveau sujet en mentionnant SIM800 et ESP32 dans le titre, ça attirera l'attention des personnes maîtrisant ce sujet particulier
Dans ce nouveau fil donnes le code et le montage en montrant clairement d'où le SIM800 reçoit son alimentation
ok ça roule
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.