intGus / light-server

Server to control a TP-Link smartplug using a Express server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Express Server to control a TP-Link Smart Plug

Prototype using the HTTP client example, a simple Express server and this NPM Package to control a TP-Link Smart Bulb

The Arduino RP 2040 Connect is using five Arcade Buttons with embeded LED lights (with resistors included).

Installing and running

git clone https://github.com/intGus/light-server.git
cd light-server
npm install
node index.js

Python code (main.py) for the Arduino Nano can be found in the /Arduino directory

For the connections inside the box I used this tutorial

I'm using the following:

(includes paid links)

  • Arduino RP2040 Connect. It can be done with a Raspberry Pico W using the appropiate libraries
  • Arcade buttons. Adafruit sells individual buttons if you want different colors
  • Dupont Connectors. This is for the breadboard end of the cable and soldered on the button connectors.
  • A TP-Link Smart Bulb (I'm using the KL125)
  • NodeJS with npm for the Express server (I'm using a Raspberry Pi 4 but any computer with NodeJS will work)

About

Server to control a TP-Link smartplug using a Express server


Languages

Language:Python 86.4%Language:JavaScript 13.6%