0

I have a client (an esp8266 module) that constantly (every 2 seconds) connects to a server, executing a query from a php script and gets any possible changes in MySQL database.
I implemented a http get request to do this but it takes too much time and resource on my module and the server.
Is there a way to "push" some notification from server to my module if any changes detected on database and then trigger the get request?
I just need an idea to keep my module up to date without constantly making get requests.

3
  • Take a look at stackoverflow.com/questions/35473356/… Oct 31, 2019 at 11:19
  • MySQL have no push service at all, you must use some external push service. Scheme: 1) There exists some global user-defined variable (or service table), default value is 0. 2) If some data in interest changed then trigger changes this variable to 1. 3) Some external service with permanent connection checks this variable periodically, if 1 detected, then service changes it to 2 and sends push. 4) Client accepts push, connects, performs action it needs, and sets this variable back to 0.
    – Akina
    Oct 31, 2019 at 11:34
  • I have a small plugin (UDF), which notifies a websocket server when any event such as insert, update, delete happens on a specific table: github.com/Cyclonecode/mysql-notification Jun 16, 2020 at 8:54

0

You must log in to answer this question.

Browse other questions tagged .