Hello, i am working on my project visualize my boat location on BLYNK app. I using OTA library to update my sketches by air. Gps module i povered by 5v, and make voltage divider 3,3v on TX pin on gps module and connect to esp8266 D1-RX pin, and TX pin from gps module to esp8266 D2-RX pin. And when i try update sketch by wifi it somtimes uploading, but most time just stuck. And somtimes esp8266 stoping working. When i disconecting RX from gps module all working fine.
So i dint know where to looking for a bug?
//#define BLYNK_PRINT Serial //we will not use dis definition becouse we not using serial monitor
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <TimeLib.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include "clock_display.h" // turning on clock and displaying
#include "bilge_pumpe_button.h" //program to control relay by button on blynk app
#include "gps.h" // get gps lat lon
#include "led_indicator.h" // flashing led when board disconected from wifi
WidgetLCD lcd(V1);
BlynkTimer timer;
char auth[] = "c9acf2f3c5f2437e9ba05f59dd439921"; //Authorization code for blynk app to be connected to the serverString last_time_bilge_on; //writinc current time. Using for frite tim when bilge pump button was pressed
void setup()
{
Serial.begin(115200); //Using for OTA uploading new skethes
gps_tracker.begin(9600); // Using for gps module
pinMode(D3,OUTPUT);//green led on the box indicating what evrything is working
pinMode(D6,OUTPUT);// use for turn on reley
pinMode(D7,OUTPUT);// use for turn on reley
pinMode(D8,OUTPUT);// use for turn on reley
Blynk.begin(auth, "Msquare", "happylanding"); //begining blynk connection to wifi router
timer.setInterval(1000L, clockDisplay);
timer.setInterval(1000L, gps_data);
ArduinoOTA.setHostname("Bilge Water Controller GPS(ESP8266)");
ArduinoOTA.begin();
if ( Blynk.connected() ) // if connection to internet ok green led light on
{
digitalWrite(D3, HIGH);
}
if ( ! Blynk.connected() ) // if connection to internet lost green led blink 5 short times
{
led_indicator();
}
pinMode(D1,INPUT);
}
void loop()
{
Blynk.run();
timer.run(); // Initiates BlynkTimer
ArduinoOTA.handle();
if ( ! Blynk.connected() ) // if connection to internet lost green led blink 5 short times
{
led_indicator();
}
}
#include <SoftwareSerial.h>
#include <TinyGPS.h> // cables connection to gps module:
//red- vcc
//black-gnd
//white-rx (D1)
//green-tx (D2)
SoftwareSerial gps_tracker (D1, D2, false, 256); //setting pin for Serial comunication with gps module
WidgetMap Map(V10);
TinyGPS gps;
float lat = 28.5458,lon = 77.1703;
void gps_data()
{
while(gps_tracker.available()){ // check for gps data
if(gps.encode(gps_tracker.read()))// encode gps data
{
gps.f_get_position(&lat,&lon);
Map.location(1, lat, lon, last_time_bilge_on );
}
}
}