martincarapia / HandsFreeLightBulb

For my internship at Medical Informatics Engineers, thanks to Doug Horner, I was provided the material to develop a project that I believe would be very helpful for home automation and energy saving. Checkout the readme for more information
GNU General Public License v3.0
1 stars 0 forks source link

Project Build Instructions

This code interacts with NODE-RED

INSTRUCTIONS (Thanks to Raj for these build instructions)

install node-red on a raspberry pi or any other Debian-based server (ex. Ubuntu server) I've used both and both work perfect.

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

Then in order to use the dashboard do

cd ~/.node-red
npm i node-red-dashboard
node-red-restart
sudo systemctl enable nodered.service

Then do this in order to have access to the TPlink modules thanks to mbserran

npm install node-red-contrib-tapo-new-api

Mosquito install

You'll also need to set up a mosquito broker. This is how the Pico device will communicate to the node-red server. It also gives room to have multiple occupancy counting devices. \ On your server do

sudo apt-get update
sudo apt-get install -y mosquitto mosquitto-clients
sudo systemctl start mosquitto
sudo systemctl enable mosquitto

Make sure it's installed by doing

sudo systemctl status mosquitto

Pico code compile

You'll need a Pico W and the Pico SDK installed. You can find more detailed instructions on the Raspberry Pi Pico Repo \ Note: Make sure you export the PICO_SDK_PATH in your kernel profile file in order to build the ultrasonic.c code.

Before you build, Make sure you set the Wi-Fi information and MQTT information. \ On your computer do

cd path/to/project/root
mkdir build
cd build
cmake -DPICO_BOARD=pico_w ..
make

Press and hold the bootsel button on the Pico W while plugging it into the computer. Then, drag and drop the MainApp.uf2 file onto the Pico W. \ For more in-dept instructions reference Pico Docs