Other projects

The Blindotron

5 816
The purpose of the project is to build a remote controlled window blind system. The system will fit any blind remote as it will emulate button pressing rather then try to emulate the device of the blind system vendor. The additional purpose is to be able to control the window blinds so that I can open and close them from my phone.

Project includes three parts:
  • Hardware to connect a micro-computer like a LaMaker Guitar or a Raspberry Pi via the GPIO interface to an electrical relay that will join the connectors of the proprietary window blind system remote control. I already have a proof of concept using Raspberry Pi:

    The design needs a major correction though. That is the GPIO PIN pull-down or pull-up so that the PIO is initialized in a predefined state on power on. This is to avoid unexpected blind control on AC power down and up.
  • The GPIO control needs to be executed using a user-space program to avoid access rights being too high when control via web is utilized. This is done typically via a dedicated deamon.
  • A web page needs to be designed to control the blinds. The simplest solution is a CGI bash script that will enable the relay switch and will be accesses via a simple HTTP GET request. This means calling up a dedicated URL.
  • An optional component of the project is to make this solution secure. This is optional due to not really strictly connected to LeMaker but rather to the general web security knowledge.


Interesting : I have almost the same project
Mine will be controlled by an MQTT daemon.

Obviously, on my Banana

destroyedlolo replied at Jan 20, 2016 16:44
Interesting : I have almost the same project
Mine will be controlled by an MQTT daemon.

So you will be sending control messages from another device? Or locally and driven by a wb page?
Mine will have a web page based on the Guitar itself that will talk to a local deamon via CGI (at first). This way I do not need a dedicated app on the client but merely a browser.

I have a problem though. I tried playing with GPIO but with limited success. I can do GPIO output control with sys filesystem but as root only
I also tried the wiringBP library with C, Python or Bash. However wiringBP does not set the pin values at all. Any ideas why?

If no ideas appear, then I will stick to sys and write some deamon started via rcS to do my bidding. I am curious though how to make wiringBP work.

My architecture is more or less described on this French page (but Google translator is your friend isn't it ) and links to my own driving software on its parent page.

So you will be sending control messages from another device? Or locally and driven by a wb page?

Control messages are also exchanged thru MQTT with dedicated topics allowing me to decouple actors layers against GUI or command layers ... en eventually having multiple commanders.
For the moment, it's in very early stage as I did some test to drive a ventilator but I'm planning to implement a daemon to commands to action based on environmental values and a web Interface allowing me to force some actions.

I have a problem though. I tried playing with GPIO but with limited success. I can do GPIO output control with sys filesystem but as root only

I don't have this problem (yet) as all my devices are driven from a 1-wire network (as spread everywhere in my house ) even I did some tests with GPIO.
It's probably possible to set Sysfs' right using an udev rules. Not tested.

If no ideas appear, then I will stick to sys and write some deamon started via rcS to do my bidding. I am curious though how to make wiringBP work.

Or simply do a sudo wrapper

Wow.... for what I am going to do here, this is like shooting a fly with a cannon ;)
I did the sysfs deamon though. There is no rights problem as the deamon runs from rcS and so on system rights.

I did a simple interface via file in /tmp/ I did this because implementation took like 15 minutes and it gets the job done. Plus my web page can only write the /tmp/blinds file and cannot have any access to the actual GPIO.

Anyhow I managed to get Apache and CGI running and so the simplest web page can now roll my blinds up and down. I attached a zip file containing all files involved in the process. I may decide to move that to some svn repo eventually.

Now I will get to soldering that pull-down resistors to get it to be dependable on boot-up.

deamon.zip

93.15 KB, Downloads: 2

First alpha deamon working

Edited by feamarto at Feb 26, 2016 12:09

I got GPIO pull-down running and not the GPIO I am using wake up in low state on CPU power up. I will post this simple schematics soon (just fore reference as it is simple).

@LeMaker: I will have some delays in the project due to problems with initialization of the GPIO on system start. Hope you understand.

Here is the problem. The GPIO will power up in low state thanks to a 10k pull-down resistor. At GPIO export time via /sys I am getting his PIO in a high state and this causes my relay switch to go to an undesired state until I set an explicit low state on the PIO. So my current flow is:
  • CPU power-up, PIO in low state (thanks to pull-down)
  • Linux starts
  • In rcS I export the PIO via sysfs and it goes high
  • Directly after export I set the PIO to low and it goes low
  • Any subsequent switching of PIO state works OK.

Please help to eliminate the phenomenon from point 3.

You have to log in before you can reply Login | Sign Up

Points Rules