This Instructable modifies two other guides. Just got a Magnetic Sensor hooked up with door status on page.

Step 1: Do This Instructables First

<p>I got everything showing up internal and external. However, after I completed step 1 it would control the garage door. Now that I have gone through this part of the instructable to add video the button to control the garage door no longer works. Any ideas on how to fix this?</p><p>Not sure if it is in the step 6 part. The parts that say /user/local/... are not showing up green like in the picture on the step. Only the word local is green.</p>
I can only get it to work local. With port forwarding only the button shows up.
<p>The poster did not give completely correct instructions to make it work correctly from outside your network, even if you completed the port forward properly on the Pimylife page. It should work from inside your network fine though.</p><p>The reason is because you cannot use a private IP address in the index.php file where it says &lt;img src=&quot;http://192.168.x.x:8081&quot;&gt; it should say &lt;img src=&quot;http://a.b.c.d:48461&quot;&gt; where a.b.c.d is your WAN IP or DDNS hostname. To find your WAN IP and have it working immediately, go to www.whatismyip.com. If you have a dynamic WAN IP with your ISP, at times this will change, but there is a workaround for this. You can either buy a static IP address from your ISP, or go to freedns.afraid.org and set up a free Dynamic DNS account, and download a freedns.afraid.org updater client so when your ip changes, it will automatically update on the site. You still need to log into your freedns account every 3-6 months or so, so it does not get automatically inactivated (or pay for their service). </p>
<p>Thanks for the info. I did what you said and it now it works while on my cell phone on LTE. </p><p>I have port forwarding for port 80 the status, control, video page. </p><p>I have port forwarding for port 8081 the mmal-motion stream.</p><p>&lt;body&gt;</p><p> &lt;img style=&quot;-webkit-user-select: none&quot; src=&quot;http://acbsdsds.ddns.net:xxxxx/&quot; width=&quot;980&quot; height=&quot;735&quot;&gt;</p><p>&lt;div class='awrap'&gt;</p><p> &lt;a href='/?trigger=1'&gt;&lt;/a&gt;</p><p>&lt;/div&gt;</p><p> &lt;/body&gt;</p><p>Now video doesn't work when in my local network. How could I recode to figure out I am on wifi at home?</p>
<p>Now this is a much more router specific question. Sometimes, when a PC is requesting a URL/resource that is external to your network, but actually points back to a device that is internal to your network, your router does not like to forward those requests properly. What you need is a 'reflective' (also sometimes called 'reflexive') rule in your firewall/router to allow those internal-&gt;external-&gt;internal requests to be processed. </p><p>Basically when you port forwarded those ports to an internal address, you also need a rule to allow internal addresses to do their NAT before and then again after it comes back from the WAN. It could be called a number of things on your router, Reflective NAT, Virtual Host, Virtual server, Static NAT, etc. </p><p>If you want to PM me your router/firewall make and model, I can research it and help you through it.</p><p>Here is another explanation I found online: </p><p>The most common problem is that your gateway rewrites the destination<br> address of the packet to the internal server, but not the source. So, <br>when the internal server responds it sees that the packet came from <br>something on the local network, sends back the packet directly - and the<br> client can't tell this is from the server, because the packet still has<br> the internal, not the public, address on it.</p><p>The standard fix is to force the traffic to come back through your <br>gateway. One way to achieve that is to put the server that the public <br>address redirects to in a &quot;DMZ&quot;, so that traffic between the client and <br>the server has to pass through the router.</p><p>The other way is to also apply NAT to the source address of internal <br>connections to the external IP, so that they look like they come from <br>the gateway. The internal server will then respond to the gateway, that<br> will undo <em>both</em> NAT changes, and send the packet back to the internal client.</p>
<p>Thanks for this instructable, finally got around to doing it. I had to change a few things because your code for &quot;index.php&quot; had a file called &quot;output.php&quot; underneath it, which would give an error when I tried to download it (not sure what it is) but then I just read off of your screenshot to make my page. <br><br>I set up an openvpn server on my ac66u router (running merlin) and can connect to that when I want to check my garage door remotely, just a quick tap on the vpn connect icon and then I can use the normal webpage shortcut on my phone, I get video feed and functionality with this method and it is more secure than opening ports. <br><br>Now what I want to do is somehow setup android notifications for when the door opens and closes as well, this way, if I inadvertently hit the button I will at least get notified of it. <br><br>I have a veralite home automation server setup (and hue/lux lights, wemo switches, nest, dropcam, etc) so I have managed to setup some handy shortcuts by using an app called authomationhd to create one tap garage door operation from my phone's home screen, this method does not require any port forwarding or vpn as it uses the vera backend. I made sure to put the button in a folder on my homescreen for now so that I do not accidentally push it (until I get notifications working at least).</p>
<p><a href="http://www.bc-robotics.com/bcrforums/topic/magnetic-door-switch-raspicam-to-pushbullet/">http://www.bc-robotics.com/bcrforums/topic/magneti...</a></p><p>For Pushbullet for Python. I did close too but too many false edge detects.</p>
<p>Sorry about the file that won't download.</p><p>I'll edit the instructable with current code for the index.php.</p>
<p>Here are some pics, night here now so there is nothing to see on the video (but it is working!) I also used the magnetic door sensor.</p>
<p>I would also like to make the page automatically refresh every so often or find a more elegant way to update the status at the top of the video feed (door open, door closed). Some way to activate the trigger, wait X seconds, then update just that line of the page. I have no clue what I am doing with that sort of thing though.</p> how would get the video without the IP address and port 8081? Even with port forwarding I cannot get video to load outside my local network.

About This Instructable




More by pber:Raspberry Pi Garage Door Opener with streaming video of door status. 
Add instructable to: