ePaper Display und Google Kalender mit ESP8266 - AZ-Delivery
Nowadays, many use their smartphone to do everyday things like planning appointments. But with many notifications, you can quickly lose track of upcoming appointments. In this blog post we will be a calendar with a e-paper display and one ESP8266 microcontroller Build that shows the upcoming appointments. So that the dates are always up to date, we use it on the Internet with a so -called API interface to. A program that contains this function is that Google Calendarwhich is also available on many operating systems. Only a Google account is required for this, which can be created free of charge, if not yet available.

Hardware

We need hardware:

2.9 “Epaper display

ESP8266 microcontroller Nodemcu or D1 Mini

Optional:

Button

3D printed housing

Screws & melting thread

First of all, the display must be connected to the microcontroller. This can either be connected via a cable connection directly soldered, or via a self -cramped cable, which is plugged into the pen strip of the display.

ESP8266 Node MCU 2.9 “Epaper display  
3V3 VCC
Gnd Gnd
D7 SDI
D5 SCLK  
D4 CS
D2 D/C
D1 Reset
D3 Busy

Wiring with a socket bar

Soldering the socket bar as shown

software

The required software consists of two parts:

1 Google script

First go to the Google Calendar website, register with your account and create a new calendar on the left at "More Calendar". Under this calendar, you will save all appointments that are to be displayed on the display in the future.

Now open the Google Script website, register with the same Google account as above. Next, click on the "New Project" button on the top left,

Now a window opens in which you copy the following code:





Finally, press the blue field “Provide"And choose there"New provision" out of. In the newly opened window, select the deployment option “Web app“.

Now enter a description and change the right of access to "Everyone". In the next step you will be a "Defective ID"Displayed. This is the Api-Key, via which the ESP can later access the data. This must then be inserted into the source code. To test the script, you can open the link below. As a result, the dates of the next 14 days with a start and end date should be displayed separately with a semicolon.

This script only reads the dates from a calendar. If you want to display several calendars, you have to copy the block and insert it with a changed calendar name. (However, only the first 4 appointments of the chain are displayed on the display).

If you want to read further data from your calendar, you will find the necessary information in the Google Developer Docs.

2 Arduino Ide/Platform IO

Arduino IDE

First you have to install the associated libraries:

Arduinojson

Https redirect

GXedp2

Adafruitgfx

If you are programming a microcontroller with ESP8266 processor for the first time, you must still Preferences in the Board administrator-URL Copy field: http://arduino.esp8266.com/stable/package_esp8266com_index.json. Then install via the Board manager the ESP8266 Package.

Platform io

Copy the following lines into the Platformio.ini file of your project:





The sketch

Sketch download

First, the required libraries and the fonts (fonts) installed with the Library display are integrated.





Subsequently structs created for the individual dates and their time. These are then saved in the form of a list of four elements.





After that, variables for the line break are initialized for longer names and for the network.





Now we create objects for the Wificlient, which will later be used by the server to read the data and an object for the display. If your display does not work (older version), select another driver from the list by removing the comment sign of the line.





Below you can set the colors of the title, the appointments and the appointment time, as well as the title.





In the set up() Only the display and the LED status is initialized.





In the Loop () The ESP first connects to the WLAN, during which the status LED flashes. If no connection is still established after 20 seconds, the ESP is restarted. After a successful connection, the display is using the method Display event () described.





The following method establishes a connection to the server, reads the data in the form of a string and extracted by calling up Extractdata () The individual data (start time, name, end time).





In the night function, searches for the semicolons that separate the individual data and then stored this data as a string in the list, in the associated elements.





The following method reads out of the string, which stores time, the minute, hour, day and the day of the week and saves it in struct Time of the individual elements.





The method Convdayname () Convert the English weekday name in the Germans.





Display event () is in the Loop () Called up function to display the event with the handed over on the display.





The following method is called to display a disturbance on the LED status:





Assembly and operation

Print The housing With a 3D printer and press the melting thread (M3) into the intended holes with a hot soldering iron. Finally, glue the board with the USB socket in the recess and recently screw the display with the right screws from the outside.

After you have connected a power supply, the next four appointments will be displayed automatically every hour on the display. After pressing the button, the appointments are updated immediately. The display will flash several times while describing. This is normal, the color capsules are aligned on the display.

Have fun recovery :)

DisplaysEsp8266Projekte für anfänger

Laat een reactie achter

Alle opmerkingen worden voor publicatie gecontroleerd door een moderator

Aanbevolen blogberichten

  1. ESP32 jetzt über den Boardverwalter installieren - AZ-Delivery
  2. Internet-Radio mit dem ESP32 - UPDATE - AZ-Delivery
  3. Arduino IDE - Programmieren für Einsteiger - Teil 1 - AZ-Delivery
  4. ESP32 - das Multitalent - AZ-Delivery