[discontinued] Need help for a clock with Parola Double Height

There is very little in the code you pointed me to (2 functions), so I would guess that including the matrix should be a straightforward job.

Thanks, I'll try it. My only problem is that in my sketch the DS3231 is used and in the Parola Sketch the DS1307

Those 2 clock modules are interchangeable for the basic RTC function.

DS3231 has built-in alarms that are not in the other. If you are worried get the DS3231 library from my libraries repo. Function calls are the same so it should be a drop in replacement with minimal changes.

You mean the MD DS3231.h instead of the MD DS1307.h?
So i have changed the DS1307 to MD_DS3231

and become this error:
Arduino: 1.8.5 Hourly Build 2017/08/28 06:12 (Mac OS X), Board: “NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (3M SPIFFS)”

Build-Optionen wurden verändert, alles wird neu kompiliert
Archiving built core (caching) in: /var/folders/l9/27pqv_zs4zd0xmpx_03blk_m0000gn/T/arduino_cache_641022/core/core_esp8266_esp8266_nodemcuv2_CpuFrequency_80,UploadSpeed_115200,FlashSize_4M3M_e66f26f0b9de883465923b4da1419c23.a
libraries/MD_DS3231-master/MD_DS3231.cpp.o:(.bss.bufRTC+0x0): multiple definition of bufRTC' libraries/MD_Parola-master/MD_DS1307.cpp.o:(.bss.bufRTC+0x0): first defined here libraries/MD_DS3231-master/MD_DS3231.cpp.o:(.bss.RTC+0x0): multiple definition of RTC’
libraries/MD_Parola-master/MD_DS1307.cpp.o:(.bss.RTC+0x0): first defined here
/Users/robi/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld: Warning: size of symbol `RTC’ changed from 10 in libraries/MD_Parola-master/MD_DS1307.cpp.o to 24 in libraries/MD_DS3231-master/MD_DS3231.cpp.o
collect2: error: ld returned 1 exit status
exit status 1
Fehler beim Kompilieren für das Board NodeMCU 1.0 (ESP-12E Module).

The Sketch:

/ Use the DS3231 clock module
#define  USE_DS3231  1

// Header file includes
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#include "Font_Data.h"

#if USE_GENERIC_HW || USE_PAROLA_HW
#define INVERT_UPPER_ZONE
#endif

// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define MAX_ZONES 2
#define ZONE_SIZE 12
#define MAX_DEVICES (MAX_ZONES * ZONE_SIZE)
//#define MAX_DEVICES 16

#define ZONE_UPPER  1
#define ZONE_LOWER  0

#define CLK_PIN  14 // D6
#define DIN_PIN  13 // D8
#define CS_PIN   15 // D7

#if USE_DS3231
#include <MD_DS3231.h>
#include <Wire.h>
#endif

// Hardware SPI connection / Arbitrary output pins
MD_Parola P = MD_Parola(DIN_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);

#define SPEED_TIME  75
#define PAUSE_TIME  0

#define MAX_MESG  10

// Turn on debug statements to the serial output
#define  DEBUG  0

// Global variables
char  szTimeL[MAX_MESG];    // mm:ss\0
char  szTimeH[MAX_MESG];

void getTime(char *psz, bool f = true)
// Code for reading clock time

// HH:MM:SS Von mir !
{
#if USE_DS3231
  RTC.readTime();
  sprintf(psz, "%02d%c%02d%c%02d", RTC.h, (f ? ':' : ' '), RTC.m, (f ? ':' : ' '), RTC.s);
#else
  uint16_t  h, m, s;
  
  m = millis()/1000;
  h = (m/60) % 24;
  m %= 60;
  sprintf(psz, "%02d%c%02d%c%02d", h, (f ? ':' : ' '), m, (f ? ':' : ' '), s);
#endif
}

void createHString(char *pH, char *pL)
{
  for (; *pL != '\0'; pL++)
    *pH++ = *pL | 0x80;   // offset character

  *pH = '\0'; // terminate the string
}

void setup(void)
{
  // initialise the LED display
  P.begin(MAX_ZONES);

  // Set up zones for 2 halves of the display
  P.setZone(ZONE_LOWER, 0, ZONE_SIZE - 1);
  P.setZone(ZONE_UPPER, ZONE_SIZE, MAX_DEVICES - 1);
  P.setFont(numeric7SegDouble);
//  P.setFont(BigFontBottom);
  P.setCharSpacing(P.getCharSpacing() * 2); // double height --> double spacing

#ifdef INVERT_UPPER_ZONE
  P.setZoneEffect(ZONE_UPPER, true, PA_FLIP_UD);
  P.setZoneEffect(ZONE_UPPER, true, PA_FLIP_LR);

  P.displayZoneText(ZONE_LOWER, szTimeL, PA_RIGHT, SPEED_TIME, PAUSE_TIME, PA_PRINT, PA_NO_EFFECT);
  P.displayZoneText(ZONE_UPPER, szTimeH, PA_LEFT, SPEED_TIME, PAUSE_TIME, PA_PRINT, PA_NO_EFFECT);
#else
  P.displayZoneText(ZONE_LOWER, szTimeL, PA_CENTER, SPEED_TIME, PAUSE_TIME, PA_PRINT, PA_NO_EFFECT);
  P.displayZoneText(ZONE_UPPER, szTimeH, PA_CENTER, SPEED_TIME, PAUSE_TIME, PA_PRINT, PA_NO_EFFECT);
#endif

#if USE_DS3231
  RTC.control(DS3231_CLOCK_HALT, DS3231_OFF);
  RTC.control(DS3231_12H, DS3231_OFF);
#endif
}

void loop(void)
{
  static uint32_t lastTime = 0; // millis() memory
  static bool flasher = false;  // seconds passing flasher

  P.displayAnimate();
  P.setIntensity(1); // Display Intensity
  if (P.getZoneStatus(ZONE_LOWER) && P.getZoneStatus(ZONE_UPPER))
  {
    // Adjust the time string if we have to. It will be adjusted
    // every second at least for the flashing colon separator.
    if (millis() - lastTime >= 1000)
    {
      lastTime = millis();
      getTime(szTimeL, flasher);
      createHString(szTimeH, szTimeL);
      flasher = !flasher;

      P.displayReset();

      // synchronise the start
      P.synchZoneStart();
    }
  }
}

If you can't resolve those errors yourself, then please just use the DS1307 library.

Pity, had the hope that it would simply be exchangeable as you said. Since I have as I have no idea of programming, I do not know where to change what would be the error message. Any tip?

So! With a little help in a other forum i have resolved the code error problem.
The Sketch is now using the DS3231
I have also edited the font. :slight_smile:

Now i will try to implement this code in my Sketch.

I realize that the parola code runs with the MD_DS3231.h. My sketch runs with the DS3231.h

How can i fix this? Can you give me a hint.

Here are my code what i am building, it is work and the serial Monitor says Wlan is connected and the time is set. But the Clock starts with 00:00:00
I mean it is because the DS3231 is set by ntp and not the MD_DS3231

#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <DS3231.h>
#include <Wire.h>
#include <TimeLib.h>
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#include "Font_Data2.h"

const char *ssid = "Daisy*****";
const char *password ="12345*****";

// NTP Servers:
//IPAddress timeServer(192, 168, 179, 1);  //meine.fritz.box //(192, 168, 179, 1);
IPAddress timeServer(192, 53, 103, 108);  //ptbtime1.ptb.de //(192, 43, 244, 18);

WiFiUDP Udp; // A UDP instance to let us send and receive packets over UDP
unsigned int localPort = 8888;      // local port to listen for UDP packets

const int timeZone = 1;     // Central European Time
//const int timeZone = -5;  // Eastern Standard Time (USA)

//DS3231-Clock
DS3231 Clock;
bool Century=false;
bool h12;
bool PM;

#if USE_GENERIC_HW || USE_PAROLA_HW
#define INVERT_UPPER_ZONE
#endif

// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define MAX_ZONES 2
#define ZONE_SIZE 12
#define MAX_DEVICES (MAX_ZONES * ZONE_SIZE)
//#define MAX_DEVICES 16

#define ZONE_UPPER  1
#define ZONE_LOWER  0

#define CLK_PIN  14 // D6
#define DIN_PIN  13 // D8
#define CS_PIN   15 // D7

#if USE_DS3231
#include <MD_DS3231.h>
#include <Wire.h>
#endif

// Hardware SPI connection / Arbitrary output pins
MD_Parola P = MD_Parola(DIN_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);

#define SPEED_TIME  75
#define PAUSE_TIME  0

#define MAX_MESG  10

// ################################# MAX7219 ##########################

// Global variables
char  szTimeL[MAX_MESG];    // mm:ss\0
char  szTimeH[MAX_MESG];

void getTime(char *psz, bool f = true)
// Code for reading clock time

// HH:MM:SS By me !
{
#if USE_DS3231
  RTC.readTime();
  sprintf(psz, "%02d%c%02d%c%02d", RTC.h, (f ? ':' : ' '), RTC.m, (f ? ':' : ' '), RTC.s);
#else
  uint16_t  h, m, s;
  
  m = millis()/1000;
  h = (m/60) % 24;
  m %= 60;
  sprintf(psz, "%02d%c%02d%c%02d", h, (f ? ':' : ' '), m, (f ? ':' : ' '), s);
#endif
}

void createHString(char *pH, char *pL)
{
  for (; *pL != '\0'; pL++)
    *pH++ = *pL | 0x80;   // offset character

  *pH = '\0'; // terminate the string
}

boolean cleared = false;

void setup() {
  //clock
    Wire.begin(); //clock communication
    Serial.begin(115200);
  //display
 
  String errormessage ="";
  
  //scan for networks
  if(scan_for_network(errormessage) == true)
  {
    //network found
    Serial.println("Netzwerk " + String(ssid) + " gefunden");
    //try connecting to network
    if(connect_to_network() == true)
    {
      //connected to network
      Serial.println("Mit Netzwerk " + String(ssid) + " verbunden");
      Serial.println("IP address: ");
      Serial.println(WiFi.localIP());

      Serial.println("Starting UDP");
      Udp.begin(localPort);
      Serial.print("Local port: ");
      Serial.println(Udp.localPort());
      
      //set clock
      if(settime()==true)
      {
        //Clock has been set
        WiFi.disconnect();
        Serial.println("Die Uhrzeit wurde gesetzt: " + String(Clock.getHour(h12,PM)) + ":" + String(Clock.getMinute()));
        delay(500);
      }
      else
      {
        Serial.println("Could not set the RTC.");
      }
    }
    else
    {
      Serial.println("Netzwerkname gefunden, es konnte keine Verbindung hergestellt werden. Falsches Passwort?");
    }
  }
  else
  {
     Serial.println(errormessage);
  }
// initialise the LED display
  P.begin(MAX_ZONES);

  // Set up zones for 2 halves of the display
  P.setZone(ZONE_LOWER, 0, ZONE_SIZE - 1);
  P.setZone(ZONE_UPPER, ZONE_SIZE, MAX_DEVICES - 1);
  P.setFont(numeric7SegDouble);
//  P.setFont(BigFontBottom);
  P.setCharSpacing(P.getCharSpacing() * 2); // double height --> double spacing

#ifdef INVERT_UPPER_ZONE
  P.setZoneEffect(ZONE_UPPER, true, PA_FLIP_UD);
  P.setZoneEffect(ZONE_UPPER, true, PA_FLIP_LR);

  P.displayZoneText(ZONE_LOWER, szTimeL, PA_RIGHT, SPEED_TIME, PAUSE_TIME, PA_PRINT, PA_NO_EFFECT);
  P.displayZoneText(ZONE_UPPER, szTimeH, PA_LEFT, SPEED_TIME, PAUSE_TIME, PA_PRINT, PA_NO_EFFECT);
#else
  P.displayZoneText(ZONE_LOWER, szTimeL, PA_CENTER, SPEED_TIME, PAUSE_TIME, PA_PRINT, PA_NO_EFFECT);
  P.displayZoneText(ZONE_UPPER, szTimeH, PA_CENTER, SPEED_TIME, PAUSE_TIME, PA_PRINT, PA_NO_EFFECT);
#endif

#if USE_DS3231
  RTC.control(DS3231_CLOCK_HALT, DS3231_OFF);
  RTC.control(DS3231_12H, DS3231_OFF);
#endif

}

//main loop: show time, add your own code to display it
void loop()
{
  static uint32_t lastTime = 0; // millis() memory
  static bool flasher = false;  // seconds passing flasher

  P.displayAnimate();
  P.setIntensity(1); // Display Intensity
  if (P.getZoneStatus(ZONE_LOWER) && P.getZoneStatus(ZONE_UPPER))
  {
    // Adjust the time string if we have to. It will be adjusted
    // every second at least for the flashing colon separator.
    if (millis() - lastTime >= 1000)
    {
      lastTime = millis();
      getTime(szTimeL, flasher);
      createHString(szTimeH, szTimeL);
      flasher = !flasher;

      P.displayReset();

      // synchronise the start
      P.synchZoneStart();
    }
  }
}

The library you use makes no difference to the way the clock works.

The RTC will start at 0 unless you have a battery back up for the time. Once set it should continue to work until the power is removed.

Trank for your coment, The DS3231 is working good without the Parola code. So its in good condition and the Batterie is new and full.

The DS3231 gets also the right time set, which I can examine if I attach it at another clock without Wlan. I mean the problem is not the RTC but the code or MD_DS3231. I believe the DS3231 and MD_DS3231 interfere with each other.?

Have you looked at the code times briefly?

Use one library or the other, do not use both. You will need to change the code to suit. Please read the documentation to work out what similar functions are for the different RTC libraries.

Where can I find the documentation for MD_DS3231? or otherwise asked! Where is the code with the RTC.readTime () If I would change that then I could omit the MD_DS3231 and the DS3231 use. Since you say the two back on the same values.

PS. what I noticed lately, why are standard functions in the code changed so that the existing is not usable. Do not misunderstand, I just want to understand it. As an example: Can the MD_DS3231 code be more than the DS3231, or why is what own used.?

And thanks for your patience! :-)

Where can I find the documentation for MD_DS3231?

In the docs folder where you have installed the library (open index.html) and also a link online usually from the displayed README.MD on the repository front page. For undocumented libraries you need to read the header file to work out what functions are available.

why are standard functions in the code changed so that the existing is not usable.

This is a misunderstanding. The only standard functions are those supplied with the arduino official library. Everything else is a contribution by volunteers who do their own work and make it available for others. You will find there are lots of libraries to do similar things with more or less functionality, speed, ease-of-use, etc. As the programmer you need to find one you like and use that.

Thanks for trying to help me, but that's too high for me. I do not know where to start. Thanks again

Hello Very interesting clock Did you solve the problem already?

No, since I can not program, I get the problem also not solved.
I do not know where to start.
No matter!
Maybe somebody will have mercy on me sometime and help me. Even though I can not program.
Apart from Marco, he has other things to do than to complete the code. :slight_smile:
Is not life-important.

hello I would like to know how you enlarged the lyrics? sorry for my bad english

hello I would like to know how you enlarged the lyrics? sorry for my bad english