How to Compile Watchy GSR - GuruSR/Watchy_GSR GitHub Wiki

In order to compile this you need (Arduino users only, PlatformIO is automatic):

For Arduino users:

You will need to click on the links, download the .zip file, using the Sketch Menu -> Include Library -> Add .Zip Library and pick each one after it is downloaded to include those libraries. Any libraries without a link, you can search for the library in the Library Manager (icon on the left of UI).

ESP32 Board Versions:

For Watchy 3.0, use the latest Arduino ESP32 Boards version. You will need the Latest ESP-IDF.
For Watchy 1.0 to 2.0, use Arduino ESP32 Boards version 2.0.17 or higher, but not above version 2.

MUST READ

Watchy GSR offers OTA, in order for that to work, your Arduino compile setup should have the partitions set for MIN_SPIFFS (V1 to V2) or 8M with spiffs (V3), not anything else, if compiled with HUGE, no OTA will be offered. Below is the Arduino IDE settings for the Watchy versions.

Arduino Compiler Settings

For PlatformIO.ini users:

If you git the project completely, you can compile after selecting the proper version of Watchy.


WATCH V3.0 (2024) OWNERS READ THIS!

For both PlatformIO and Arduino, if you plan to use Arduino ESP32 Board versions starting at 3.0.2 and above, you MUST update to the Latest ESP-IDF. To ensure you know how to setup your Watchy V3 for uploading a compiled firmware change, you really should read Watchy V3 (2024) first.

VERSION 1.4.7F CHANGES

V3: There is a new Watchy version V3. Double check the Compile Settings if using Arduino, PlatformIO will have no issues so long as you tell it in the drop down, what Watchy version you are using.

VERSION 1.4.3+ CHANGES

Go into the Watchy library folder and move the following files out of it, otherwise it may not compile as these files are out of date:

Safely ignore any errors from WatchyRTC (it isn't used). Safely ignore the PCF8563 warning.


Border Control (optional)

To allow Watchy to change the border around the display to white or black, a few files will need to be edited any time the GxEPD library is updated.

You will need to find the location of the libraries (Arduino users, it is in your Arduino folder under Libraries and GxEPD2, a similar path for PlatformIO users will also be a best way to find them). Once you have found the GxEPD2 folder, the files for editing are in src and then epd.

You'll need to edit 2 files:

GxEPD2_154_D67.cpp:

Copy the code below:

bool IsDark;                                    // GuruSR:  Changed for setDarkBorder
void GxEPD2_154_D67::setDarkBorder(bool Dark){  // GuruSR:  Changed for setDarkBorder
	IsDark=Dark;                                  // GuruSR:  Changed for setDarkBorder
}                                               // GuruSR:  Changed for setDarkBorder

And add it to just under this code: (Note, the uint8/16_t's below can either be uint8_t or uint16_t based on GxEPD2 version, don't copy those lines.)

GxEPD2_154_D67::GxEPD2_154_D67(int8/16_t cs, int8/16_t dc, int8/16_t rst, int8/16_t busy) :
  GxEPD2_EPD(cs, dc, rst, busy, HIGH, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate)
{
}

So when you're done, it looks like this:

GxEPD2_154_D67::GxEPD2_154_D67(int8/16_t cs, int8/16_t dc, int8/16_t rst, int8/16_t busy) :
  GxEPD2_EPD(cs, dc, rst, busy, HIGH, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate)
{
}

bool IsDark;                                    // GuruSR:  Changed for setDarkBorder
void GxEPD2_154_D67::setDarkBorder(bool Dark){  // GuruSR:  Changed for setDarkBorder
	IsDark=Dark;                            // GuruSR:  Changed for setDarkBorder
}                                               // GuruSR:  Changed for setDarkBorder

Change the code in _InitDisplay from:

void GxEPD2_154_D67::_InitDisplay()
{
  if (_hibernating) _reset();
  delay(10); // 10ms according to specs
  _writeCommand(0x12); // soft reset
  delay(10); // 10ms according to specs
  _writeCommand(0x01); // Driver output control
  _writeData(0xC7);
  _writeData(0x00);
  _writeData(0x00);
  _writeCommand(0x3C); // BorderWavefrom
  _writeData(0x05);      <- THIS LINE NEEDS TO BE CHANGED, LOOK BELOW!
  _writeCommand(0x18); // Read built-in temperature sensor
  _writeData(0x80);
  _setPartialRamArea(0, 0, WIDTH, HEIGHT);
}

to:

void GxEPD2_154_D67::_InitDisplay()
{
  if (_hibernating) _reset();                               <- DO NOT COPY THIS
  delay(10); // 10ms according to specs                     <- DO NOT COPY THIS
  _writeCommand(0x12); // soft reset                        <- DO NOT COPY THIS
  delay(10); // 10ms according to specs                     <- DO NOT COPY THIS
  _writeCommand(0x01); // Driver output control             <- DO NOT COPY THIS
  _writeData(0xC7);                                         <- DO NOT COPY THIS
  _writeData(0x00);                                         <- DO NOT COPY THIS
  _writeData(0x00);                                         <- DO NOT COPY THIS
  _writeCommand(0x3C); // BorderWavefrom                    <- DO NOT COPY THIS
  _writeData(IsDark ? 0x02 : 0x05);         // GuruSR:  Changed for setDarkBorder
  _writeCommand(0x18); // Read built-in temperature sensor  <- DO NOT COPY THIS
  _writeData(0x80);                                         <- DO NOT COPY THIS
  _setPartialRamArea(0, 0, WIDTH, HEIGHT);                  <- DO NOT COPY THIS
}

Edit GxEPD2_154_D67.h:

After:

#define _GxEPD2_154_D67_H_

Add:

#define GxEPD2DarkBorder

It should look like this:

#define _GxEPD2_154_D67_H_
#define GxEPD2DarkBorder

Further down look for:

void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)

Add the below line below after the line above:

void setDarkBorder(bool Dark);        // GuruSR:  Changed for setDarkBorder

So it looks like:

void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0)
void setDarkBorder(bool Dark);        // GuruSR:  Changed for setDarkBorder

This will allow Dark borders on the Watchy for either Arduino or PlatformIO.