Arduino Uno sim808 init error - arduino

Hey so I have arduino uno and a sim808 with gps antenna and gsm antenna. So here's the sample code:
#include <DFRobot_sim808.h>
#include <SoftwareSerial.h>
#define PIN_TX 3
#define PIN_RX 4
SoftwareSerial mySerial(PIN_TX,PIN_RX);
//DFRobot_SIM808 sim808(&mySerial);//Connect RX,TX,PWR,
DFRobot_SIM808 sim808(&mySerial);
void setup() {
//mySerial.begin(9600);
Serial.begin(9600);
//******** Initialize sim808 module *************
while(!sim808.init()) {
delay(1000);
Serial.print("Sim808 init error\r\n");
}
//************* Turn on the GPS power************
if( sim808.attachGPS())
Serial.println("Open the GPS power success");
else
Serial.println("Open the GPS power failure");
}
void loop() {
//************** Get GPS data *******************
if (sim808.getGPS()) {
Serial.print(sim808.GPSdata.year);
Serial.print("/");
Serial.print(sim808.GPSdata.month);
Serial.print("/");
Serial.print(sim808.GPSdata.day);
Serial.print(" ");
Serial.print(sim808.GPSdata.hour);
Serial.print(":");
Serial.print(sim808.GPSdata.minute);
Serial.print(":");
Serial.print(sim808.GPSdata.second);
Serial.print(":");
Serial.println(sim808.GPSdata.centisecond);
Serial.print("latitude :");
Serial.println(sim808.GPSdata.lat);
Serial.print("longitude :");
Serial.println(sim808.GPSdata.lon);
Serial.print("speed_kph :");
Serial.println(sim808.GPSdata.speed_kph);
Serial.print("heading :");
Serial.println(sim808.GPSdata.heading);
Serial.println();
//************* Turn off the GPS power ************
sim808.detachGPS();
}
}
So I'm always getting a result of "sim808 init error"
I don't know what the problem is but I do hope that the sim808 isn not broken because it has light in STA(status) and in NET(network) that is slowly blinking but there's no light in PPS(gps) I don't know what's the problem I'm really really confused.

//mySerial.begin(9600);
This line just below the void setup must be a code part not comment, delete the
'//'
mySerial.begin(9600);
Serial.begin(9600);
Also 6th line
//DFRobot_SIM808 sim808(&mySerial);//Connect RX,TX,PWR,
must be part of code not comment, delete the '//'
Try again as
DFRobot_SIM808 sim808(&mySerial);//Connect RX,TX,PWR,
It should work, since it is a cold start it might take time, if you had problem again correcting those comment lines into code, just swap the pins

You must use pins 7 and 8 of the Arduino as Tx and Rx. With the 3 and 2 you have selected it will not work for you.

Related

Solved --- ESP8266 with DHT11 / DHT22 Standalon -> problem with Arduino to flash the ESP8266

before to come here, I've tried lot an lot of solutions found on the net and here.
The issue is:
After compile code (passed as good), I try to upload it into ESP8266 throu Arduino.
The result is:
« esptool.py v3.0 Serial port /dev/ttyACM0
Connecting........_____....._____....._____....._____....._____....._____.....____
Traceback (most recent call last):
File "/home/patrick/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/upload.py", line 66, in <module> esptool.main(cmdline)
File "/home/patrick/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool/esptool.py", line 3552, in main esp.connect(args.before, args.connect_attempts)
File "/home/patrick/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool/esptool.py", line 529, in connect raise
FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error)) esptool.
FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
_ le port série sélectionné _ n'existe pas ou votre Arduino n'est pas connecté »
During transfer I can see both Arduino (TX and RX) DEL blinking, and Arduino RX blinks the ESP8266 TX blinks also. From there ... I feel like having good connection.
The pinout goses like this
Arduino - ESP8266
GND - GND
3.3V - VCC
RX+0 - TX
TX+1 - RX
3.3V - CH_PD/EN
According to ESP8266pinout
I tried to
change the upload speed
change the CPU frequency
change the cristal frequency
switch TX / RX just i case I would plugged them on reverse
updated the DHT driver and adapted the code consequently
downgrade the ESP8666 driver on Arduino IDE from 3.2 to 2.5.1, to 2.5.0, to 2.4.9
modify the upload.py file, line 66 and around
My ESP8666 did connect properly to the WiFi Network previously, programming it with Raspberry PICO and micropython. From that, I'm pretty sure about the good working state of the device.
Below is my c++ code
#include <ESP8266WiFi.h>
#include <DHT.h>
const char* ssid = "BullFrog"; // Your ssid
const char* password = "Pr1on$J3sus"; // Your Password
WiFiServer server(80);
//Instantiation d'une nouvelle classe DHT
// DHT DHT (pin, type, count);
// #param pin
// pin number that sensor is connected
// #param type
// type of sensor
// #param count
// number of sensors
DHT DHT(2, 11, 1);
double Fahrenheit(double celsius) {
return ((double)(9 / 5) * celsius) + 32;
}
double Kelvin(double celsius) {
return celsius + 273.15;
}
void setup() {
Serial.begin(115200);
delay(10);
Serial.println();
// Connect to WiFi network
WiFi.mode(WIFI_STA);
Serial.println();
Serial.println();
Serial.print("Tentative de connexion au Wifi nommé ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("Connexion WiFi établie");
// Start the server
server.begin();
Serial.println("Démarrage du serveur web");
// Print the IP address
Serial.println(WiFi.localIP());
}
void loop() {
int err;
float temp, humi;
if (temp = DHT.readTemperature(false, false)) {
Serial.print("Température:");
Serial.print(temp);
} else {
Serial.println();
Serial.print("Erreur lors de la lecture de la température. No :");
Serial.print(err);
Serial.println();
}
if (temp = DHT.readHumidity(false)) {
Serial.print(" Humidité:");
Serial.print(humi);
Serial.println();
} else {
Serial.println();
Serial.print("Erreur lors de la lecture de l humidité relative. No :");
Serial.print(err);
Serial.println();
}
WiFiClient client = server.available();
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connection: close");
client.println("Refresh: 5");
client.println();
client.println("<!DOCTYPE html>");
client.println("<html xmlns='http://www.w3.org/1999/xhtml'>");
client.println("<head>\n<meta charset='UTF-8'>");
client.println("<title>ESP8266 Température & Humidité DHT11</title>");
client.println("</head>\n<body>");
client.println("<H2>Capteurs ESP8266 & DHT11</H2>");
client.println("<H3>Humidité / Température</H3>");
client.println("<pre>");
client.print("Humidité (%) : ");
client.println((float)humi, 2);
client.print("Température (°C) : ");
client.println((float)temp, 2);
client.print("Température (°F) : ");
client.println(Fahrenheit(temp), 2);
client.print("Température (°K) : ");
client.println(Kelvin(temp), 2);
client.println("</pre>");
client.println("<H3>Revenez nous voir!</H3>");
client.print("</body>\n</html>");
// delay(DHT11_RETRY_DELAY); //delay for reread
}
I want to use this kit in standalone
I followed this tutorial (among others)
Thanks for your attention and help.
I would first try to program your ESP-01 with a simple Blink sketch, just to confirm the ESP-01 is ok.
These are examples from the same website you reference:
https://www.elec-cafe.com/tag/esp8266-flasher/
https://www.elec-cafe.com/esp8266-esp-01-firmware-update/
Also, the ESP8266 requires a good amount for power for WiFi transmit. Sometimes it help to use separate power supply and add 470uF or 1000uF capacitor across the VCC and GND of the ESP chip.
I hope this might help you to succeed.
The problem is not in coding but in wiring.
Remember that (with ESP8266-01) :
pin 1 as GND (from left to right 1,2,3,4) on the row near to the middle of board
pins 5 as VCC (from right to left 5,6,7,8) on the row near to the ridge of board
pins 5 and 7 must be permanently connected
for loading code into ESP8266-01: pins 1 and 3 must be connected for the uploading time duration.
Once everything is uploaded, come back to the using position (uplug 1 - 3) like this:

Arduino communication with TMC2209

I'm trying to communicate with TMC2209 (stepper drive) with an Arduino nano Every.
I connected pin RX on pin D2 and TX on pin D3.
I placed a 1K resistor between TX and RX.
It seems I can write parameters (even I'm testing this deeply, I'm not so sure now..) but I'm not able
to read nothing from driver.
Picture added 15/04/2021 related to datasheet of TMC2209
In my test, I tried with only one driver with address 0, means MS1_AD0 and MS2_AD1 connected to GND.
driver1.microsteps(MICROSTEPS);
SerialPort.print("Counter1=");
SerialPort.print(driver1.IFCNT());
SerialPort.print(", Status=");
SerialPort.println(driver1.DRV_STATUS());
I tried reading IFCNT and DRV_STATUS, always ZERO.
The initialization is done in this way:
#include <Wire.h>
#include <AG_AS5600.h>
#include <TMCStepper.h>
#include <AccelStepper.h>
#define ENCODER false
#define FEEDBACK_I2C true
#define GEARBOX 139 //51
#define MICROSTEPS 16
#define MIN_SPEED 20
#define MAX_SPEED 3000
double offsetHome = 77.0;
#ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE
#define SerialPort SerialUSB
#define SYS_VOL 3.3
#else
#define SerialPort Serial
#define SYS_VOL 5
#endif
#define SW_RX 2 // TMC2208/TMC2224 SoftwareSerial receive pin
#define SW_TX 3 // TMC2208/TMC2224 SoftwareSerial transmit pin
#define EN_PIN 7 // Enable
#define DIR_PIN 8 // Direction
#define STEP_PIN 9 // Step
#define SERIAL_PORT Serial1 // TMC2208/TMC2224 HardwareSerial port
#define DRIVER_ADDRESS1 0b00 // TMC2209 Driver address according to MS1 and MS2
#define R_SENSE 0.11f // Match to your driver
// SilentStepStick series use 0.11
// UltiMachine Einsy and Archim2 boards use 0.2
// Panucatt BSD2660 uses 0.1
// Watterott TMC5160 uses 0.075
AG_AMS_5600 ams5600;
TMC2209Stepper driver1(SW_RX, SW_TX, R_SENSE, DRIVER_ADDRESS1);
AccelStepper stepper = AccelStepper(stepper.DRIVER, STEP_PIN, DIR_PIN);
String cmd = {};
void setup()
{
SerialPort.begin(115200);
Wire.begin();
Wire.setTimeout(10);
SerialPort.println(">>>>>>>>>> Program started <<<<<<<<<<");
pinMode(EN_PIN, OUTPUT);
pinMode(STEP_PIN, OUTPUT);
pinMode(DIR_PIN, OUTPUT);
digitalWrite(EN_PIN, HIGH); // Enable driver in hardware
// Enable one according to your setup
SPI.begin(); // SPI drivers
driver1.beginSerial(115200); // SW UART drivers
driver1.begin(); // SPI: Init CS pins and possible SW SPI pins
// UART: Init SW UART (if selected) with default 115200 baudrate
driver1.toff(5); // Enables driver in software
driver1.rms_current(2000); // Set stepper current to 600mA. The command is the same as command TMC2130.setCurrent(600, 0.11, 0.5);
driver1.microsteps(MICROSTEPS);
driver1.pwm_autoscale(true); // Needed for stealthChop
stepper.setMaxSpeed(degToSteps(500.0)); // steps/s
stepper.setAcceleration(degToSteps(1.0)); // steps/s^2
stepper.setEnablePin(EN_PIN);
stepper.setPinsInverted(false, false, true);
stepper.disableOutputs();
}
void loop()
{
unsigned long t0 = micros();
switch (step) {
case 0:
cmd = SerialPort.readString();
if (cmd.charAt(0)=='a' && cmd.charAt(1)=='=') {
acc = degToSteps(cmd.substring(2).toDouble());
SerialPort.print("Acceleration=");
SerialPort.println(acc);
cmd = "";
}
else if (cmd.charAt(0)=='d' && cmd.charAt(1)=='=') {
dec = cmd.substring(2).toInt();
SerialPort.print("Deceleration=");
SerialPort.println(dec);
cmd = "";
}
else if (cmd.charAt(0)=='c' && cmd.charAt(1)=='?') {
driver1.microsteps(MICROSTEPS);
driver2.microsteps(MICROSTEPS);
SerialPort.print("Counter1=");
SerialPort.print(driver1.IFCNT());
SerialPort.print(", Counter2=");
SerialPort.print(driver2.IFCNT());
SerialPort.print(", Status=");
SerialPort.println(driver1.DRV_STATUS());
cmd = "";
}
}
The hardware should be ok because the jumper for UART is configured as default on pin4.
Can someone help me to understand why?
Thanks
Andrea
I found!
The issue was the handling of "software" serial port.
Unfortunately I was confused because many examples of "TMCstepper.h" library are shown using two pins as TX and RX, so I was convinced internally pins were handled to send and receive.. but it's not.
So solution I found is:
#include <SoftwareSerial.h>
SoftwareSerial SerialDriver1(SW_RX, SW_TX);
TMC2209Stepper driver1(&SerialDriver1, R_SENSE, DRIVER_ADDRESS1);
void setup()
{
SerialDriver1.begin(57600);
SerialDriver1.listen();
...
and was really important to comment:
//driver1.beginSerial(115200); // SW UART drivers
this is important I guess because the port was already opened in the setup by me.
and it's necessary to specify the software port where to listen, not done by TMC library.
Last hint, with Arduino Nano Every I found out that Software Serial seems to work with max baudrate of 57600, 115200 was not working.

Lilygo ttgo t-beam and Lora problem on sending or receiving

is it possible to send a lora payload from a T-Beam and receive it from a LoRa32 SX1276 OLED (v2) ? I if follow those two tutorials:
https://randomnerdtutorials.com/ttgo-lora32-sx1276-arduino-ide/ or https://randomnerdtutorials.com/esp32-lora-rfm95-transceiver-arduino-ide/, i can send and receive without problem from two LoRa32 devices.
But if i let the LoRa32 receiver ON and tries to send from a T-Beam T22V1.0, nothing seems to happen.
T-beam code: (some gps related vars are set but i removed gps code for clarity. GPS does work fine.)
What am i doing wrong ?
(if i am not in the good place for that kind of beginner issue, please tell me and i'll try to find a more suitable place for this..)
#include <TinyGPS++.h>
#include <axp20x.h>
#include <SPI.h>
#include <LoRa.h>
#define SCK 5 // GPIO5 -- SX1278's SCK
#define MISO 19 // GPIO19 -- SX1278's MISnO
#define MOSI 27 // GPIO27 -- SX1278's MOSI
#define SS 18 // GPIO18 -- SX1278's CS
#define RST 23 // GPIO14 -- SX1278's RESET
#define DI0 26 // GPIO26 -- SX1278's IRQ(Interrupt Request)
#define BAND 868E6
TinyGPSPlus gps;
HardwareSerial GPS(1);
AXP20X_Class axp;
void setup()
{
Serial.begin(115200);
Wire.begin(21, 22);
if (!axp.begin(Wire, AXP192_SLAVE_ADDRESS)) {
Serial.println("AXP192 Begin PASS");
} else {
Serial.println("AXP192 Begin FAIL");
}
axp.setPowerOutPut(AXP192_LDO2, AXP202_ON); //lora
axp.setPowerOutPut(AXP192_LDO3, AXP202_ON); //gps
axp.setPowerOutPut(AXP192_DCDC2, AXP202_ON);
axp.setPowerOutPut(AXP192_EXTEN, AXP202_ON);
axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON); //oled
GPS.begin(9600, SERIAL_8N1, 34, 12); //17-TX 18-RX
SPI.begin(SCK,MISO,MOSI,SS);
LoRa.setPins(SS,RST,DI0);
if (!LoRa.begin(BAND)) {
Serial.println("Starting LoRa failed!");
while (1);
}else{
Serial.println("Starting LoRa succeed!");
}
axp.setChgLEDMode(AXP20X_LED_BLINK_1HZ);
}
void loop()
{
LoRa.beginPacket();
LoRa.print("Hello");
LoRa.endPacket();
Serial.println("sent..");
delay(1000);
}
Thanks :)
[EDIT]
I tried to use https://github.com/Extentsoftware/TBeamPower.
Still nothing.
Here is the code:
#include <Arduino.h>
#include <SPI.h>
#include <LoRa.h> // https://github.com/sandeepmistry/arduino-LoRa/blob/master/API.md
#include "gps.h"
#include "TBeamPower.h"
TBeamPower power(PWRSDA, PWRSCL); //21 22
void setupSerial() {
Serial.println();
power.print_wakeup_reason();
}
void setup() {
Serial.begin(115200);
while (!Serial);
Serial.println("Power begin");
power.begin();
Serial.println("All sensors off");
power.power_sensors(false);
Serial.println("All peripherals off");
power.power_peripherals(false);
Serial.println("Powering LoRa");
power.power_LoRa(true);
SPI.begin(SCK,MISO,MOSI,SS); //5 19 27 18
LoRa.setPins(SS,RST,DI0); //18 14 26
if (!LoRa.begin(BAND)) { //868E6 (France)
Serial.println("Starting LoRa failed!");
while (1);
}else{
Serial.println("Starting LoRa succeed!");
}
Serial.println();
}
void loop() {
power.led_onoff(true);
delay(500);
power.led_onoff(false);
LoRa.beginPacket();
LoRa.print("hello");
LoRa.endPacket();
Serial.println("sent..");
power.print_status();
Serial.println();
delay(2000);
}
And here is the output i get
Power begin
AXP192 Begin PASS
All sensors off
All peripherals off
Powering LoRa
Starting LoRa succeed!
sent..
Voltages:
DCDC1: 3.30v
DCDC2: 1.25v
DCDC3: 3.30v
LDO2: 3.30v
LDO3: 2.80v
ChargeCurrent: 0.70A
IPSOUTVoltage: 3.57v
Temp: 15.94°C
TSTemp: 800.00
VbusCurrent: 0.00
VbusVoltage: 0.00
Battery:
Connected: false
Charging: false
ChargEN : true
Voltage: 0.00v
Inpower: 0.00
DischgCur: 0.00
ChargeCur: 0.00
I even tried to change the antenna.
I also tried to make the TBeam as receiver, and nothing arrived.
I had the same issue using one t-beam to send and a second to receive. The solution was to cycle power to both boards. Doing a reset or uploading the code does not do the same thing. I spent hours looking at my code and trying different things until I cycled power to both boards. I can finally work on the code for my project. Lilygo documentation is very minimal and some of the example code does not work.
They should work provided the frequencies are the same,
Check if both the T-Beam as well as the LoRa32 modules operate in the same frequency. Lora supports different frequencies. If you check in the links you provided you will see the following code:
//433E6 for Asia
//866E6 for Europe
//915E6 for North America
#define BAND 866E6
Whereas in your T-Beam code there is
#define BAND 868E6
So maybe you have a problem here.

OLED (I2C) and Micro SD card module not working together in Arduino

I am trying to write some data to SD card and read it back to serial monitor as well as display it to the OLED.
Both the SD card and OLED work separately but they seem to be interfering with each other when combined. I have used Arduino SD and Adafruit OLED libraries.
Connections from Arduino Uno to Micro SD card module:
5V to SD VCC
GND TO SD GND
PIN 10 TO SD Chip Select
PIN 11 TO SD MOSI
PIN 12 TO SD MISO
PIN 13 TO SD SCK
Connections to OLED:
3.3V to OLED VCC
GND TO OLED GND
A4 TO OLED SDA
A5 TO OLED SCK
Here is the code:
#include <SPI.h>
#include <SD.h>
File myFile;
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
while(!Serial) {
;
}
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;); // CODE GETS STUCK HERE. DISPLAY NEVER INITIALISES
}
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(29,29);
display.print("INITIALISING");
display.display();
delay(5000);
if (!SD.begin(10)) {
Serial.println("initialization failed!");
while (1);
}
Serial.println("initialization done.");
myFile = SD.open("test.txt", FILE_WRITE);
if (myFile) {
Serial.print("Writing to test.txt...");
myFile.println("testing 1, 2, 3.");
// close the file:
myFile.close();
Serial.println("done.");
} else {
// if the file didn't open, print an error:
Serial.println("error opening test.txt");
}
display.clearDisplay();
myFile = SD.open("test.txt");
if (myFile) {
Serial.println("test.txt:");
while (myFile.available()) {
Serial.write(myFile.read());
display.setCursor(0,0);
display.print(myFile.read());
display.display();
delay(5000);
}
// close the file:
myFile.close();
} else {
// if the file didn't open, print an error:
Serial.println("error opening test.txt");
}
}
void loop() {
// put your main code here, to run repeatedly:
}
Code gets stuck at OLED initialization as mentiontioned above. If I replace these lines:
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;); // CODE GETS STUCK HERE. DISPLAY NEVER INITIALISES
}
To this:
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
I have run I2C scanner code on OLED so the address "0x3C" is correct.
The OLED still doesn't work and SD card initialises but Arduino is writing wrong data to TXT file on SD card like this:
teóting 1,à2, ó®
Instead of:
testing 1, 2, 3.
I have also tried using U8G2 library's sketches with SD card in case Arduino was running out of RAM but it still doesn't work. I have also changed SD chip select to Arduino digital pin 4 but still same results.
On browsing and experimenting more,I found MISO OR MOSI PIN of SD maybe interfering with SDA/SCL pins of OLED. Maybe wiring needs to change.
ANY SUGGESTIONS?
(I had the same issue) Just posting the suggestions of the comments as an answer, all credit to #gre_gor and #datafiddler for discovering this:
Both libraries together run out of RAM (main memory).
From my testing, the SD library might continue to work if it is initialized first in setup(). The solution is to use the U8G2 OLED driver, which is much more memory economic. The driver is also in the official Arduino library directive, so you can install and use it directly from the IDE.

Can't connect Arduino to RFID

I am using an A-Star 32U4 Micro Arduino and I'm trying to connect the RDM6300 - 125KHz Cardreader Mini-Module.
I'm using this sketch at the moment:
#include <SoftwareSerial.h>
// RFID | Nano
// Pin 1 | D2
// Pin 2 | D3
SoftwareSerial Rfid = SoftwareSerial(2,3);
void setup() {
// Serial Monitor to see results on the computer
Serial.begin(9600);
// Communication to the RFID reader
Rfid.begin(9600);
}
void loop() {
// check, if any data is available
if(Rfid.available() > 0 ){
// as long as there is data available...
while(Rfid.available() > 0 ){
// read a byte
int r = Rfid.read();
// print it to the serial monitor
Serial.print(r, DEC);
Serial.print(" ");
}
// linebreak
Serial.println();
}
}
With this circuit:
module TX --- Arduino pin 2
module VCC ----- 5v
module ground ---- ground
antenna pins ---- antenna
When I put the card in the sensor nothing shows up on serial port. I tried this setup and the exact same sensors on an Arduino Uno (same sketch) and it worked perfectly, but I cant get this working on the Micro.
Arduino UNO and Micro uses different processors, though they work fairly similarly, they are not totaly identical.
It seams that
not all pins on the Leonardo and Micro support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
From the SoftwareSerial Library description ( https://www.arduino.cc/en/Reference/softwareSerial )
Change the module TX from pin 2 to pin 8. and you should be good. :-)

Resources