Go Down

Topic: NTP --ESP8266 Time-Synced, Data Logging and Web Server (Read 2880 times) previous topic - next topic

Techno500

#15
Oct 12, 2018, 10:23 pm Last Edit: Oct 13, 2018, 06:07 am by Techno500 Reason: Renamed attached file.
If you are only using GPS time and date remove the following code:

Code: [Select]
#include <sys/time.h>                   // struct timeval
#include <time.h>                       // time() ctime()


I can not say this is a fix; just a suggestion.  Reinstalling TinyGPSPlus library may fix the problem.  

Load your sketch into Arduino IDE.  Select "Sketch" tab, go down and select "Include library," slide mouse over to next column and select "Add ZIP library."  Go to location of zipped library file and select the file. You can remove the line  it places at the top of your sketch; since it is already in the sketch.

Once the library is installed; this is what I see using Notepad++ for Arduino IDE code editing:



Note when I looked at your code, "date" was not red, font color.  This could have been from my library setup; thought it was worth mentioning.

Noticed you are adapting an older version of "NTP_Time-Synced_Web_Interface.ino."  Attached is the current version of the project that is driving two different web sites.  See previous post for web site links.

Another suggestion; look at the "TinyGPSPlus" library examples, comparing to see if anything could have been missed when adapting to my project.



Since I do not have a GPS module to test with; I can only make suggestions.


William

Techno500

#16
Oct 14, 2018, 08:04 am Last Edit: Oct 14, 2018, 08:15 am by Techno500
haroon552

Which board are you using for your project?  My project uses an ESP8266 12E.  Is this code for a NodeMCU 12E; if so then this applies...

Looking at your "Not working" code again; I see in setup you are using "wire.begin()" this I believe should be "wire.begin(6,7);"  as these are the pins you are using your softwareserial library.  One other note; are you using the "espsoftserial" library?.

Reference as to why to use "espsoftserial library.".

According to this reference you should use a lower speed baud rate; reference author recommends 9600 baud.

Additionally, read this post about esp8266 system reserved pins.

NodeMCU pinouts  unavailable pins  Also pinouts may be board specific; check vendors support page for pinouts.

William

haroon552

hi,
I am using Esp8266 12e board fo this project . i reinstalled the library . still same. actually it reboots again and again just it connect to wifi and got ip after it reboots . could you please solve my problem

Techno500

#18
Oct 15, 2018, 12:03 am Last Edit: Oct 16, 2018, 07:06 pm by Techno500 Reason: Corrected url link
haroon,

Please download the library I linked to in the  modified source code.  The arduino uno/mega version is reported not to work with the ESP8266.  Please download, compile and try attached code before making any other changes,  Do install the "espsoftwareserial" library to the Arduino IDE.

There are changes; by line numbers...

50-51 Commented out two unneeded libraries from includes.
70-75 Removed SSID and passwords  
181-183 Removed ThingSpeak channelnumber and apikey
188-189 Defined GPSBaud; it was undefined
196-201 Assigned RX and Tx pins for SoftwareSerial

I have no NEO6M GPS to test this code; please test and let me know result, thank you.

YouTube video:

ESP8266 Nodemcu & Ublox GPS & Oled display location tinygps tutorial


William


haroon552

#19
Oct 15, 2018, 08:03 am Last Edit: Oct 15, 2018, 11:10 pm by haroon552
If you give me address I can gift you the neo GPS module, please

I modified the code, It is working but the problem is server becomes slow and I thing SoftwareSerial buffer is getting full, and could you please add delay for GPS, it should wait until date and time obtained when logger start.

and one more question how can I send the saved log.text file to FTP server that is saving inside this sketch. mean for the whole day I have no wifi when I connect wifi it should connect automatically to FTP server and upload file automatically there is anything like this?

Techno500

haroon,


Thank you for your generous offer; please, keep experimenting with your GPS Module, this is a good learning experience!

I have GPS Module on order coming via e-packet.

Did you have a chance to try "Try__GPS_Time_NOT_WORKING1010181436.zip?"

Did it produce any compiler errors?  Any changes from last run of your earlier code?


William


haroon552

I modified the code, It is working but the problem is server becomes slow and I thing SoftwareSerial buffer is getting full, and could you please add delay for GPS, it should wait until date and time obtained when logger start.

and one more question how can I send the saved log.text file to FTP server that is saving inside this sketch. mean for the whole day I have no wifi when I connect wifi it should connect automatically to FTP server and upload file automatically there is anything like this?

Techno500

haroon552

I do not knowingly upload personal information; mine or yours!

Restore your personal information; I listed the lines in previous post.  You need SSID, network password,  ThinkSpeak.com channel number, writeapikey and --Public (WAN) IP  --do this only if you understand the security risks!

I will help; however, my time is limited.   My project code you are trying to work with is out dated, we need to use the current version; which I posted in a previous post.

My project depends on NTP time; sections of code in the project may need re rewritten.

A web browser connection is required to download from SPIFFS file system.  Point your web browser to the IP address that shows in serial monitor at the start of sketch execution.

 Web address:  "xxx.xxx.xxx.xxx:80/SdBrowse" replace x's with what you see in the serial monitor.

SdBrowse is one way; files in SPIFFS are listed as url links that can be selected for download.  There is no upload.

Wifi will not work until you restore the items I listed!

Lets take a slow approach to this; getting GPS Time to work as the first task since the whole project depends on time keeping!

Checkout File Browser  ESP9288 Based server for myproject...

William




haroon552

I am planning to sync rtc ds3231 with ntp, and gps i will use only to get lat lng , I will send you the results.

Techno500

#24
Oct 16, 2018, 05:31 pm Last Edit: Oct 16, 2018, 07:57 pm by Techno500 Reason: Add content
haroon552


Could you try the attached sketch with your GPS module?  Added day of the week function to the time keeping process.  Compiles okay, and web browser pulls up the web page xxx.xxx.xxx.xxx/Weather  You need to edit x's with your ip you want to use as your url ip address.

Now using:  RXPin = 12, TXPin = 13;                // Connect Ublox Neo 6m, GPS module to pins 12 and 13 on ESP8266.

Do you get any GPS LED lights coming on? Steady or flashing?  What ESP8266 pins are you using to connect GPS Tx and Rx?

William

Techno500

YouTube video ESP8266 Nodemcu & Ublox GPS & Oled display location tinygps tutorial has a link to the sketch that was used in producing this video.

Link to sketch; proven to work with Neo6m and the ESP8266,

Attached is modified sketch;  with no OLED display.  As seen in the video; EZtech's code is working with the Neo6m and the ESP8266, sketch may be used to test Neo6m GPS module output.


William




haroon552

Hi, thank you for helping me alot, i tests these these sketches before all are working fine, only the problem i am getting when i am joining your sketch and gps sketch, it start rebooting again and again

Techno500

#27
Oct 18, 2018, 07:59 pm Last Edit: Oct 20, 2018, 02:59 pm by Techno500
haroon552,

May I debug code you are combing?



William

Techno500

#28
Oct 21, 2018, 10:41 pm Last Edit: Oct 23, 2018, 07:23 am by Techno500 Reason: Adding info about Dev. Board.
haroon552 of this forum provided GPS  Arduino code and Arduino Tipping bucket rain gauge code for modifying current version of "NTP_Time-synced_Web_Interface.ino."  Additional code for development of rtc with NTP time setting was provided by rudy of "ESP8266 Community."

This version of the the new code has been named:  "NTP_Time-synced_with_RTC_Web_Interface.ino."

Project runs on a "RobotDyn WiFi D1 R2" Development Board with 32MiB of memory.  ESP8266-12 based WiFi enabled microprocessor unit on a Arduino-UNO footprint.



William

Techno500

Created a Special Version of "NTP_Time-synced_Web_Interface.ino" that adds FTP file transfers; using the
esp8266FTPServer Library.  Be sure to read the "README.MD" file on library web page for configuring information for "FileZilla."

Working on adding Real Time Clock support and GPS locations; feature requested by "Haroon552"

"Haroon552" has added a "Tipping rain bucket" to the project.  I am working on putting all the code  together in one sketch.  "Special Verision" has the core of my project plus, FTP  File Transfers.  More to develop later...

"Special Version" is attached...

William

Go Up