mini-NTP server with GPS
This is a mini-NTP based on a ESP32. Time will be provided from the GPS receiver and a DS3231 if no GPS-signal is avaliable, to server time to your networkcleints.
Firmware update to V1.4 now ready
.With the feedback and help from our readers some mayor bugs have been removed, now the sync with linux and windows machines workes as desired. Also a small problem within the WebUi and iPhones has addessed. For those thta use an GPS module that suffers from the weekrollover bug and won't get a new firmware, now you can adjust for this in the webinterface. This will expand the usablility of the module and also hopfully reduce e-wast. For a bit more easy of use you can now change / swap the displaycontent during runtime with the boot button. Sometimes small patches take a bit longer. With the Firmware 1.1 the NTP-Sever finally gained support for static IPv4 address settings. This meant a few changes in the code for the ESP32 and getting the HTML page with the requiered javascript ready. As the basic setup has only one display you can now switch between both if you press during runtime the bootbutton. Now you can choose the information you like to have without accessing the webserver on the ESP32. Still we need to inverstigate why the Raspberry Pi is not taking the time from the NTP-Server. But after the update back to the reason why we buidl it in the first place.
This mini-NTP sever has been buid a while ago. The first prototype was build for a exibition in france, 2018. Based on a ESP8266, a DS3231 based RTC and a small 0,96" OLED. This allowed the exhibits to get the time from a NTP on locations where the internetconnection is sometimes not given. This prototype since then as traveld to some exibitions ,like the electronica 2018 in munich. Also this mini-NTP served as timesever in the lab for some of your clocks and raspberry pi. Also this comes handy as we can manipulate time on the NTP server an test some condercases on some systems on the lab. Also if you have a small fleet of raspberry pi in your netwok this can be used to synchronize the time on the pis without connection to the internet. But the NTP had one major drawback, the DS3231 RTC used in this build was from a questinable source and the chip more a lookalike than a real DS3231. As a result the clock had an accuracy problem, meaning that it was after a month four to five minutes ahead of time.
This requiered every month a manual adjust to the clock. As this is not a problem for a exibitions where you set the clock and for a week are good to go, in the lab this leaded to some unhappy faces as the clocks synchronized to this NTP suggested that you just have missed an appointment or won't catch the bus. This was the point were the prototype requested a complete overhaul.
The ESP8266 was swapped with a ESP32 and a GPS receiver was added to synchronize time. As the choosen module comes with a onboard OLED we don't need a seperate display. For the GPS receiver we used one form our shop, which also exposes the point per second signal to a pin. For the RTC we used a DS3231 module we found in the lab, originally designed to be used on a raspberry pi.
Ingredients
We need a few modules to get all together:
Basically we use an ESP32 as core, a SSD1307 based I²C OLED, a GPS receiver and a RTC. This are modules sutable for a fast homebuild. But sometimes you like to get it even a bit smaller and may reduce modules. In this case we used a ESP32 Module with combined OLED and a DS3231 based RTC you can usually find on raspberry pis. This all is gone into a small housing and the components attached in a sandwich way with a bit of copper wire.


This makes it posible to put it in a small 3d printed enclosure and put it to a sutable location.

For the connection, the I²C is not on the usual pins for the ESP32, for the used module this is here on GPIO4, SCL, and GPIO5, SDA. We need to know this because we also need to attatch the DS3231 also to the I²C-Bus. For the GPS module we have choosen to use GPIO13 as RX-pin and GPIO15 as TX-pin. The connection need to be crossed, this means TX-pin to RX-pin. For the power supply the module needs 5V VCC we can get directly from the module.
After the basic hardwaresetup we also need a bit of software. We used https://github.com/liebman/ESPNTPServer to see which problems may arise in the build. For the software we repurposed some older labs projects like the pinball clock. Basically we used the timekeeping corefunctions from the pinball clock and it's ability to synchronize to different sources with different priorities. After the startup the DS3231, or also supported, the DS1307, will provide the time untill the GPS has revieived this information. If no clock is found the Server will run without the time from the i²C Clock and start counting form 1.1.1970 untill the first time from the GPS arrive. This means simply if you don't have a I²C Clock the ESP32 runs anyway, this is also true for the GPS part. If there is no GPS receiver connected, the ESP32 will simpily run form the DS3231 or use its internal timers.
NTP-Server

The Root Delay gives the distance between this server and the next server. As we are the only one in the chain we set the field to 1. This is also the same for the Root Displersion. As Refference Identifier we use "PPS" to show that we run on a pulse per second base.
We fill the Reference Timstamp with the current time and also set the Received and Transmit Timestamp accordingly. As the ESP32 only counts seconds we can't fill the factional part with any usefull infromation, so we set this to zero. This also means that we need to set the PRECISION field with a given valule. This is log2( Clock Jitter ) means at least one second we have form the missing fraction plus the jitter intoduced by calling your functon sto get the time. This is not 100% perfect but will do the job.
Timesources
As seen in the introduction we have two timesources. One it the DS3231, out RTC, and the other is the GPS wit a puls per second signal. As we have varing reception conditions this signal can somtime be present somtimes not. The signal is hooked to an interrupt and will be used as soon as it is avalible, meaning a switch over from the internal second counting to the external one. At the same point we monitor the signal. If the pulse is missing more than 1400ms we assume a lost of reception and fall back to the internal time source. Also this means we need to count a second and do it again in 600ms, as we are 400ms over the expected pulse.Also we get from the GPS-reveiver timestamps. It is sufficent to process and synchronize every 10 minutes to this timstamp to keep the NTP on time, as we are usually have the pulse per second signal from the gps.
Besides keeping time we can also disable the sync to the gps and only use the pusle per second to test systems in our networkt, how they behave on special ocasions, like switching from summer to wintertime.
Get and Compile the Software
The software is attached on this article. Also you may check back for new releases on this page. But if you like you can also grab a copy from Github. Here you may also find new preview versions or some mods to the original one.You need to install the Arduino IDE and the ESP32 board pakage. Also you need to install some librarys to get the code compiled. These are basically:
- U8G2
- Time
- Ticker
- TinyGPS++
- RTCLib
- ArduinoJson 6.x
- CRC32
ESP32 Setup
The setup of the ESP32 is quite simple. After you build the system it will power up as accesspoint. Form there you can connect to it and set your wifi. Also you can set all time relevant settings form the webinterface.Afterwards the ESP32 will try to connect to your wifi and to obtain an ip. If this is done you can go the the webinterface and may do further adjustments.Also you can swap the two displays, or if olny one is connected you can choos what to show.
This is basically all you need to do. The NTP will now respind to requests from your local network.
Parts that can be used for the build
If you like to order the parts from the elektorshop we provide here some linke to the modules that can be used for the build:1 x OPEN SMART GPS
1 x Wemos Lolin ESP32 OLED
For the RTC you can choose a DS3231 based or if you like you
can also use a DS1307 based one as been found here:
1 x Adalogger FeatherWing - RTC + SD Add-on
OPTIONAL:
1x 0,96" I²C OLED
Discussion (29 commentaire(s))
Martin71Bay il y a 1 an
Arduino IDE 2.2.1 auf Linux Mint 21.2 .Ich bekomme den Fehler :
Compilation error: invalid conversion from 'int' to 'ArduinoJson::V6213PB2::DeserializationError::Code' [-fpermissive] siehe Bild.Alle Libs sind neu...was kann ich tun ?
CU-Martin
ybourdon il y a 2 ans
In firmware 1.6 ligne 188 of has to be un-commente !
I will publish very soon my own hardware solution.
bug-fix.jpg (94kb)
fixed-20221128125757.jpg (186kb)
HaSch il y a 2 ans
ybourdon il y a 2 ans
I'm trying to build an NTP server using a circuit I developed with Elektor (Clemens Valens knows me well!).
I added an RTC 3231 module + a GPS + a button to switch the screens. I used the latest version of your software (1.6).
In local mode everything seems to work, and the RTC synchronizes well with the GPS time and the NTP server seems active. Unfortunately when I query this server, the time and date information is not returned correctly (see attached screenshot). On the serial port at each query of the server, I can see the Timestamp which is correct.
Do you have any idea of the origin of my problem?
Thanks for your feedback.
Best regards.
yves
screen-1-20221127205427.jpg (536kb)
screen-2-20221127205428.jpg (508kb)
HaSch il y a 2 ans
HaSch il y a 2 ans
Arduino IDE 1.8.13
Boards ESP32 1.0.6
Hardware:
WEMOS Lolin32 with OLED, OpenSmart GPS module and DS3231 RTC (also works with DS1307 RTC module)
Libraries:
U8g2 2.33.15 by oliver
Time 1.5.0 by Michael Margolis
TinyGPSPlus 1.0.3 by Mikal Hart
RTClib 1.14.2 by Adafruit
ArduinoJSON 6.19.4 by Benoit Blanchon
CRC32 2.0.0 by Christopher Baker
TinyWireM 1.0.1 by Adafruit
HaSch il y a 2 ans
Arduino IDE 1.8.13
Boards ESP32 1.0.6
Hardware:
WEMOS Lolin32 with OLED, OpenSmart GPS module and DS3231 RTC (but it also works with DS1307 RTC module)
Libraries:
U8g2 2.26.14
Time 1.5.0
RTClib 1.14.0
ArduinoJSON 6.10.0
CRC32 2.0.0
Thorsten Godau il y a 3 ans
ich habe mal "schnell und schlampig" eine Portierung für dem M5Stack Core gemacht:
https://github.com/dl9sec/180662-mini-NTP-ESP32/tree/M5Stack-port
Das/die OLED(s) entfallen und werden als virtuelle Displays auf dem TFT des M5Stack angezeigt.
Benötigt wird das GPS-Modul (NEO-M8N) und ein kleines DS3231-RTC-Modul (ich habe es in ein PROTO-Board eingebaut).
Mit der Taste C (rechts) kann der Server in der Hochlaufphase auf Default-Einstellungen zurückgesetzt werden ("RESET"), danach können die Anzeigen vertauscht werden ("SWAP").
Gruß, Thorsten
Mathias Clauszen il y a 2 ans
ich würde den Code der für den Port auf den M5Stack genutzt wurde gerne wieder in Richtung des Elektor Git und diese Seite zurück transportieren, wenn nichts dagegen spricht.
Mit freudlichen Grüßen
Mathias Claußen
FrankWhite il y a 3 ans
ich habe die 3 Zip Dateien heruntergeladen und wollte das in der Arduino IDE kompilieren. Es kommen Fehler
das Dateien fehlen: esp_wifi.h SPIFFS.h TinyGPS++.h CRC32.h
Wo kann ich die fehlenden herunterladen?
Grüße
schnarz il y a 3 ans
ich habe die neue Version 1.6 installiert, Libraries habe ich die Versionen aus der platformio.ini installiert, allerdings habe ich die Arduino IDE zum hochladen verwendet. Display, Weboberfläche und NTP-Abfrage funktionieren, allerdings ist die zurückgegebene Uhrzeit falsch und springt pro Sekunde um ca. 8388607 Sekunden. Im Serial Monitor sieht das folgendermaßen aus: Die Tiemstamps, die bei der NTP-Abfrage erzeigt werden, sind also richtig, aber irgendwie kommt das am client falsch an. woran kann das liegen?
Viele Grüße
Jochen
Mathias_Claussen(Elektor) il y a 3 ans
es kann sein das beim zusammenetzen der NTP Pakete noch etwas nicht ganz sauber läuft. Dazu müsste ich mir einmal mit dem Wireshark ( oder etwas printf fu ) ansehen was in die Pakete gelegt wird, es kann sein das ein hton oder ntoh ( byte order ) nicht korrekt verwendet wird.
Mit freundlichen Grüßen
Mathias Claußen
schnarz il y a 3 ans
danke für den Hinweis, ich kenne mich zwar nicht aus mit byte orders, habe aber mal in der ntp_server.cpp die Kommentierungen von Zeile 189 und 190 entfernt: Und jetzt funktioniert es, bzw. schwankt die Zeit nur noch um ca. +0,8 / -0,2 Sekunden, was mir absolut ausreicht!
Viele Grüße
Jochen
Mathias Clauszen il y a 3 ans
Mit freundlichen Grüßen
Mathias Claußen
GR CE il y a 3 ans
DateTime now = 0
to
DateTime now = (0, 0, 0, 0, 0, 0);
Mathias_Claussen(Elektor) il y a 3 ans
Best Regards
Mathias Claußen
Sean Slattery il y a 3 ans
I'd like to do this with an Olimex ESP32-POE and not connect to WiFi. I can, but I'd rather broadcast over the wired network...
The firmware compiles if I include ETH.h, but I'm not sure how to or if I should incorporate an ethernet event handler. I'm newish to Arduino and C++, so I am probably mangling some terms...
Thanks!
Mathias_Claussen(Elektor) il y a 3 ans
we don't have an Olimex ESP32-POE arround, so we can't assist in getting Ethernet to work for now with this baord. However an Olimex ESP32 Gateway should be arround here somewehere. If they are similar enough we may can give it a try.
Best Regards
Mathias Claußen
Sean Slattery il y a 3 ans
If I'm reading the source correctly, it looks like starting the WiFi networking goes like this, in pseudo-code:
I was thinking of modifying the firmware so that the network startup flow was more like this:
I'd be a little wet, and duplicate the functions that save and retrieve the IPv4 config for wireless, setting them up to capture and store IPv4 config for wired networking. I cold probably use the same store, but that seems like a janky formula for a nasty collision.
My thought was to set up the board so that that if there's a live wired connection, wifi won't be started. I'm not sure if that's good or bad. For me, that's probably good...
Thanks for responding so quickly. Adventure awaits. :)
Karl-Heinz Lohner il y a 3 ans
in der ESP Klasse gibt es nicht die vorgeschlagenen DT Funktionen.
Hier ist die bentzung des WDT mit der Arduino IDE beschrieben
https://iotassistant.io/esp32/enable-hardware-watchdog-timer-esp32-arduino-ide/
Installiere bitte für die Fehleranalyse den ESP Exception Decoder.
https://github.com/me-no-dev/EspExceptionDecoder
Video dazu:
https://www.youtube.com/watch?v=323CS87h6WU
Viele Grüße
Karl-Heinz
DE521990 (Volker) il y a 3 ans
Danke für den Tip.
Anbei das Ergebnis der Fehleranalyse im Screenshot.
Vielen Dank und liebe Grüße Volker
espexceptiondecoder-ruckmeldung-boardversion-106.jpg (110kb)
Karl-Heinz Lohner il y a 3 ans
Der Fehler passiert beim Empfang eines NTP Request vom Client.
Zum Test habe mal einen Mini NTP Server mit der letzten FW aufgebaut. Die ESP32 Arduino IDE war die 1.0.6.
Mit Windows 10, Ubuntu 20.04, Raspi und zwei ESP32 und ESPEasy FW als NTP Clients sind keine Probleme aufgetreten.
Kannst Du mal einen Test ohne die Tasmota Plugs nur mit einem Linux- oder Windows-Rechner als NTP Client machen?
Wie sieht die Netzwerktopologie aus?
Viele Grüße
Karl-Heinz
Ignaz Lorenz il y a 4 ans
die folgende Fehlermeldung:
ntp_server.cpp:81:1: error: control reaches end of non-void function [-Werror=return-type]
}
Da meine C++ Kenntnisse minimal sind gelingt es mir leider nicht, das Projekt Fehlerfrei zu übersetzen.
Die notwendigen Bibliotheken scheinen alle vorhanden zu sein, und ich verwende die Arduino IDE 1.8.13
Gibt es eine einfache Möglichkeit, diese Fehlerursache zu beheben.
Danke
Mathias Clauszen il y a 4 ans
in der Datei ntp_server.cpp in Zeile 80 folgendes einfügen:
return 0;
Das sollte dann den fehler beheben
Mit freundlichen Grüßen
Mathias Claußen
Ignaz Lorenz il y a 4 ans
Hier habe ich
DateTime now = 0;
ersetzt durch
DateTime now = time(0);
da ich immer den Fehler bekommen habe "int kann nicht in Time umgewandelt werden."
Jetzt geht das Übersetzen fehlerfrei und ich hoffe ich habe das richtig gemacht. Ich werde mit dem Zusammenbau beginnen, und dann einmal testen.
Danke für die tolle Arbeit.
Jeffrey Kashinsky il y a 4 ans
Now I need to learn more about the NTP protocol. I think that I need to dig into ntp_server.cpp to see where to apply my new variable.
Mathias Clauszen il y a 4 ans
Regards
Mathias Claußen
Jeffrey Kashinsky il y a 4 ans
Changed the timer to 1ms. Does not seem to adversely affect overall timing but improves offset.
Needed to multiply the ms value by 4294967 before stuffing it into the fractional seconds field.
So minimal changes to project but major improvement in performance.
Thanks for your help.
Jeff
Mathias Clauszen il y a 4 ans
nice to hear that this will improve performance. May change the timer to count not 1ms pules as the fraction part seems to be 1/(2^32) seconds but use may (1/1024)s pulses as this may save a multiply and can be used directly ( sort of ).
Best Regards
Mathias Claußen
Colin Larsen il y a 4 ans
Colin
Jeffrey Kashinsky il y a 4 ans
I'm still evaluating the effect of my changes. I'm using Meinberg Time Server Monitor to compare various time servers to this project. Documentation is sparse on the meanings of the various data points.
The ones of interest are Delay, Offset, and Jitter. I understand Delay. But I am assuming Offset and Jitter are referenced to the computer's RTC. Lower values are better but what is sufficient? Right now I am seeing;
Server Offset Jitter
ESP32 18.052 19.915
NIST 4.224 1.307
other one 3.022 2.898
Note that the ESP32 offset is down 2 orders of magnitude from where I started.
Here is what I added to the firmware file:
hw_timer_t * timer = NULL;
uint32_t millisec;
in setup():
timer = timerBegin(0, 80, true);
timerAttachInterrupt(timer, &onTimer, true);
timerAlarmWrite(timer, 1000, true);
timerAlarmEnable(timer);
in IRAM_ATTR handlePPSInterrupt():
millisec = 0;
Added Firmware.h file with the line: extern uint32_t millisec;
In ntp_server.cpp:
// ntp_req.rxTm_f = htonl( ntp_req.rxTm_f );
ntp_req.rxTm_f = htonl(millisec * 4294967);
and
// ntp_req.txTm_f = htonl( ntp_req.txTm_f );
ntp_req.txTm_f = htonl(millisec*4294967);
Jeff
Colin Larsen il y a 4 ans
Cheers
Colin
Mathias_Claussen(Elektor) il y a 4 ans
patches have been mered into the current code to be found on Github (https://github.com/ElektorLabs/180662-mini-NTP-ESP32)
Best Regards
Mathias Claußen
Jeffrey Kashinsky il y a 4 ans
I want to use this as a portable NTP server for Ham Radio FT8 protocol.
Thanks for a great project!
Mathias Clauszen il y a 4 ans
haven't seen this problem (yet), but i can be a delay within the processing and display routines. Between timepulse and displayupdate on the oled there may be at least 500ms delay +/- a few ms for the OS overhead and data processing.
Best Regards
Mathias Claußen
Jeffrey Kashinsky il y a 4 ans
I'm using Meinberg's NTP Time Server Monitor to compare the output among internet time servers, a NTP server I built using a Raspberry Pi, and your NTP server design.
All of the other NTP servers currently show an offset of less than 10 ms. Your design is showing an offset of -1.8 seconds.
I'll turn off all of the display updates and see if anything changes.
Mathias_Claussen(Elektor) il y a 4 ans
Best Regards
Mathias Claußen
Karl-Heinz Lohner il y a 4 ans
The Module must have a 3D-Fix for that. You can check this with a Telnet connection the NTP Servers IP Address. You should see sentences like this:
$GPGSA,A,3,28,10,23,24,,,,,,,,,5.12,3.76,3.48*05
The values after $GPGSA are interesting:
GPS DOP and active satellites
An example of the GSA message string is:
$GPGSA,<1>,<2>,<3>,<3>,,,,,<3>,<3>,<3>,<4>,<5>,<6>*<7><CR><LF>
GSA message fields
Field Meaning
0 Message ID $GPGSA
1 Mode 1, M = manual, A = automatic
2 Mode 2, Fix type, 1 = not available, 2 = 2D, 3 = 3D
3 PRN number, 01 through 32 for GPS, 33 through 64 for SBAS, 64+ for GLONASS
4 PDOP: 0.5 through 99.9
5 HDOP: 0.5 through 99.9
6 VDOP: 0.5 through 99.9
7 The checksum data, always begins with *
To get a 3D-Fix 4 satellites in use are required.
To get a description of the NMEA-0183 sentences go to
http://www.nmea.de/nmea0183datensaetze.html
Jeffrey Kashinsky il y a 4 ans
Thanks for the tutorial but I have been working with GPS and GPS sentences for more than 20 years.
Yes the EPS is receiving the PPS signal from the GPS.
Last I checked, I was seeing 5-6 satellites. ( I turned off the telnet code to see if that was affecting the timing).
Jeffrey Kashinsky il y a 4 ans
Now the offset is around 800ms.
In order to decode FT8 time synchronized signals, clocks needs to be within a few tenths of a second or so.
Perhaps using the ESP32 is not the right approach.
Mathias_Claussen(Elektor) il y a 4 ans
The ESP32 has in deed some weak spots when it comes to real time. As the OS and also a few other design choises lead to for the WiFi driver result in delay within the process chain, currently i can be assumed that this will only get close to 500ms +/- . Getting thins even closer to +/-10ms will requiere some changes, may just in the code but may also in the hardware itself.
If there is interrest we can put a proposal into our system to have the project revisited and overhauld for more accuracy with may changed hardware.
Best Regards
Mathias Claußen
Jeffrey Kashinsky il y a 4 ans
I am only looking for +/- 100ms.
I am not very knowledgeable about the NTP protocol but what I think the tool that I am using indicates a 50-100 ms delay between the request and response. If that is correct, the ESP is fast enough.
What seems to me to be the issue is that the reported time has no subsecond information. You wrote: "As the ESP32 only counts seconds we can't fill the factional part with any useful information, so we set this to zero." Based on my review of the DS3231 datasheet appears to be due to the fact that the DS3231 only reports seconds.as do most of the GPS sentences. This would leave the task of subsecond counting to the ESP32.
The $GPZDA sentence includes: hhmmss.ss.
Could this be used when in the "GPS mode" with a modification to the TinyGPS++ library?
I will explore this to see if it is doable.
Thank you again for your help.
Mathias Clauszen il y a 4 ans
for the sub seconds, what could be done is to use one of the 64bit timer inside the ESP32 and run it with a high input clock to get a more or less stable us resolution. The more interresting part will be how long the ISR latency inside the ESP32 will be for the PPS interrupt. Currenlty i calculatie wit at least 300 CPU cycles ( 1.87us ) and the additonal reload time. So i guess we will see 100us delay there if the ISR priority can be set accordingly. May this can get a little less offset and move the offset down below +/- 100ms.
73 and Best Regards
Mathias Claußen
Jeffrey Kashinsky il y a 4 ans
I understand the concept of what you are proposing. However, this is my first ESP32 project. Up to this point I have only dealt with pure Arduino projects.
It will take some learning to successfully implement your concept. Hopefully I am up to the challenge.
Thanks again for your help.
73, Jeff W2UA
Mathias Clauszen il y a 4 ans
the ESP32 is a powerfull device, but real time is something that the ESP32 is not the best in class. I will try to purpose that Elektor may revisit this project and add the sub second part and do some modernizations ( would be a great project for a ESP32-C3 or may a try with a Raspberry Pi Pico )
73, Mathias DK3MC
Jeffrey Kashinsky il y a 4 ans
Jeffrey Kashinsky il y a 4 ans
Colin Larsen il y a 4 ans
The serial output says -
DST Rules Updated:
DST Start: Sun Oct 4 02:00:00 2020
DST End: Sun Mar 15 03:00:00 2020
This should be 2021 for DST end - it cannot end before it begins :)
Also the dates are completely wrong for this year
Daylight saving time 2020 in New Zealand began at 2:00 am onSunday, 27 Septemberand ends at 3:00 am onSunday, 4 April 2021
Regards
Colin Larsen il y a 4 ans
DST Rules Updated:
DST Start: Sun Sep 27 02:00:00 2020
DST End: Sun Apr 5 03:00:00 2020
Presumably the code used assumes the DLS both starts and finishes in the same year - which it does not for those of us in the Southern hemisphere :)
Mathias Clauszen il y a 4 ans
have not tried the New Zeland rules for DST here but i try to look into it. I will collect the bug for the next few weeks and start fixing them. There seems also to be a one second offset problem.
Best Regards
Mathias Claußen
techno_96 il y a 4 ans
is it possible to use it with ESP8266 ? instead of ESP32
I need local NTP server functionality only , don't want to use oled screen and GPS module
Mathias Clauszen il y a 4 ans
the ESP8266 need lots of code changes as all RTOS parts needs to be done in an other way or removed. If you don't need the OLED at all, may consoder an ESP32-PICO-D4 that will also work fine after some pin alterations. NTP Sync as Master is currenlty not included in the source. This may added in a future relaeas, the code itself is prepared for this option.
Best Regards
Mathias Claußen
D Dub il y a 4 ans
Since a lot of my projects involve MQTT, I was going to add support for that. After taking a look at the index html, I noticed you had already implemented some functions for that, but no form as of yet. Is this something that you will be adding in the future or was this a scrapped idea? If it's something you are working on adding, I will just wait for that release instead of deviating too far from your code.
Thanks again!!
Mathias Clauszen il y a 4 ans
the code shares a lot in common with other elektor projects and also some MQTT leftover parts.
For the NTP it was never thought to have MQTT arround as there was no need to generate some sorts of messages. Its base function is still to provide time in the first place. It might be an idea to add MQTT for the GPS details, like satelites in view , signal strenght, some things like this, but it has no top priority right now. If you have something that you like to get transmitted or received via MQTT than leave a comment or use the issues tracker on GitHub for new feature requests ( https://github.com/ElektorLabs/180662-mini-NTP-ESP32/issues ). Also it would be nice if those of you who have build such a device may share some images with us.
Best Regards
Mathias Claußen
mickmoane il y a 4 ans
Regards
Mick
ElektorLabs il y a 4 ans
in the Firmware.ino the Function / Task "void Display_Task( void* param )" will do all the drawing on the OLED. If you like to change the display that is the Task where you need to put your code. You'll also need to remove any renaming includes and initialization for the OLED.
Best Regards
ElektorLabs
cheaptrick il y a 4 ans
Hi guys I am struggling with access to web page to do setup, connected to AP and goto 192.168.4.1 and I get The requested file doesn't exist
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5816
entry 0x400806ac
E (47) SPIFFS: mount failed, -10025
Read Timecore Config
Copy Conf to MEM
Booting...
Init WiFi
WiFi: AP
Configuring AP: Elektor NTP Server
AP IP: 0.0.0.0
mDNS responder started
Webserver started
I2C RTC at 0x68 foundRead RTC Time:1586266174
Switch to PPS
DST Rules Updated:
DST Start: Sun Mar 29 01:00:00 2020
DST End: Sun Oct 25 02:00:00 2020
Update Time from GPS
Date is: 20/4/7 at 13:29:35
Update RTC
dhcps: send_offer>>udp_sendto result 0
Got request for: /
Content type: text/html
File '/index.html' doesn't exist
Thank uou kindly in advance
cheaptrick il y a 4 ans
Welo il y a 4 ans
sorry my english is not good, but i try. i had a problem with uploading the webpage with Arduino IDE version 1.8.12, ESP32 Sketch Data Upload Tool. There was a error "esptool not found". After long searching for bug i tryed with Arduino IDE version 1.8.5. I could upload the webpage without error. My "Mini NTP Server" works very good. Perhaps this can help you.
Best regards
WeLo
cheaptrick il y a 4 ans
Mathias Clauszen il y a 4 ans
please be sure that beside the firmware, you also uploaded the webpages with teh ESP32 Sketch Data Upload Tool. At this point you should be able to access the webpages
Best Regards
Mathias
Welo il y a 5 ans
Kann mir jemand helfen?
WeLo
Welo il y a 5 ans
ich bin ganz happy, es hat funkioniert, nachdem ich die zip-Datei nochmal heruntergeladen habe und die alten Dateien gelöscht habe. Jetzt hab ich den Code auf den ESP32 heruntergeladen und habe dieses Bild. Ganz fertig bin ich noch nicht, ich muss noch die webseite installieren damit ich die Uhr stellen kann. Das GPS-Modul ist zur Zeit nicht lieferbar, ich denke dass ich das Teil so lange auch ohne GPS betreiben kann.
Vielen Dank nochmal!
Mit freundlichen Grüßen
Welo
Mathias Clauszen il y a 5 ans
die network.ino darf nicht im ordner drinne sein da in der network.cpp und network.h der code aus der network.ino enthalten sind und dort der code auch ein paar kleine modifikationen bekommen hat.
Der Compiler mekert da er in er in der network.ino funktionen gefunden hat die in der network.h schon deklariert wurden. Ich habe kurz noch mal von GitHub das Zip herunter geladen, dort ist die network.ino nicht drinne zu finden.
Mit freundlichen Grüßen
CalM
Welo il y a 5 ans
vielen Dank für deine Antwort!
Genau diesen Code habe ich bereits verwendet und auch die network.ino scheint korrekt vorhanden zu sein. Ich hab mal noch ein etwas größeres Bild gemacht.
Mit freundlichen Grüßen
Welo
Mathias Clauszen il y a 5 ans
Hallo Welo,
anscheinend ist beim erstellen des Zip die network.ino noch im Archiv geblieben.
Bitte versuch einmal den Code von https://github.com/ElektorLabs/180662-mini-NTP-ESP32/archive/master.zip zu übersetzen.
Mit freundlichen Grüßen
CalM
techno_96 il y a 5 ans
How about adding delay or allow entering specific time in web-UI to control GPS time update ?
also adding number of satellite available and GPS/RTC is connected to system or not in web-UI ?
it will be useful for people who are using it without display
techno_96 il y a 5 ans
if we already have RTC connected and its serving time then what's the point of keep writing time at every second to RTC from GPS , add a specific time eg 1-10 min option to keep it accurate
yes add available satellite info too
Thank you
Mathias Clauszen il y a 5 ans
yes, this could be added, but i guess needs to be done in the sparetime, so please don't expect it to take some time. About the sync delay or manual sync time, can you please specify a bit more what you like? Is it once at a given time or why you liek to have a delay inside ?
About the Display as mentioned a bit earlyer the next step will be to get the content of both screens shown in the web-UI.
Regards
CalM
superd il y a 5 ans
I have found your project very interesting for my purposes - thank you for sharing it!
I have very similar setup to the described and some things work, some doesnt :-|
RTC module, gps module, oled module do work properly along with web access - seems that time is properly maintained / updated.
Two things do not work:
1. as I have only one oled module I have altered the code (using comments) so it does not switch oleds left / right (I am defaulting to right). The issue is that oled only displays the "gauge" icon. Seems that "if( xSemaphoreTake( xSemaphore, portMAX_DELAY ) == pdTRUE )" is never entered.
2. NTP server is not responding - while using ntpdate on a linux machine I am getting:
# ntpdate 192.168.233.232
6 Feb 09:54:02 ntpdate[7085]: no server suitable for synchronization found
Any hints will be appreciated.
superd il y a 5 ans
During my "assembly" I also changed i2c pins to 21 and 22 (also adjusted in the code accordingly) and that I believe was the root cause of the problem. Using code from git AND going back to 4, 5 pins for i2c communication did the trick.
Not sure why the whole setup misbehaved with 21, 22 - even though i2c communication (oled, rtc) seemed to work ok.
Thank you one more time for your effort and prompt help!
Mathias Clauszen il y a 5 ans
Hello superd,
please be aware that currently the code on github is way ahaed of the code posted here.Thanks to the volunteres some things have fixed, specally the sync problem on linux and windows machines.
Please get the code from https://github.com/ElektorLabs/180662-mini-NTP-ESP32, this shoudl solve your problem and allows during runtime to switch the display with the boot pin on the esp32.
Also there is no need to comment on module out, the code will work with only one disply fine and you can switch the content.
Regards
Mathias
HaSch il y a 5 ans
How can it be fixed?
HaSch il y a 5 ans
my hardware is as you described in Elektor Magazine:
WEMOS Lolin32 with OLED, OpenSmart GPS module and DS3231 RTC.
Meanwhile, I found the solution: The antenna coming with OpenSmart from Elektor shop has a really bad quality. The signal is too weak to get good performance. Alternative, I tested with an outdoor antenna usually used in cars and it's much better. I got a 3D fix in a few minutes even indoors near the window. That's much better! One of the Elektor delivered antennas even had a shortcut that destroyed one of my GPS modules!
Best regards,
Hans
Mathias Clauszen il y a 5 ans
can you plese give a short description of the hardware you use, or may attach some images of the build so may some speculative guesses can be made of what is going wrong with the hardware. Also please give some hinds what kind of power supply you are using as may some HF noide can cupple into the GPS module and make it some sort of deaf to any kind of recepton.
Best regards
CalM
HaSch il y a 5 ans
the Telnetserver is working great! I tested it and got data in u-center.
Unfortunately, I am not able to get a GPS fix and I don't know the reason.
Best regards,
Hans
Mathias Clauszen il y a 5 ans
a short descrition after few more test will follow. Basically this will allow the use of : https://www.u-blox.com/en/product/u-center with the GPS-NTP, so you also can use it as GPS device for other applications you may like to use. A Description will follow and hopyfuly some folks at elektor can also take a look at it.
Best Regards
CalM
HaSch il y a 5 ans
I can confirm, the webserver works! Even the setting of static IPv4 is working. I have not tested the Telnetserver because I don't know how to do. Maybe, you can do a short description.
Regards,
Hans
Mathias Clauszen il y a 5 ans
i out the code on a pico-d4 and put the init for the Telnetserver to the correct place. Also i needed to move some code for the AP mode around, as with every new Ardino ESP32 core there seems to be new thinks "working different". It is booting now and seems to operate fine.
On my ToDo till the Embedded :
- Add QTH locator
- Maked the oled display content visible on the Webinterface
But first is to get the Fimrware working as expected
Regards
CalM
HaSch il y a 5 ans
HaSch il y a 5 ans
yes, the code is compiling but I'm not able to get the server work. After uploading it boots several times and after time screen appearing it isn't accessible. It doesn't switch on it's AP but appears in my network with the same IP address it had before. Trying to access the webserver fails.
I even uploaded the data but tried with mine, too. After uploading my V1.2 it works well.
Something must be wrong with your code. If you are in or around Aachen I can borrow you my hardware to make debugging easier.
Best regards,
Hans
Mathias Clauszen il y a 5 ans
i'll try to fix this during the weekend, seems like some changes made for the telnetserver were not that good at all.
The code istself is updated and now compiles, du to some missing hardwareparts it is currently not tested.
Best Regards
CalM
HaSch il y a 5 ans
after you corrected the 2 typos, I get other errors:
line 176: 'initWiFi' was not declared in this scope
initWiFi();
line 197: 'RTC_ReadUnixTimeStamp' was not declared in this scope
I2C_DS3231.ReadTime=RTC_ReadUnixTimeStamp;
line 198: 'RTC_WriteUnixTimestamp' was not declared in this scope
I2C_DS3231.WriteTime=RTC_WriteUnixTimestamp;
line 345: 'i' was not declared in this scope
for(i = 0; i < MAX_SRV_CLIENTS; i++){
line 357: 'i' was not declared in this scope
if (i >= MAX_SRV_CLIENTS) {
line 363: 'i' was not declared in this scope
for(i = 0; i < MAX_SRV_CLIENTS; i++){
line 393: array must be initialized with a brace-enclosed initializer
uint8_t sbuf[1]=Data;
line 395: 'i' was not declared in this scope
for(i = 0; i < MAX_SRV_CLIENTS; i++){
line 403: expected declaration before '}' token
}
Maybe it's not as dramatic as it looks like and you only need to do a few changes.
Best regards,
Hans
Mathias Clauszen il y a 5 ans
tanks for the reply, i'll fix the code in the repository and submitt it back to Elektor. Thanks for testing this and the kindly bug report and fix.
For the Firmware.ino i'll have a look, seems like i removed a function prototype
Best Regrads
CalM
HaSch il y a 5 ans
Best regards,
Hans Now, I can set time using Safari on my iPhone without the need of modifying the main sketch Firmware.ino.
HaSch il y a 5 ans
Mathias Clauszen il y a 5 ans
i guess they reffered to the current github version of the code. Line 882 : https://github.com/ElektorLabs/180662-mini-NTP-ESP32/blob/master/Firmware/data/index.html shows that value is grabbed and moved to var t. There is the string of the current time, expected to be something like 12:03:05 , in case of some divices it is only 12:03 so there needs the string to be checked and extended with :00 . The code itself is patched at https://github.com/calm4git/180662-mini-NTP-ESP32. As i currently have no acces to sutable hardware i need to wait till someone from the Elektor Labs team will merge the code changes back to their repository.
USE AT OWN RISK:
Also note, if you have the GPS Module from the elektor shop you can attach the usb port of it to a laptop, this will power the ntp server and the gps moduel but will also bring up a serial port ( i guess it will tell you it is a U-Blox NEO-6M ) and use the U-Blox Center to grab the comlpete status and tracked satelites from it. This should show why you are not getting a fix.
Regards
Mathias
HaSch il y a 5 ans
ElektorLabs il y a 5 ans
yes this can be fixed, but as the year will end soon this won't happen in this year.
The fix will be included in the webpage to expand the time string on devices that need special treatment. In the Index.html at line 882 there will be the time read and prepared for transmission. A few lines of added javascript may do the trick.
Best Regards
Elektor Labs
HaSch il y a 5 ans
HaSch il y a 5 ans
yes, it are Elektor modules and I already contacted them.
The NTP server worked well at home (Belgium). In southern hemisphere I wasn‘t able to get a fix. That was the reason for thinking of a problem in southern hemisphere. Back home, I could even get no fix and I recognized that the module was faulty.
I hope Elektor will change the module.
Best regards,
Hans
Mathias Clauszen il y a 5 ans
if this are Elekor modules, i would kindly ask you to contact custommer service, as may the batch of gps modules needs to be checked. Dose this fault only apply if you are in the southern hemisphere ?
Best Regards
CalM
HaSch il y a 5 ans
HaSch il y a 5 ans
HaSch il y a 5 ans
HaSch il y a 5 ans
Best regards,
Hans
Mathias Clauszen il y a 5 ans
for the Enclosure you can use : https://www.thingiverse.com/thing:2542321
Regards
CalM
Tapetenhobel il y a 5 ans
Ich hab letzte woche mein neues GPS Modul bekommen, weil das von Adafruit nicht zur mitarbeit zu ueberreden war. Es tut aber an nem RPI 3 in verbindung mit NTP 1a.
Nachdem ich meine Umgebung neu eingerichtet hab (neues Notebook) habe ich mit der ESP32 Version 1.0.2 und Websocket 2.1.14 kompiliert, auf das Modul gebrannt und kurz darauf passierte: nix
Noch Kontrolle hab ich die Pins im source geaendert und danach bekam ich auch hier auf der Couch nen Fix, schnell im Webserver die Zeitzone und Wifi eingestellt, per DHCP ne feste IP vergeben und abfahrt: Schaltet sofort auf PPS um, display zeigt aktuelle Zeit, alles gut. Bis auf der minuetliche reboot.. Also Versionen auf 1.0.1 und 2.1.11 geandert und danach lief auch alles ohne probleme, bis auf das mein NTP server und ntpdate den nicht moegen:
Log vom ESP: und NTP / ntpdate: Idee?
Gruss
Matthias
Karl-Heinz Lohner il y a 5 ans
mit meiner Entwicklungsumgebung:
180622_1_1-11.zip
Arduino IDE 1.8.10
Arduino-esp32 1.0.4
crashed det ESP32 während "packet.write" mit einer assertion:
Switch to PPS
Update RTC
Timestamp is 1571554227
Timestamp is 1571554227
assertion "pbuf_free: p->ref > 0" failed: file "/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/lwip/src/core/pbuf.c", line 765, function: pbuf_free
abort() was called at PC 0x400ed617 on core 1
Backtrace: 0x4008d008:0x3ffcf630 0x4008d239:0x3ffcf650 0x400ed617:0x3ffcf670 0x4010f0ab:0x3ffcf6a0 0x400df8d7:0x3ffcf6c0 0x400df927:0x3ffcf750 0x40088f81:0x3ffcf780
Rebooting...
ets Jun 8 2016 00:22:57
Dies kann durch die Änderung:
udp.onPacket([](AsyncUDPPacket packet) {
in
udp.onPacket([](AsyncUDPPacket& packet) {
behoben werden.
Leider akzeptiert der ntpdate meines 18.04.3 LTS (Bionic Beaver) den ESP32-NTP
nicht als NTP Source:
ntpdate[4691]: no server suitable for synchronization found
Hier ein Auszug vom tcpdump:
Ubintu: *.130, NTP: *.199
14:26:41.437389 IP (tos 0x0, ttl 64, id 49538, offset 0, flags [DF], proto UDP (17), length 76)
192.168.2.130.123 > 192.168.2.199.123: [bad udp cksum 0x86e3 -> 0x2604!] NTPv4, length 48
Client, Leap indicator: clock unsynchronized (192), Stratum 0 (unspecified), poll 3 (8s), precision -6
Root Delay: 1.000000, Root dispersion: 1.000000, Reference-ID: (unspec)
Reference Timestamp: 0.000000000
Originator Timestamp: 0.000000000
Receive Timestamp: 0.000000000
Transmit Timestamp: 3780649601.437255331 (2019/10/21 14:26:41)
Originator - Receive Timestamp: 0.000000000
Originator - Transmit Timestamp: 3780649601.437255331 (2019/10/21 14:26:41)
14:26:41.498058 IP (tos 0x0, ttl 255, id 94, offset 0, flags [none], proto UDP (17), length 76)
192.168.2.199.123 > 192.168.2.130.123: [udp sum ok] NTPv4, length 48
Server, Leap indicator: (0), Stratum 1 (primary reference), poll 3 (8s), precision 0
Root Delay: 0.000015, Root dispersion: 0.000015, Reference-ID: PPS^@
Reference Timestamp: 2208988800.000000000 (1970/01/01 01:00:00)
Originator Timestamp: 0.000000000
Receive Timestamp: 3780649602.000000000 (2019/10/21 14:26:42)
Transmit Timestamp: 3780649602.000000000 (2019/10/21 14:26:42)
Originator - Receive Timestamp: 3780649602.000000000 (2019/10/21 14:26:42)
Originator - Transmit Timestamp: 3780649602.000000000 (2019/10/21 14:26:42)
Sind Reference Timestamp, Originator Timestamp und Originator - Receive Timestamp,
Originator - Transmit Timestamp
wirklich OK?
Die BAD Checksum vom Ubuntu scheint nicht zu stören. Da meine FB als NTP Server akzeptiert wird.
Karl-Heinz
Tapetenhobel il y a 5 ans
Matthias
ElektorLabs il y a 5 ans
after a short run with wireshark we can confirm that there seems to be a problem. The request send isn't answared by the NTP, we need to further investigate if the message is nor received or the packet send back is lost somewhere in the network. This means some debugging and releasing a fixed firmware. Currently this can take a while as we are also working on a few other projekts.
Best regards
ElektorLabs
Peter Tschulik il y a 5 ans
Peter Tschulik il y a 5 ans
danke für die rasche Information und Bereitstellung auf Github. Habe 1.2 installiert und konnte mit Windows 10 die Zeit synchronisieren. Zumindestens haben Sie dann einen erfolgreichen Tester!
Peter TSCHULIK
ElektorLabs il y a 5 ans
leider sind gerade noch andere Projekte vor den Patch gerückt, sowie gerade die Productronica 2019 in München, daher sind wir noch nicht dazu gekommen den Patch in die aktuelle Software zu übernehmen. Aus den zwei bis drei Tagen die Mathias Clauszen geschätzt hat für die Umsetzung, sind daher leider ein paar Wochen geworden. Es ist auf GitHub der Code der Version 1.2 hochgeladen ( https://github.com/ElektorLabs/180662-mini-NTP-ESP32 ), dieser ist aber noch nicht komplett getestet.
Mit freundlichen Grüßen
Elektor Labs
Peter Tschulik il y a 5 ans
ich bin ein wenig verwirrt! Habe heute das Board auf die Version 1.1. geflasht. Die Vergabe der statischen IP Adresse funktionier 1A.
Aber der NTP Server funktioniert mit Windows 10 nicht. Ich ahbe die statische IP-Adresse 192.168.123.232 vergeben. Wenn ich diese als Windows NTP Server angebe bekomme ich die Fehlermeldung "Bei der Synchronisation mit 192.168.123.232 ist ein Fehler aufgetreten!
Mir ist nun nicht klar, ob der oben beschriebene Fehler von Karl-Heinz Lohner schuld daran ist und dieser in Version 1.1 behoben ist oder nicht. Wenn nein wie ist der Satz von Mathias Clauszen " Danke für das debuggen und die Fehlerkorrekur. Ich denke das in den nächtsen zwei Tagen dann auch die Software mit den änderungen als Zip bereit steht und das Git Repository angepasst ist. " zu verstehen
Danke
Peter TSCHULIK
Tapetenhobel il y a 5 ans
danke fuer den patch, mein NTP funktioniert damit 1a:
Matthias
Mathias Clauszen il y a 5 ans
Danke für das debuggen und die Fehlerkorrekur. Ich denke das in den nächtsen zwei Tagen dann auch die Software mit den änderungen als Zip bereit steht und das Git Repository angepasst ist.
Mit freundlichen Grüßen
Mathias
Karl-Heinz Lohner il y a 5 ans
nach ein parr Änderungen funktionert der mini-ESP32-NTP.
UBuntu und Windows 7 akzepieren den NTP Server.
Der diff mit meinen Änderungen.
-------------------------------------
--- ntp_server.cpp.orig 2019-10-22 12:36:38.722558078 +0200
+++ ntp_server.cpp 2019-10-22 15:06:01.305285383 +0200
@@ -86,7 +86,7 @@
if(udp.listen(port)) {
started=true;
- udp.onPacket([](AsyncUDPPacket packet) {
+ udp.onPacket([](AsyncUDPPacket& packet) {
uint32_t processing_start = 0;
ntp_packet_t ntp_req;
@@ -111,8 +111,8 @@
ntp_req.refTm_s = ntohl(ntp_req.refTm_s );
ntp_req.refTm_f = ntohl(ntp_req.refTm_f );
- ntp_req.origTm_s = ntohl( ntp_req.origTm_s );
- ntp_req.origTm_f = ntohl( ntp_req.origTm_f );
+ ntp_req.origTm_s = ntohl( ntp_req.txTm_s );
+ ntp_req.origTm_f = ntohl( ntp_req.txTm_f );
ntp_req.rxTm_s = ntohl( ntp_req.rxTm_s );
@@ -136,7 +136,8 @@
ntp_req.rxTm_s= processing_start;
ntp_req.rxTm_f= 0;
/* UNIX Start is 1.1.1970 and GPS Start is 1.1.1900 */
- ntp_req.refTm_s= ntp_req.refTm_s + NTP_TIMESTAMP_DELTA; // We need to add 70 Years
+ // ntp_req.refTm_s= ntp_req.refTm_s + NTP_TIMESTAMP_DELTA; // We need to add 70 Years
+ ntp_req.refTm_s = processing_start;
ntp_req.refTm_f = 0;
ntp_req.txTm_s = fnc_read_utc()+NTP_TIMESTAMP_DELTA;
----------------------------------
Karl-Heinz
Tcpdump Mitschnitt wenn ntp-server.cpp gepatcht ist. (6kb)
ElektorLabs il y a 5 ans
attached an image showing two displays, the one on the right is is set to a different address, so you will get both dispaly to show different content.
Best regards
ElektorLabs
Peter Tschulik il y a 5 ans
GR CE il y a 5 ans
Grüsse
Claus
Tapetenhobel il y a 5 ans
Ich hab mich heute mal dran gesetzt und meinem Raspberry das GPS modul geklaut. Alles auf nem Breadboard verhaekelt (normaler ESP32) und kompiliert.
Nachdem ich dann zuerst den Fehler -10025 beim mounten vom SPIFS beseitigt hatte, haenge ich jetzt immer noch daran fest das die index.html nicht gefunden wird:
Verwendet wird die version 1.0.1 der ESP32 Umgebung. Den Code hab ich per git gezogen und die index.html liegt auch brav unterhalb ./data.
Ich hab so langsam keine Idee mehr :)
Danke
Matthias
Tapetenhobel il y a 5 ans
ja, das hab ich heute morgen auch gefunden, aber nach nen paar Stunden Fehlersuche ist es dann nicht mehr so einfach.
Webserver funktioniert, nur spuckt mein GPS Modul nix aus, aber das lässt sich mit nem anderen beheben ;)
danke
Matthias
Mathias Clauszen il y a 5 ans
bitte stelle sicher das auch der Web-Content mit dem ESP32-Upload Tool in den ESP32 geflasht wurden. Dann sollte auch der Fehler verschwinden.
Mfg
Mathias
Peter Tschulik il y a 5 ans
Leoder ist diese zwar leicht nachzubauen, die SW ist aber leider nicht so einfach zu kompilieren. Obwohl ich wie angegeben alle Libraries eingebunden habe (Links zu den Libraries wären sehr hilfreich) hat eine weitere Library gefehlt, die nicht angegeben war. Und zwar jene für den Websockerserver: Mit der aktuellen Version 2.1.4 des Websocketserver lässt sich das Projekt ebenfalls nicht kompilieren, es gibt Fehlermeldungen! Erst die Installation der älteren Version 2.1.1 brachte den Erfolg:
Hier die Links zu den Libraries um Zeit zu sparen:
* U8G2 by oliver: https://www.arduinolibraries.info/libraries/u8g2
* Time by Michael Magolis: https://www.arduinolibraries.info/libraries/time
* Ticker by Bert Melis: https://github.com/bertmelis/Ticker-esp32
* TinyGPS++ ( https://github.com/mikalhart/TinyGPSPlus )
* RTCLib by Adafruit: https://github.com/adafruit/RTClib
* ArduinoJson 6.10.0: https://www.arduinolibraries.info/libraries/arduino-json
* CRC32 by Christopher Baker: https://github.com/bakercp/CRC32
* Websocketserver2.1.1: https://www.arduinolibraries.info/libraries/web-sockets
Ein Wunsch bleibt übrig: Es wäre schön, wenn man eine fixe IP-Adresse vergeben könnte. Gerade ein NTP-Server sollte nicht von einer dynamischen IP-Adresse auffindbar sein, sondern immer unter einer fixen Adresse
Aber wie gesagt sonst ein tolles Projekt. Habe auch das zweite Display zum Laufen bekommen
Peter Tschulik il y a 5 ans
danke für die rasche Antwort! Freue mich schon auf ein Update
Peter
Mathias Clauszen il y a 5 ans
der Websocketserver wird wohl in einem kommenden Update entfernt, da er aktuell keinen Mehrwert bietet. Für die Statische IP lässt sich sicher ein Update erstellen, das kann aber aktuell einen Moment länger dauern. Ich hoffe das dieses Feature dann auch in die Wettertstation zurück portiert wird :-)
mfg
Mathias
GR CE il y a 5 ans
Problem bei mir: Wenn ein Client den ntp-server anfragt, dann bootet der ESP32 mehrmals. Ist das gewollt ?
Grüsse
Claus
GR CE il y a 5 ans
mit der Version 1.01 funktioniert der Server.
Grüsse
Claus
Mathias Clauszen il y a 5 ans
falls du für den ESP32 die Version 1.0.2 des Board support package verwendet, mach bitte erst einal ein downgrade auf 1.0.1 und versuche die Firmware neu zu erstellen. Es scheint da einen Bug im IDF zu geben: https://github.com/espressif/arduino-esp32/issues/2685
Bitte auch den Anhang wieder löschen, da sind Daten drinne die nicht in Netz solten :-)
Mfg
Mathias
ElektorLabs il y a 5 ans
nein ein reboot bime anfragen der Zeit ist nicht gewollt und sollte auch nicht vorkommen.
Schön wäre es den putput der sieriellen schnittstellen als log zu erhalten. Damit könnte der Fehler dann etwas eingeschränk werden. Auch wäre es hier schon zu erfahren mit welchen Komponenten der NTP Server gebaut wurde, da die Software recht flexibiel ist was die Hardware angeht.
Mit freundlichen Grüßen
ElektorLabs
DE521990 (Volker) il y a 3 ans
ich habe das Projekt jetzt auch einmal begonnen. Ich habe wenig Erfahrung mit der ganzen Sache. Ich bräuchte nur einen kleinen NTP-Server für meine Tasmota-Steckdosen. Auch ich habe das Problem wie Claus. Sobald ich auf die NTP-IP zugreife rebootet der ESP32. Ich habe das Elektor Board mit Display sowie andere ESP32 Boards getestet. Bei allen das gleiche Problem. Die Firmware ist die aktuelle 1.5. Die Board-Varianten habe ich auch alle getestet (1.0.0 bis 1.0.6) Die Software mit GPS, RTC, OLED und Weboberfläche läuft ansonsten tadellos bei mir. Nur halt kein NTP. Und darum geht es ja bei der Sache. Vielleicht ist das Problem ja noch bekannt und jemand von Euch kann mir weiter helfen. Danke und viele Grüße Volker
Mathias_Claussen(Elektor) il y a 3 ans
das Probelm ist so noch nicht bekannt. Gibt es eine möglichkeit den Text der bei dem Reboot erscheint einmal in einem Seriellen Terminal mitzuschneiden, also die Textausgabe des ganzen?
Mit frendlichen Grüßen
Mathias Claußen
DE521990 (Volker) il y a 3 ans
Danke für die schnelle Antwort.
Anbei einmal die Infos aus dem Seriellen Terminal beim Zugriff auf den NTP-Server.
22:36:30.565 -> Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled.
22:36:30.565 -> Core 1 register dump:
22:36:30.565 -> PC : 0x00000000 PS : 0x00060430 A0 : 0x800dfcd5 A1 : 0x3ffd3570
22:36:30.565 -> A2 : 0x3ffc1c40 A3 : 0x3ffd3634 A4 : 0x3ffba838 A5 : 0x3ffc6b4c
22:36:30.565 -> A6 : 0x0000c1ed A7 : 0x3ffba838 A8 : 0x800d3ada A9 : 0x3ffd3550
22:36:30.565 -> A10 : 0x00000000 A11 : 0x3ffd3634 A12 : 0x3ffd3e94 A13 : 0x0000c1ed
22:36:30.610 -> A14 : 0x4d4bbf25 A15 : 0x00000000 SAR : 0x00000000 EXCCAUSE: 0x00000014
22:36:30.610 -> EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff
22:36:30.610 ->
22:36:30.610 -> ELF file SHA256: 0000000000000000
22:36:30.610 ->
22:36:30.610 -> Backtrace: 0x00000000:0x3ffd3570 0x400dfcd2:0x3ffd3620 0x400dfd33:0x3ffd36b0 0x4008a6b2:0x3ffd36e0
22:36:30.610 ->
22:36:30.610 -> Rebooting...
22:36:30.610 -> ets Jul 29 2019 12:21:46
22:36:30.610 ->
22:36:30.610 -> rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
22:36:30.610 -> configsip: 0, SPIWP:0xee
22:36:30.610 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
22:36:30.657 -> mode:DIO, clock div:1
22:36:30.657 -> load:0x3fff0018,len:4
22:36:30.657 -> load:0x3fff001c,len:1044
22:36:30.657 -> load:0x40078000,len:10124
22:36:30.657 -> load:0x40080400,len:5856
22:36:30.657 -> entry 0x400806a8
22:36:31.073 -> Read Timecore Config
22:36:31.073 -> Copy Conf to MEM
22:36:31.073 -> Booting...
22:36:33.600 -> Init WiFi
22:36:33.600 -> WiFi: STA
22:36:33.694 -> Attempting to connect to LB-TEC SP Pro 2.4, pass: xxxxxx
22:36:33.694 -> ...
22:36:36.708 -> Connected to LB-TEC SP Pro 2.4
22:36:36.708 -> Local IP: 192.168.2.140
22:36:36.708 -> Webserver started
22:36:36.708 -> I2C RTC at 0x68 foundRead RTC Time:1621370193
22:36:36.756 ->
22:36:36.756 -> DST Rules Updated:
22:36:36.756 -> DST Start: Sun Mar 28 01:00:00 2021
22:36:36.756 -> DST End: Sun Oct 31 02:00:00 2021
22:36:36.756 ->
22:36:36.895 -> Switch to PPS
22:36:37.180 -> Update Time from GPS
22:36:37.180 -> Date is: 21/5/18 at 20:36:34
22:36:37.180 -> Update RTC
Danke und viele Grüße Volker
Mathias_Claussen(Elektor) il y a 3 ans
>> 22:36:30.565 -> Guru Meditation Error: Core 1 panic'ed
>> (InstrFetchProhibited). Exception was unhandled.
Leider kann ich ohne ELF Datei aus dem CoreDump nicht ersteh an welche steller der Absturz erfolgt.
Ich muss nochmal den Code mit den aktuelle Tools übersetzen und sehen aus welchem Teil der Abhängigkeiten der Absturz kommt. Ich bitte daher um etwas gedult. Es ist immer erstaunlich wie Code der einst zu einem Laufenden binary führt schalgartig einen Bug aufzeigt :-)
Mit freundlichen Grüßen
Mathias Claußen
schnarz il y a 3 ans
ich habe das gleiche Problem. Hardware ist Lolin ESP32 OLED, OPEN SMART GPS und DS3231 RTC Modul für Raspberry Pi. Arduino IDE 1.8.15, Aktuelle Librarys (Stand 21.07.2021) und ESP32 1.0.6.
Display und GPS funktionieren super, aber bei einer NTP-Anfrage (mit ntpquery von einem Win10-PC) stürzt der ESP ab.
Hier die Logs im AP mode, gleiches verhalten im "normal mode"
Exception Decoder:
Gesamter Log:
Wäre super, wenn es dafür eine Lösung gibt.
Viele Grüße
Jochen
Mathias Clauszen il y a 3 ans
es gab einen NULL Pointer in einem Funktionsaufruf, der ist behoben Version 1.6 sollte morgen gemerged werden.
Mit freundlichen Grüßen
Mathias Claußen
Mathias Clauszen il y a 3 ans
Version 1.6 ist Verfügbar und behebt einen NULL Ponter Bug der den Absturz verursacht hat. Die Version wird morgen im laufe des Tages auf GitHub zu finden sein, ein Pull Request ist schon gesetzt.
Mit freundlichen Grüßen
Mathias Claußen
HaSch il y a 3 ans
das könnte der Watchdog-Timer sein, der da zuschlägt. Bitte mal versuchsweise füttern:
Als erste Zeilen in die loop-Schleife einsetzen:
Eventuell auch noch als letzte Zeile ins setup:
Gruß
Hans
DE521990 (Volker) il y a 3 ans
HaSch il y a 3 ans
wie sieht die Fehlermeldung denn aus?
Gruß
Hans
DE521990 (Volker) il y a 3 ans
setup.jpg (95kb)
fehlermeldung.jpg (65kb)
HaSch il y a 3 ans