Giter VIP home page Giter VIP logo

esp-idf-remote-hd44780's Introduction

esp-idf-remote-hd44780

Control the HD44780 using HTTP/MQTT.
I use this library.
It's great work.
I made this to know if there are any notify on my HEAD LESS linux server.
head-less-linux head-less-linux-2

HTTP MQTT

Software requirements

ESP-IDF V4.4/V5.0.

Hardware requirements

Character display using HD44780.
Usually called 1602LCD/1604LCD.

Installation

git clone https://github.com/nopnop2002/esp-idf-remote-hd44780
cd esp-idf-remote-hd44780
git clone https://github.com/UncleRus/esp-idf-lib.git
idf.py menuconfig
idf.py flash

Configuration

config-top config-app

WiFi Setting

config-wifi-1

You can connect using the mDNS hostname instead of the IP address.
config-wifi-2

You can use static IP.
config-wifi-3

Network protocol Setting

Using HTTP
config-protocol-http

Using MQTT
config-protocol-mqtt

Device Setting

config-device
The initial value is no backlight control.

Wiring

LCD ESP32 ESP32S2/S3 ESP32C2/C3
VSS -- GND GND GND
VDD -- 3.3V 3.3V 3.3V
VO -- Variable resistor output
RS -- GPIO19 GPIO1 GPIO0 *1
RW -- GND GND GND
E -- GPIO18 GPIO2 GPIO1 *1
D0 -- N/C N/C N/C
D1 -- N/C N/C N/C
D2 -- N/C N/C N/C
D3 -- N/C N/C N/C
D4 -- GPIO5 GPIO3 GPIO2 *1
D5 -- GPIO17 GPIO4 GPIO3 *1
D6 -- GPIO16 GPIO5 GPIO4 *1
D7 -- GPIO4 GPIO6 GPIO5 *1
A -- 5V 5V 5V *2
A -- 3.3V 3.3V 3.3V *2
K -- GND GND GND

(*1) You can change any GPIO using menuconfig.

(*2) 5V for 5V modules. 3.3V for 3.3V modules.

API for HTTP

  • cursor:off blink:off(default)
    curl -X POST -H "Content-Type: application/json" -d '{"lcd":"on", "cursor":"off", "blink":"off"}' http://esp32-server.local:8080/api/control

  • cursor:on blink:off
    curl -X POST -H "Content-Type: application/json" -d '{"lcd":"on", "cursor":"on", "blink":"off"}' http://esp32-server.local:8080/api/control

  • cursor:off blink:on
    curl -X POST -H "Content-Type: application/json" -d '{"lcd":"on", "cursor":"off", "blink":"on"}' http://esp32-server.local:8080/api/control

  • cursor:on blink:on
    curl -X POST -H "Content-Type: application/json" -d '{"lcd":"on", "cursor":"on", "blink":"on"}' http://esp32-server.local:8080/api/control

  • clear lcd
    curl -X POST -H "Content-Type: application/json" http://esp32-server.local:8080/api/clear

  • set position
    curl -X POST -H "Content-Type: application/json" -d '{"col":0, "line":0}' http://esp32-server.local:8080/api/gotoxy

  • put character on lcd
    curl -X POST -H "Content-Type: application/json" -d '{"char":"s"}' http://esp32-server.local:8080/api/putc

  • put string on lcd
    curl -X POST -H "Content-Type: application/json" -d '{"str":"abcdefghijklmn"}' http://esp32-server.local:8080/api/puts

  • backlight on
    curl -X POST -H "Content-Type: application/json" -d '{"backlight":"on"}' http://esp32-server.local:8080/api/backlight

  • backlight off
    curl -X POST -H "Content-Type: application/json" -d '{"backlight":"off"}' http://esp32-server.local:8080/api/backlight

Backlight control

A transistor is required for backlight control.

                  emitter
ESP32 GND -----------------+
                           |
                    base   /
ESP32 BL  -----^^^--------|    SS8050
                           \
               collector   |
                           +------- LCD K
ESP32 3.3V/5V --------------------- LCD A

Demo for HTTP

sudo apt install curl
bash ./demo_http.sh

API for MQTT

  • cursor:off
    mosquitto_pub -h broker.emqx.io -p 1883 -t "/api/hd44780/cursor" -m "off"

  • cursor:on
    mosquitto_pub -h broker.emqx.io -p 1883 -t "/api/hd44780/cursor" -m "on"

  • blink:off
    mosquitto_pub -h broker.emqx.io -p 1883 -t "/api/hd44780/blink" -m "off"

  • blink:on
    mosquitto_pub -h broker.emqx.io -p 1883 -t "/api/hd44780/blink" -m "on"

  • clear lcd
    mosquitto_pub -h broker.emqx.io -p 1883 -t "/api/hd44780/clear" -m ""

  • set column
    mosquitto_pub -h broker.emqx.io -p 1883 -t "/api/hd44780/col" -m "0"

  • set line
    mosquitto_pub -h broker.emqx.io -p 1883 -t "/api/hd44780/line" -m "0"

  • put character on lcd
    mosquitto_pub -h broker.emqx.io -p 1883 -t "/api/hd44780/putc" -m "s"

  • put string on lcd
    mosquitto_pub -h broker.emqx.io -p 1883 -t "/api/hd44780/puts" -m "abcdefghijklmn"

  • backlight on
    mosquitto_pub -h broker.emqx.io -p 1883 -t "/api/hd44780/backlight" -m "on"

  • backlight off
    mosquitto_pub -h broker.emqx.io -p 1883 -t "/api/hd44780/backlight" -m "off"

Demo for MQTT

sudo apt install mosquitto-clients
bash ./demo_mqtt.sh

esp-idf-remote-hd44780's People

Contributors

nopnop2002 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

esp-idf-remote-hd44780's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.