Add to Watchlist

What Symfony Has To Do With My Garage - Home Automation With PHP

8 views

Citation of segment
Embed Code
Purchasing a DVD Cite video

Formal Metadata

Title What Symfony Has To Do With My Garage - Home Automation With PHP
Title of Series FrOSCon 2014
Part Number 16
Number of Parts 59
Author Unger, Jan
License CC Attribution - NonCommercial 2.0 Germany:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
DOI 10.5446/19645
Publisher Free and Open Source software Conference (FrOSCon) e.V.
Release Date 2014
Language English

Content Metadata

Subject Area Computer Science
Abstract What Symfony Has To Do With My Garage - Home Automation With PHP Raspberry Pi is a perfect mini computer to experiment with, small, inexpensive, low energy consumption and easy to expand. This talk, using the example of a Symfony app as a remote control for a garage door drive, shows that it's possible to write hardware drivers in PHP and how to easily use the Raspberry Pi along with the PiFace Digital Expansion Board for home automation. ······························ Speaker: Jan Unger Event: FrOSCon 2014 by the Free and Open Source Software Conference (FrOSCon) e.V.
Keywords Free and Open Source Software Conference
FrOSCon14
Series
Annotations
Transcript
Loading...
Chen
so morning everybody I hope you all that well I wasn't here the social events yesterday but uh so photos of the PHP table outside in the social area and there were some there was some some hot stuff going on this was produced to the k and
was implemented in my garage and so on and so forth wouldn't even the last months and the painter coordination with PHP but she was about
me man in general and freelancer living in the land mine area near Frankfurt during wet occasions mostly with PHP and Javascript and the since 14 years now 2000 I was young and needed the money now there's an old and will still need the money if you value questions some hesitate just shout out we tried to answer them instantly the object what I'm going to talk about this branch my garage at all the sectional door the part of the the view from inside the
is the and here we have a box the model and that's being in the environment the chain quite similar to bicycle chain you might know that should change from the very last moment of the moment is that the next to the dog and the marginal buyer will change and that by putting the door by control this was already in place and my intention was to get this thing accessible by anything that he there already
was radio remote control thing here that like hockey and this remote control was 1 of the main reasons why started on this because I used to have this remote control in my pocket and from time to time without noticing accidentally pushed the button the dog goes open and I did notice and the problem is
important this year is a long way to go up the flow flat and this hole in the wall between the garage and status and when the doors open you can go wake up to the which is obviously not what I want this was made motivation number 1 the other thing that from time to time the way in the morning you can talk to promise later told we have lecture those from the donor remember yes and the motivation for and I think there is this is 1 of the wall which can just press its wider motor press the button and the motor goes up on the yeah where you might also no rest the reply which is based on my thing and who knows must reply OK for the other and microcomputer sites is approximately the size of bank or it's this which that 1 based on an island processor quite similar to what you might have in your pocket as a smart phones and the big thing about this is quite cheap of the Urals and it's easy to expand this year that way and it has an expansion board GPI older general-purpose input output by the spins implement something that is called S P I a serial parents interface boss it's an effect standard invented by Motorola for a synchronous serial but in and out and to make sure that you get all caught accessible for me I know that you know chronic use another thing is expanding qualified amount of the Urals and utilize this as the the i plus 1 year and bring them a important part and a output port where you just can't cut into wireless and if the wires are connected uh the 20 tell OK the input port is connected if they are a part of the input points of the other way around just saying you should have the software close this power then those 2 things get connected if you tell the software open the ported to looking another nice thing which I didn't use but which makes a lot of volume and you can that up to 4 of these can onto 1 best reply so you have inputs and 32 outputs with them quite probable amount of money but basis on the rest varying the operating system systems contrast BN it's an art version of being 0 so if you know that in the goal so that was really operated in computer which you have vacation I output this to the because this and the network in is how you in and out groups and the persistence is that when you talk to me 4 and this is how it looks when it's essential part this is just stuck upon the rest the and you it's quite because cigarette books of and if you want to have a look on it have 1 with me I have it here if you're interested just come to me after the talk and take a look at it from stealing it has has no point it's broken someone managed to break it but the sense of I want to have the doors open or closed or anything in between and to which is 2 things that I can't really context the conflict is basically a small inside this capture that to metal plates and if they are they get in the range of a magnetic field they close to each other and provide an electrical contact which means we have a market mechanism which I'm going to attach to the dog this method is going to move back and forth with the dog and from where we have those sentences and that's the magnet approaches the sends us I get the context of the 2 white and just plug them into my respiration so I can tell where the doors are actually as a set any question just show OK this
installation and then is looking at the from which it is actually not that really the amount it in some common the nation box you have that ended up being here and we have a probabilistic and has some lawyers with the that the act of the active form into the thing mounted on the wall you know what you remember this which adjusts the attached to additional ways to this which coming out of the which means I can tell of cluster relate it's as if I push the button and open delayed releasing about this is the situation in front of wearing right approach is not nearly around here is what we want to get a closer look like this this is the caption this the context this is 1 magnetic attached to this letter of the moving back and forth and on the other side like what's that saying we want on the Net comes at the end of life on sense of another thing I place because I'm a control
freak it's work and which was in fact the 1st step in this the project would work tell if the the doors open but the thing is that the cat the camera I want to tell me hey you know it's going to have a look at what's happening in this you down from
the camera in the back that being is from the garage up to there where they way up to a flat the software is staying small things page application which can easily be exist by a smart phone it has the status indicator which tells me the that always close the is open all the doors somewhere in between be moving at the moment we analyze orders from the and we have a flattened where we can tell that life goes this is the basic structure of the application of the containment system mostly overkill but another intention region in mind was to tell if rest very suitable for running Symphony applications in fact it is it's the base but still usable as long as you don't have to many users at the same time and the only use and it's quite natural function components we have that all states which saw in which is able to tell whether content of so we have a model which takes the post requests from within major because the model go ahead and we have the camera proxy the focus of work and and other things that is a watch which is a consul command around endlessly which reads the context every 2nd and if the state changes which means that those optimal going to send me an e-mail this was not a point at which uh another solution I would like to be informed when will about me doing anything about it and the camera proxy was necessary because the camera itself as an HTTP http interface but no as place and sending credentials over the internet is probably not the the best idea this thing and this chemical properties like pose a photo and and way and another I didn't and went we must assume I guess and there were 2 main components in place which helps you to to solve my problem the 1st 1 is this component HVS it is a PHP module implemented in C the some kind of model and we did this it makes it possible to access the the hardware layer the and this is where the magic happens provides a PHP interface class called S P I know which models this talk In the 2nd player things that made it much easier to assess the hardware this project from the from Norway so it's an abstraction layer about this is the model wait and simply says that methods that all reads and writes values from the single principle is actually support PHP part of the original library from the window that 1 and this was done in you might say that could also have used the original Python library but this is not what I want to what my they might want to get to know if it works with PHP and it worked out quite well as can see OK let's have a look at the code but we have here
1st and foremost there is the plants and as you can see this stuff going on here hexadecimal addresses I didn't speak in that Stephen must admit I just was happy that all of that works if you like it's all and the and you can read afterward so what's happening here the thing is we have a and API that allows us to read 2 bits from the SPI bus and to write well used to other bits at this as bus and my hardware use is this just a 2nd way have there it is this is the problem of abstraction layer of the pie face part which I build when it creates an instance it gets itself H. representation of the input pins and they present a triple representations of the output pins and all of what these pins do they they'd know I attached to this ball and to this pin number and they can tell the value of the actual pain and they can write well you In case of an output pin to the appropriate and memory address the application itself is rather to you on a symphony at least at a basic level you know Symphony thank the basic thing is you have a front control of um dispatching request to specialize controllers in the applications and in my we have of these controlled us we have an index action its controller which delivers the static HTML for the single patch application we have another control in place for the DOS state action which gets this service from the service container and is able to tell whether the story that always open the doors close so that was moving and it's Inspectorate's response which the same page application is able to process the next control this trigger action which gets a POST request and tells the door the motor go ahead move that lasts controller we have in place is this much reduction for the web cam which posts and action actually image from the camera and sends it out who the requesting application and as you remember we had another thing in place this what it's this 1 here it's a consul command Symphony provides a consul commands which you can run on the server and this 1 here is simply running a while loop endlessly where it executes a so-called watched component and watched a component greets the census tells the state and if the state change its it sends out a mayor this may be skewed up Symphony has and make you and after executing the watched appeasement was flushed and the molecular send out and from time to time because PHP and long-running process of the running process is not that good idea of this thing terminates itself every 24 hours and gets restarted by supervisor demon which takes care of that this process is started if terminates for whatever reason OK and I originally intended to do last demonstration was so this thing here but as you know it's broken and obviously I can't bring my karachi and I can't take you to my knowledge to show you how this works in the in real life and so I did a little bit of where you can
see what happens it is the
garage when go downstairs in the garage openers smartphone push button or the related against the motives moving see the magnet leaving the reason the door opens
the and on the other end the matter reaches the and then the regions at the other end so far
there there because most of than moving and that use so
allocated because you know that everything's fine OK this is the
current status and then running in my garage some things in mind I want to fly out of this 1st of all some forms of humor as I said before from the restoration of the real performed hardware running for lamps that 1 is with symphony application is OK it's not a perfect um now I'm going to try out a few alternatives throwing out of them and often using plain PHP using engine next that it should be as whatsoever which might help in this that's the I'm just going out of few things the other thing I have in mind is a feature automatic clothing which allows me to go to the hash opened the door that come out and don't care how well closes with those places so I could do this just by telling OK dollars open for 15 seconds in our culture that's close doors might work might be so too fast you know already have some hardware places so
and I have focus and the at behaves approximately of the complement and and it is sort of a sense of what it is that I mean it's disconnected we have their own independent situation where we have 2 wires coming out of this photos but if they the light beam is connected to these ends closed if the I think disconnected which means the cargo through sensors disconnected and thereby can tell collecting has been disconnected to 5 seconds it has been connected again OK I think the cause of and it depends on the on going to do you of the research on that how long it's disconnected when the car goes through compared to how long it's disconnect when a person walks through I'm not quite sure about that I haven't tried that yet but I'm going to it's important I had in mind and I'm not sure it works that's it another thing I have in mind is
trying and which separates currently my page application pulse every 2 seconds there's indicate only the image itself it's updated every 10 seconds which causes quite bit note on underestimating and by having WebSockets I would be the problem would be solved this way I would have an open connection to notions of would be able to push notification something happens which might be faster than the actual quality solutions and remember that have this man right which it instead of 1 occasion have never done and by the development of all of those might be point to stuff that they have the patient that talks to my door let's see how well was control is many point of view your guy in the US rule has done quite similar thing the main difference is the haven't built in that the application but he talks a ceiling it has serial opened the door and that magically the garage of moving and going to library also and the last thing I'm going to write a play I think in which means having you you to this transformed and many the logic and the smart and in range of these losers transponder the and that might fire up and say hey we're in the garage so from the bill you see my playground for big voice OK I collected some links if you want to dig in here 1st of all this is my application which of the scope of the control the symphony application it's only there's also the library with which extracts the SPI glass and the PHP module for accessing the HPI SPI and some the units for further reading this is documentation that went up by and some more stuff if you want to begin with than in the rest of the and this GP I O port some have put up this lights at the the flexion going to tweak billing afterwards if you would like to reach me go ahead and write there are quite some alternatives are last requires the only thing to use if you want to do our home automation there's stuff called that way and the related projects that I really don't know how to to pronounce it correctly and it's similar but it's wireless which means you have an expansion board on the left we we have a sum of some kind of wireless component talking to hardware over the air 1 way as far as I know something a similar don't know much about that that is a friend of mine played around with that that way and didn't get out 5 made in which they were quite well not only might be ugliness I don't know much about the but we have to talk today as far as I remember in the evening to mental must line at 0 0 what is going on but you may still around if you like to have some words about the of of course we with a big variety of commercial products alternation I don't know much about them but I guess there also might be more expensive this do-it-yourself solution shot recaps the electric dog rifles over in the present a common ones like you can buy the hardware store things I bought myself where these to reach which is for of Europe each some cables the rest during which is about 30 years the expansion boards that so what 90 euros I have my own home automation project which I can play around with automation can be easily done it is of course at least for me this was proven not the rest reply works well as a platform for that it's come inexpensive and small energy footprint and easy to extend but and now I am happy to take questions at the end of the the by then of the question
was if I considered to use an expansion can for the rest the life that attach directly at that but In fact yes I did but in my in case can I was in place long before the respirator because as the 1st quick solution to tell whether that also known as just 1 there exists voltage and so this would come in already and just put it up there and the rest released not at the end it's mounted at the wall but not at the place where it can look at the door this is the point where yeah been considered but this might be a point also yes using a camera attached to the visible the history of the question of degree of where we all the only thing 3 years of work the all the more so yes question or on the In this work we work on it so we will not be In the fact that we do not find right and the book and then well here with all all the of yes this is all I would like very quickly to the so you see that the loss of income and the space will have and being with the area is so you know when I hear of all of edges because question was being question what's the sensors that if they are able to tell whether it they currently put the and right into the currently the sensors are just able to tell whether the doors closed completely closed or completely open this we have a punctual sends which can tell the magnet is in range or it is not I can I cannot tell whether Dorice when it's moving in between I might get into the same situation as you described it there are some things is in the way of the the crashes into yeah and it's not right because collective invited to designed to start if it reaches something in its way in my it's not a big problem as I get an e-mail as soon as the door opens and I get another man as soon as door closes and closing means closing completely if it's got underway the state of the law is currently moving the centers content if actually moving but they know it's not completely open and of and that's enough for me that can yeah right How about 15 centimeters 10 centimeters yeah it might be enough to leave some centimeters of the door opening at the bottom In such cases yes but I haven't had will it would be not that much of a problem as that those 5 10 centimeters won't be enough for someone to break into my house and this was the main points and the what would have sitting in the medical domain it so that's the door reaches the bottom of the garage long before this meant be rise it's hard to describe the section of Don and the topmost section the markets tilted yes thank you 1 on the left and they centimeters of this way on the last 20 centimeters of this way but but in most section is already on the ground of the graph so what would what could happen if it's stopped here saying that the talk of this long stays open for say 10 20 years could be a problem if you have neighborhood tool it's willing to show some something in but in my case OK some of questions they to and you
Area
Digital photography
Freeware
Computer animation
Software
Event horizon
Open set
Table (information)
Metropolitan area network
Computer animation
Lecture/Conference
Coordinate system
Branch (computer science)
Object (grammar)
Mereology
Metropolitan area network
Near-ring
Maxima and minima
Chaining
Hidden surface determination
Game controller
Remote administration
Integrated development environment
Scientific modelling
Multiplication sign
Moment (mathematics)
Cuboid
Point (geometry)
Context awareness
Game controller
Curvature
Multiplication sign
Range (statistics)
Motion capture
Auto mechanic
Function (mathematics)
Mereology
Weight
Coprocessor
Field (computer science)
Open set
Number
Power (physics)
Revision control
Lecture/Conference
Cuboid
Contrast (vision)
Physical system
Form (programming)
Boss Corporation
Hidden surface determination
Inheritance (object-oriented programming)
Closed set
Basis (linear algebra)
Sound effect
Thermal expansion
Volume (thermodynamics)
Computer
Local Group
Software
Computer hardware
output
Website
Video game
Smartphone
Mikrocomputer
Whiteboard
Operating system
Point (geometry)
Web page
Multitier architecture
Context awareness
Proxy server
State of matter
Code
Multiplication sign
Scientific modelling
Connectivity (graph theory)
Bit error rate
Mereology
Open set
Device driver
Natural number
Internetworking
Software
Computer hardware
Data structure
Computer-assisted translation
Proxy server
Physical system
Social class
Metropolitan area network
Email
Focus (optics)
Projective plane
Moment (mathematics)
Interface (computing)
Price index
Cartesian coordinate system
Functional (mathematics)
SCSI
Digital photography
Software
Computer hardware
Order (biology)
Phase transition
Module (mathematics)
Video game
Smartphone
Abstraction
Window
Library (computing)
Web page
Webcam
Demon
Game controller
Group action
Server (computing)
Service (economics)
State of matter
Connectivity (graph theory)
Patch (Unix)
Multiplication sign
Function (mathematics)
Mereology
Medical imaging
Pi
Lecture/Conference
Single-precision floating-point format
Computer hardware
Bus (computing)
Reduction of order
Energy level
Representation (politics)
Gamma function
Address space
Personal identification number
Metropolitan area network
Process (computing)
Code
Bit
Instance (computer science)
Cartesian coordinate system
Radical (chemistry)
Subject indexing
Loop (music)
Computer animation
Personal digital assistant
Dependent and independent variables
output
Speicheradresse
Abstraction
Dialect
Lecture/Conference
Open set
Lecture/Conference
Newton's law of universal gravitation
Exterior algebra
Hash function
Lecture/Conference
Computer hardware
Cartesian coordinate system
Open set
Form (programming)
2 (number)
Point (geometry)
Web page
Pulse (signal processing)
Rifling
Game controller
Presentation of a group
Variety (linguistics)
Connectivity (graph theory)
View (database)
Range (statistics)
1 (number)
Voltmeter
Food energy
Rule of inference
2 (number)
Product (business)
Medical imaging
Linker (computing)
Computer hardware
Subtraction
Metropolitan area network
Computing platform
Units of measurement
Metropolitan area network
Hidden surface determination
Focus (optics)
Link (knot theory)
Software developer
Projective plane
Thermal expansion
Cartesian coordinate system
Connected space
Inclusion map
Word
Summation
Exterior algebra
Computer animation
Logic
Module (mathematics)
Right angle
Quicksort
Whiteboard
Wireless LAN
Reading (process)
Library (computing)
Point (geometry)
Area
Domain name
Greatest element
Email
Spacetime
Graph (mathematics)
State of matter
Closed set
Range (statistics)
Physical law
Neighbourhood (graph theory)
Sheaf (mathematics)
Content (media)
Thermal expansion
Insertion loss
Open set
Degree (graph theory)
Arithmetic mean
Personal digital assistant
Video game
Metropolitan area network
Freeware
Computer animation
Software
Open set
Loading...
Feedback

Timings

  443 ms - page object

Version

AV-Portal 3.8.0 (dec2fe8b0ce2e718d55d6f23ab68f0b2424a1f3f)