From c371a03894e71e9ecaa4019417339fb7b62668b4 Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 30 Jan 2017 19:12:01 +0100 Subject: [PATCH 01/15] Update README.md --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 88467f5..94c5d46 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,20 @@ # fanController ## API of fanController + + +# ELECTRONICS +## Curtains + +#### Idea +``` +The idea is to do this +``` + +#### Partlist +Part | Part name | Usage | Link +---|---|---|--- +Stepper motor | | Rotate curtain +Arduino | Uno | Micro controller | +Ethernet cable | 1.4 meters | Lines from switches to micro controller | ebay +Housing | Medium | Contains the electronics | radio +Curtains | IKEA | The curtains From ca1902f6830f53b9b46c5f8b9bec7824352587f2 Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 30 Jan 2017 22:25:48 +0100 Subject: [PATCH 02/15] Update README.md --- README.md | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 94c5d46..42ab675 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,41 @@ ## API of fanController +# ELECTRONICS + + # ELECTRONICS ## Curtains -#### Idea -``` -The idea is to do this -``` +#### the Idea +Since I was young I have always been obsessed with motors. Using motors to control crazy mondane things. *Not because it was hard, but because I could.* So to continue that trend I wanted to be able to control me two roller curtains over my bed. I started prototyping with a Arduino and a couple servos and I now have it up and running. +>>A little caviate. It is working, but only the one curtain can be lifted again, it has no automation and no wireless connectivity. Needs to be done! + +I have rewritten the software several times, and just landed on what just worked so I could get back to procrastinating before my exams. You can check the Arduino code out, I will make sure to comment it well. + #### Partlist +Under is a list of all the parts I have yet used for this projects. Some I have links to, others I have just found laying around or made out of some random junk. If there are any questions about the items please send me a email. [MAIL](https://google.com) Part | Part name | Usage | Link ---|---|---|--- -Stepper motor | | Rotate curtain +Stepper motor | Motor: 28BYJ-48 Board: ULN2003 | Rotate curtain | [ebay](https://goo.gl/tHQHP3 "ebay.com Stepper Motors") Arduino | Uno | Micro controller | -Ethernet cable | 1.4 meters | Lines from switches to micro controller | ebay +Ethernet cable | 1.4 meters | Lines from switches to micro controller | [ebay](https://goo.gl/EOS7BO "ebay.com 200' Cat6") Housing | Medium | Contains the electronics | radio Curtains | IKEA | The curtains + +### Development forwards +**Items still want to add or change:** +* ~~Working prototype~~ +* Raspberry Pi +* Seperate powersupplies +* Internet Connectivity + +### Useful reading material +Controlling 28BYJ-48 with python on RPi - [link](https://defendtheplanet.net/2014/05/04/controlling-a-stepper-motor-28byi-48-with-a-raspberry-pi/) +Stepping up GPIO from 3.3v to 5v - [link](https://www.raspberrypi.org/forums/viewtopic.php?t=40540&p=331220) + + +I will be switching to a C.H.I.P or a Raspberry Pi gen 2 B+ with a WIFI dongle. + +The idea is to have a electronically controlled curtains. First time around I am using an Arduino and small stepper motors inserted in the ends of the curtains. I have a switch panel to control the power and direction of the *curtainbot*. I'm using a single powersource for the arduino and both stepper motors. From 7e24f09934f04db0fbf7e49ebde8494759a8d935 Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 30 Jan 2017 22:26:15 +0100 Subject: [PATCH 03/15] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 42ab675..93f4552 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,6 @@ ## API of fanController -# ELECTRONICS - - # ELECTRONICS ## Curtains @@ -17,6 +14,7 @@ I have rewritten the software several times, and just landed on what just worked #### Partlist Under is a list of all the parts I have yet used for this projects. Some I have links to, others I have just found laying around or made out of some random junk. If there are any questions about the items please send me a email. [MAIL](https://google.com) + Part | Part name | Usage | Link ---|---|---|--- Stepper motor | Motor: 28BYJ-48 Board: ULN2003 | Rotate curtain | [ebay](https://goo.gl/tHQHP3 "ebay.com Stepper Motors") From c91d3bb8a4ddf98b17e60a47d83e37f3ce7ac566 Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 30 Jan 2017 22:27:42 +0100 Subject: [PATCH 04/15] Update README.md --- README.md | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 93f4552..d9c4665 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,15 @@ -# fanController -## API of fanController +# Connected SMART Curtains +### (API for fanController) - -# ELECTRONICS -## Curtains - -#### the Idea +## the Idea Since I was young I have always been obsessed with motors. Using motors to control crazy mondane things. *Not because it was hard, but because I could.* So to continue that trend I wanted to be able to control me two roller curtains over my bed. I started prototyping with a Arduino and a couple servos and I now have it up and running. >>A little caviate. It is working, but only the one curtain can be lifted again, it has no automation and no wireless connectivity. Needs to be done! I have rewritten the software several times, and just landed on what just worked so I could get back to procrastinating before my exams. You can check the Arduino code out, I will make sure to comment it well. -#### Partlist +## Partlist Under is a list of all the parts I have yet used for this projects. Some I have links to, others I have just found laying around or made out of some random junk. If there are any questions about the items please send me a email. [MAIL](https://google.com) - Part | Part name | Usage | Link ---|---|---|--- Stepper motor | Motor: 28BYJ-48 Board: ULN2003 | Rotate curtain | [ebay](https://goo.gl/tHQHP3 "ebay.com Stepper Motors") @@ -23,14 +18,14 @@ Ethernet cable | 1.4 meters | Lines from switches to micro controller | [ebay](h Housing | Medium | Contains the electronics | radio Curtains | IKEA | The curtains -### Development forwards +## Development forwards **Items still want to add or change:** * ~~Working prototype~~ * Raspberry Pi * Seperate powersupplies * Internet Connectivity -### Useful reading material +## Useful reading material Controlling 28BYJ-48 with python on RPi - [link](https://defendtheplanet.net/2014/05/04/controlling-a-stepper-motor-28byi-48-with-a-raspberry-pi/) Stepping up GPIO from 3.3v to 5v - [link](https://www.raspberrypi.org/forums/viewtopic.php?t=40540&p=331220) From 3dc37f923a2440abc0ff25cdc122fa1842fcd085 Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 30 Jan 2017 22:28:07 +0100 Subject: [PATCH 05/15] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d9c4665..be09dba 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ I have rewritten the software several times, and just landed on what just worked ## Partlist Under is a list of all the parts I have yet used for this projects. Some I have links to, others I have just found laying around or made out of some random junk. If there are any questions about the items please send me a email. [MAIL](https://google.com) + Part | Part name | Usage | Link ---|---|---|--- Stepper motor | Motor: 28BYJ-48 Board: ULN2003 | Rotate curtain | [ebay](https://goo.gl/tHQHP3 "ebay.com Stepper Motors") From 6dd2e4b3c4b30b0491754724366d6502b861b314 Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 30 Jan 2017 22:28:42 +0100 Subject: [PATCH 06/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index be09dba..473b4ec 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Since I was young I have always been obsessed with motors. Using motors to contr I have rewritten the software several times, and just landed on what just worked so I could get back to procrastinating before my exams. You can check the Arduino code out, I will make sure to comment it well. -## Partlist +## Parts list Under is a list of all the parts I have yet used for this projects. Some I have links to, others I have just found laying around or made out of some random junk. If there are any questions about the items please send me a email. [MAIL](https://google.com) Part | Part name | Usage | Link From d2d123953ad60ffe04ebfdd1f5dd0d867f70a090 Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 30 Jan 2017 22:29:32 +0100 Subject: [PATCH 07/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 473b4ec..7ee3148 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## the Idea Since I was young I have always been obsessed with motors. Using motors to control crazy mondane things. *Not because it was hard, but because I could.* So to continue that trend I wanted to be able to control me two roller curtains over my bed. I started prototyping with a Arduino and a couple servos and I now have it up and running. ->>A little caviate. It is working, but only the one curtain can be lifted again, it has no automation and no wireless connectivity. Needs to be done! +> A little caviate. It is working, but only the one curtain can be lifted again, it has no automation and no wireless connectivity. Needs to be done! I have rewritten the software several times, and just landed on what just worked so I could get back to procrastinating before my exams. You can check the Arduino code out, I will make sure to comment it well. From c7661c65fdb8efe7bfaac093d0890cdd25ae6b3a Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 30 Jan 2017 22:37:48 +0100 Subject: [PATCH 08/15] Update README.md --- README.md | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7ee3148..344dae4 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,32 @@ -# Connected SMART Curtains +# Connected SMART Curtains ### (API for fanController) ## the Idea Since I was young I have always been obsessed with motors. Using motors to control crazy mondane things. *Not because it was hard, but because I could.* So to continue that trend I wanted to be able to control me two roller curtains over my bed. I started prototyping with a Arduino and a couple servos and I now have it up and running. -> A little caviate. It is working, but only the one curtain can be lifted again, it has no automation and no wireless connectivity. Needs to be done! +>A little caviate. It is working, but only the one curtain can be lifted again, it has no automation and no wireless connectivity. Needs to be done! I have rewritten the software several times, and just landed on what just worked so I could get back to procrastinating before my exams. You can check the Arduino code out, I will make sure to comment it well. +## Install +First you need to download node, can be found at here. +Next clone or fork this project to your computer. To start we first need to add all our node modules +```unix + $ npm install +``` +Now that we have all our components for our node project we can start the server. +```unix + $ node server.js +``` +This will print out the IP and port the website can be reached at. Go to a webbrowser and go to the address printed. You may need to allow that port through your firewall if you have it activated. + +If you want the server to launch at login to the following: +```unix + $ EXPORT="/usr/share/init.d" +x node /home/{user}/curtains +``` + ## Parts list Under is a list of all the parts I have yet used for this projects. Some I have links to, others I have just found laying around or made out of some random junk. If there are any questions about the items please send me a email. [MAIL](https://google.com) - Part | Part name | Usage | Link ---|---|---|--- Stepper motor | Motor: 28BYJ-48 Board: ULN2003 | Rotate curtain | [ebay](https://goo.gl/tHQHP3 "ebay.com Stepper Motors") From 80f30352ae628cba7c6b73c3922655c40ac0e130 Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 30 Jan 2017 22:38:06 +0100 Subject: [PATCH 09/15] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 344dae4..805116e 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ If you want the server to launch at login to the following: ## Parts list Under is a list of all the parts I have yet used for this projects. Some I have links to, others I have just found laying around or made out of some random junk. If there are any questions about the items please send me a email. [MAIL](https://google.com) + Part | Part name | Usage | Link ---|---|---|--- Stepper motor | Motor: 28BYJ-48 Board: ULN2003 | Rotate curtain | [ebay](https://goo.gl/tHQHP3 "ebay.com Stepper Motors") From 345a63ca6b134ce3da9656fc891fc4d79d8887eb Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Mon, 30 Jan 2017 22:52:40 +0100 Subject: [PATCH 10/15] Changed directory for the python scripts --- public/index.html | 2 +- server.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/index.html b/public/index.html index d92b956..8421462 100644 --- a/public/index.html +++ b/public/index.html @@ -43,7 +43,7 @@ border-radius: 4px; text-align: center; - font-size: 40px; + font-size: 55px; } .state_display h4 { position: absolute; diff --git a/server.js b/server.js index 5ac06b6..f23b245 100644 --- a/server.js +++ b/server.js @@ -26,7 +26,7 @@ app.get('/state', function(req, res) { app.post('/on', function (req, res) { console.log("Got a POST request for ON"); - PythonShell.run('led-csid0-on.py', function (err) { + PythonShell.run('pyscripts/led-csid0-on.py', function (err) { if (err) throw err; console.log('finished'); }); @@ -36,7 +36,7 @@ app.post('/on', function (req, res) { app.post('/off', function (req, res) { console.log("Got a POST request for OFF"); - PythonShell.run('led-csid0-off.py', function (err) { + PythonShell.run('pyscripts/led-csid0-off.py', function (err) { if (err) throw err; console.log('finished'); }); From 113e63797feaf131f6d6d001d32d8e076311236a Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Mon, 30 Jan 2017 22:53:17 +0100 Subject: [PATCH 11/15] Moved python files to 'pyscript' folder --- pyscripts/led-csid0-off.py | 9 +++++++++ pyscripts/led-csid0-on.py | 9 +++++++++ pyscripts/state.txt | 1 + 3 files changed, 19 insertions(+) create mode 100755 pyscripts/led-csid0-off.py create mode 100755 pyscripts/led-csid0-on.py create mode 100644 pyscripts/state.txt diff --git a/pyscripts/led-csid0-off.py b/pyscripts/led-csid0-off.py new file mode 100755 index 0000000..10c34e6 --- /dev/null +++ b/pyscripts/led-csid0-off.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 +import CHIP_IO.GPIO as GPIO #import the GPIO library + +GPIO.setup("CSID0", GPIO.OUT) #set CSID0 as an output +GPIO.output("CSID0", GPIO.LOW) #set CSID0 (LED) LOW (Off) + +f = open( 'public/state.txt', 'w' ) +f.write('off') +f.close() diff --git a/pyscripts/led-csid0-on.py b/pyscripts/led-csid0-on.py new file mode 100755 index 0000000..b4186ab --- /dev/null +++ b/pyscripts/led-csid0-on.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 +import CHIP_IO.GPIO as GPIO #import the GPIO library + +GPIO.setup("CSID0", GPIO.OUT) #set CSID0 as an output +GPIO.output("CSID0", GPIO.HIGH) #set CSID0 (LED) HIGH (On) + +f = open( 'public/state.txt', 'w' ) +f.write('on') +f.close() diff --git a/pyscripts/state.txt b/pyscripts/state.txt new file mode 100644 index 0000000..cfb931e --- /dev/null +++ b/pyscripts/state.txt @@ -0,0 +1 @@ +off From e1fb7759c8c555965a478b4e90ed147f11382b89 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Mon, 30 Jan 2017 22:53:47 +0100 Subject: [PATCH 12/15] Cleaned up in the files. Removed duplicated web files --- images/chip.png | Bin 2830 -> 0 bytes index.html | 98 --------------------------------------- led-csid0-off.py | 9 ---- led-csid0-on.py | 9 ---- public/index.html | 114 ---------------------------------------------- state.txt | 1 - style.css | 11 ----- 7 files changed, 242 deletions(-) delete mode 100644 images/chip.png delete mode 100644 index.html delete mode 100755 led-csid0-off.py delete mode 100755 led-csid0-on.py delete mode 100644 public/index.html delete mode 100644 state.txt delete mode 100644 style.css diff --git a/images/chip.png b/images/chip.png deleted file mode 100644 index 725f0defe5f653654059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+|@Oc$>4MK3IebV?lXuO5UXkYNZF*P5sIhC5Ag;C5Bg z3MmL)uUcn0Q5)0F=|j@NxA8Gfb}=~?gfSb diff --git a/index.html b/index.html deleted file mode 100644 index 347f8fc..0000000 --- a/index.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - Fan Controller - - - - - - -
-
-

Fan Controller

-
- -
- -
- - -
- -
-

Current fan state:

- ON -
- -
- -
- - -