LowPowerLab Forum

Hardware support => Projects => Topic started by: tomek on May 13, 2014, 08:34:09 PM

Title: GarageMote Kit
Post by: tomek on May 13, 2014, 08:34:09 PM
Hello Fenix, or anybody experienced,

(First, I am sorry for my english if there will be any mistakes in the text below :) )

I'm interested in make own garage management using raspberryPi.
I have already read several times your manual about how to make it (home automation gateway), but some things are still not clear for me.
It may be caused because I am not a good and practised electrician :) but anyway, Im still interested.

Ok, I would like to ask you some questions before I order the "GarageMote Kit".

1.) I have garage for two cars, with two separated doors and motors.
     Is it possible to controll them only with 1 raspberry device or I need two, one for each door?

2.) My plastic belt is surrounded with metal strips (see picture below #1 and #2), so the question is: 
    Can I rotate both magnets into inner side to ensure that they will push off that metal strip out?  Will the sensors (open/close) works without any problems then?
    (Sorry, if my description was little bit complicated)

   picture #1
   http://imgur.com/a/8eCfZ#0 (http://imgur.com/a/8eCfZ#0)

   picture #2
   http://imgur.com/a/8eCfZ#1 (http://imgur.com/a/8eCfZ#1)

3.) Can you please also advise me, HOW can I or WHERE can I solder/connect rest two cables (white/orange) for door action into MY opener according to taken photo please? (picture below #3 and #4)
    (It would be better if you could highlight it with some color)

   picture #3
   http://imgur.com/a/8eCfZ#2 (http://imgur.com/a/8eCfZ#2)

   picture #4 (disassembled)
   http://imgur.com/a/8eCfZ#3 (http://imgur.com/a/8eCfZ#3)

4.) If I order the red one USB version of Moteino boards, will the pins needed for soldering with GarageMote board same as it was on photos with green one?
     Or simply..is there any difference about soldering/mouting/connecting pins ?

5.) What function has the light orange cable in top of Moteino board on this picture please?
     http://farm3.staticflickr.com/2870/10048258734_24ca874ba1_o.jpg (http://farm3.staticflickr.com/2870/10048258734_24ca874ba1_o.jpg)

Thank you in advance guys!


Title: Re: GarageMote Kit
Post by: Felix on May 13, 2014, 08:51:53 PM
Let me try to answer these... I'm Felix by the way, but I like Fenix, sounds more like a city I lived in, but pretty cool ;)

1) Yes you can control as many as you want. But out of box my software only supports one, I gave that as an example, so you can make code changes and customize in any way you want.
2) Haven't seen that type of opener, it's up to you to improvise or use different sensors if hall effect sensors won't work. But those are probably the cheapest/easiest way to tell if a magnet is in position or not. Use your imagination to get around the difficulties.
3) See #2, i have no idea how your opener operates. US openers have a wall button that connects to the opener unit with 2 wires. The GarageMote kit has a relay which connects at the same 2 spots, basically a contact closure which is equivalent to pressing the button on the wall.
4) You could use the MoteinoUSB on the GarageMote, it's up to you, then you can power it with a USB mini cable, or still 2 wires on the GND+VIN headers
5) The orange and yellow wires connect the base moteino to the raspberry pi serial (TX,RX)
Title: Re: GarageMote Kit
Post by: tomek on May 14, 2014, 05:33:16 AM
Thank you for your quick response!

Yes, Indeed Felix , Im sorry for that :)

Anyway, I apprechiate your help!

Yes you are right. I have realised that I should mount magnet directly on slider in rails, and distribute sensors so that one will be placed on the begin of rails and second will be placed at the end. (So easy? :D )

Meantime I have found detailed PDF manual for my opener, and there is also option how to controll door with switch placed on wall.
This should be very helpful for whoever has this kind of opener and needs to control it with raspberryPi.
On the opener's board there is connector named "PP" and it has in charge door actions -> this should be connected with relay on GarageMote board.
For more details, here is the link on manual:
http://www.linkcare.net/manuals//nice/Gate/SPINBUS_ISTSPINR3.pdf (http://www.linkcare.net/manuals//nice/Gate/SPINBUS_ISTSPINR3.pdf)

Thanks, but I was asking on thin light orange cable at the top of picture, instead of wires at the bottom.
I meant that one which is on photo in top left side.


Title: Re: GarageMote Kit
Post by: Noble7ven on January 10, 2015, 11:26:37 PM
Hi Felix!

I'm a newbie to this website but having googled "Garage Door Opener App" I came across many websites/items showing me various ways of doing what I wanted. I wasn't at all interested in any of them until I came across your video on Youtube. (
) Thus your video has led me to your website and a future that looks promising for myself and any who stumble across your website.

I have a couple quick questions for you (or anyone who has completed this task and would like to help a newbie out ) on getting myself up and running with the GarageMote.

1. I am trying to compile a list of items I need to get going with this project and I would just like to verify them with you:
Raspberry Pi/Inside the home Location:
 - Raspberry Pi
 - AtxRaspi
 - Moteino ( Which model? )
   * Receiver *
 - Power button/switch

Garage Door Location:
 - Garage door and equipment
 - GarageMote Kit
 - Moteino ( Which model? )
   * Sender *

Various tools:
 - Ethernet cable ( I know is in the GarageMote Kit)
 - Soldering tools and equipment
 - Soda and some good tunes

Am I missing anything and if so could you please let me know where I am lacking?
I have seen your other posts/videos on a Home Automation series and would like to make sure I can easily expand into that in the future (If there are any adjustments to the Raspberry Pi Station/Location could you recommend those as well?)

I wish everyone all the best and would like to thank you for putting this stuff up for everyone to see!

Title: Re: GarageMote Kit
Post by: Felix on January 11, 2015, 09:57:25 AM
@tomek - Sorry, I think I missed your last question. The light orange single wire at top left is the antenna for the receiving Motieno connected to the PI, it's a single wire that is only connected to the ANT pinhole on the Moteino.

@Noble7ven - The ATXRaspi is optional but nice to have so you can shutdown your Pi manually. You will need a button and optional LED for indication to go with it. I also have preselected a LED (power symbol green LED) momentary button with panel mount ring that is offered in the store if that is something you find convenient.

I would recommend Moteino+RFM69 868/915mhz for all your Moteinos (rx and tx), you can use that anywhere depending on your band (868 in EU, 915 elsewhere, just set your setting in the sketches). The hardware and software implementations are documented here:


GarageMote kit is currently out of stock, I need to release a new GarageMote kit that will include magnets and more features, this should happen in the next few days. I think I will provide the 8-wire cable (cat5 ethernet) so you can solder your sensors and connect to the opener. It will also come with unipolar sensors that means they will trigger on ANY magnet pole. I think you got everything else correct.
Title: Re: GarageMote Kit
Post by: Noble7ven on January 26, 2015, 02:23:55 AM
Hi Felix! and other LowPowerLabbers :)

I have a quick question for you.

I'm currently installing all the packages and goodies on the Raspberry Pi for my Garagemote.

However I have ran into a snag. I am getting caught up on the part where I put in my Raspberry Pi's address in another browser on another machine and testing to see if the "Warning Screen" for the SSL cert to come up but it will not. I've tried the following:
 1. I've tried reformatting my SD Card and going through the entire install process twice (Starting on http://lowpowerlab.com/blog/2013/10/07/raspberrypi-home-automation-gateway-setup/ ) and nothing :(
 2. I've set up a static IP on the Raspberry Pi itself and have "reserved" the Ip address for my raspberry pi on my router as well. - Still nothing :/

I'm at an impass and am looking for guidance. I know this is a vague question/plea for help but I'm wondering if you or anyone in this community has come across this problem? I'm still motivated and hopeful to get this resolved. :)

I greatly appreciate all the help!


Title: Re: GarageMote Kit
Post by: Felix on January 26, 2015, 08:56:01 AM
If I understand this right, you cannot reach the Pi at all, so your browser times out, correct?
That means you can't resolve the Pi's address. Make sure your nginx service is running, and running on port 80 (it should be 80 from the setup).
Ping the Pi to make sure you can at least reach its IP address. Then you gotta make sure the webserver is running.
There's another part in the setup where you have to forward port 80 for external use from outside your own LAN, I think you don't have that issue or you're not there yet.
Title: Re: GarageMote Kit
Post by: Noble7ven on January 27, 2015, 01:01:29 AM
Hi Felix, and my fellow LowPowerLabbers!

So update to the previous post. I was having trouble connecting to my Razzy Pi through another computer on my network to get to the SSL warning page. 
- I was able to ping the address of my Razzy pi
- Made sure the nginx service was running
- I was stuck on the "sudo service nginx restart" portion and was coming back with this error:
"Restarting nginx: nginx: [emerg] "worker_processes" directive is duplicate in /etc/nginx/nginx.conf:30"
However, I dug into the forums and found your Github repo with a working nginx.conf file and copied over its contents and was successful in moving on.

I'm currently on the "Raspberry Pi home automation gateway - Hardware and Demo page (page4) :D and am super excited, but have run into a small snag with the gateway.js file.

If I use the gateway.js material on the webpage itself, it will throw an error with the following:
pi@raspberrypi ~/moteino $ node gateway.js &
[2] 3088
pi@raspberrypi ~/moteino $
io.configure(function () {
TypeError: Object #<Server> has no method 'configure'
    at Object.<anonymous> (/home/pi/moteino/gateway.js:8:4)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

If I use the gateway.js output from the Github repo I get the following error:
pi@raspberrypi ~/moteino $ node gateway.js &
[2] 3091
pi@raspberrypi ~/moteino $
        throw er; // Unhandled 'error' event
Error: listen EADDRINUSE
    at errnoException (net.js:904:11)
    at Server._listen2 (net.js:1042:14)
    at listen (net.js:1064:10)
    at Server.listen (net.js:1138:5)
    at Server.listen.Server.attach (/home/pi/moteino/node_modules/socket.io/lib/index.js:214:9)
    at new Server (/home/pi/moteino/node_modules/socket.io/lib/index.js:51:17)
    at Function.Server (/home/pi/moteino/node_modules/socket.io/lib/index.js:39:41)
    at Object.<anonymous> (/home/pi/moteino/gateway.js:1:93)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

I'm not sure how to proceed from this point and I don't want to do it as tired as I am (heck I didn't think I would get this far so I'm keeping positive :) ).

If you guys have some insight on how to correct this I would be very much obliged / thankful to hear from the more knowledgeable folks here :)


Title: Re: GarageMote Kit
Post by: Felix on January 28, 2015, 12:56:39 PM
I've updated page-4 of the setup to use the correct configure (which was removed in socket.io at some point and replaced with io.use).
It's the same code used in the full gateway.js script (https://github.com/LowPowerLab/RaspberryPi-Gateway/blob/master/gateway.js).
The error you're getting is indicative of wrong socket.io version or some kind of versioning mismatch/conflict. I've not seen that error before but you need to make sure the versions of everything you installed are at least at the versions shown in the walkthrough. For this particular error I would check the versions of node and socket.io first.
Title: Re: GarageMote Kit
Post by: ssmall on January 28, 2015, 03:39:04 PM
The Error: listen EADDRINUSE indicates another process is listening on the port.  I think it's 8080.  Make sure only one process at a time is listening on a given port.
Title: Re: GarageMote Kit
Post by: Noble7ven on January 29, 2015, 01:04:37 AM
Hi Felix!, ssmall!, and my fellow friends,

Well I would like to tell you how much fun (and sometimes pain) I am having putting this awesome project together.

I have re-read the entire walk-through on how to put the GarageMote together and had missed in the beginning "http://lowpowerlab.com/blog/2013/10/07/raspberrypi-home-automation-gateway-setup/ (http://lowpowerlab.com/blog/2013/10/07/raspberrypi-home-automation-gateway-setup/)" with enabling the serial port for GPIO. I have now done that (I'm hitting myself for missing something like that) and have moved on.

As far as the errors I was getting and your recommended course of action:
 - First thing I did yesterday was learn how to make an image of a Razzy-Pi setup so I can start at a set point (I have messed up a couple times along the way and was tired from starting over) :)
 - I've updated the files (gateway.js) to the latest that you have supplied in the walk-through/last reply.
 - I have double checked the versions of all the programs listed and they are all at the same version with what you have documented.
 - I'm thinking I may have tried to start the nodes more than once hence why I was getting those errors in the first place. (I could def. be wrong though, just a guess)
**Should I have both nodes running at the same time (chat.js and gateway.js)?? Or does this fall in line with "ssmall's" comment about processes/ports and that they are clashing?
The Error: listen EADDRINUSE indicates another process is listening on the port.  I think it's 8080.  Make sure only one process at a time is listening on a given port.

 - On the 4th page of the tutorial for the gateway.js file there is a part where it states:
        // change "/dev/ttyAMA0" to whatever your Pi's GPIO serial port is
        var serial = new serialport.SerialPort("/dev/ttyAMA0", { baudrate : 115200, parser: serialport.parsers.readline("\n") });

**I'm lost on what the Pi's GPIO serial port is? I know I set the baudrate to 9600 with the minicom install so I'm confused as to why this part would be different? My gateway.js file still has the default "/dev/ttyAMAO" in it as I am awaiting clarification on what I should put in or just leave it.

 - I was however able to jump on to my Pi's Address, enter in the un:pw and see the following website!(I have assembled both moteino's but have not given them the sample code you have provided).
 I feel like I am pretty close! :) I cannot wait to get to the finished product with many thanks to yourself Felix and this awesome community you have fostered to grow.

Title: Re: GarageMote Kit
Post by: Felix on January 29, 2015, 06:32:08 AM
Looks like you're pretty close. This is a typical steep learning curve and it's nothing unusual, so hang tight.
The ttyAMA0 (ends in digit zero not in letter O) is the default serial port (RX TX pins) on the GPIO header of the Pi. I think in recent distributions it is enabled by default (in older ones it was reserved by the system console). Serial is asynchronous meaning there are only 2 wires and no clock, so both ends communicating have to "agree" on the rate of speed at which data is moving. So if you open the port at 115200 it means the Pi serial port expects the data to come in at a rate of 115200 bits per second from the Moteino. You have to connect the Pi TX to Moteino's RX and vice versa. I think if you leave the settings as the given defaults in my scripts it should work as long as you have your ttyAMA0 port available/enabled.
Also, only 1 process can use 1 serial port at 1 time, meaning you can have as many running scripts as you want but only 1 can tie up/reserve the serial port. If reserve it, then try to reserve it again it will throw an error. For your purposes you should only have the gateway.js running. The chat.js was for learning how the whole stack works. I guess you could run both if you really wanted but the end goal is to have the gateway running and that needs the gateway.js script.
The minicom install is just another program that can use the serial port, useful to test that you are getting data from the Moteino.
Title: Re: GarageMote Kit
Post by: Noble7ven on January 30, 2015, 01:17:03 AM
Hi Felix and fellow friends!

Thanks for replying so quickly to all my previous questions/posts.
After reading your last post tonight Felix, I had decided to rock and roll with the programming of the Moteino's tonight but my motivation was quickly ebbed. I delved into the posts/forum topics to see if I can find a step-by-step tutorial on how to program these bad boys but couldn't find anything that I could comprehend.

I have read the README.MD (https://github.com/LowPowerLab/WirelessProgramming/blob/master/README.md) file and see that I need to do a few things to get each Moteino up and running but I'm still lost in the sauce on how to upload the codes/firmware onto the Moteino's themselves. If I'm reading the sites right, it is only a few more steps until these puppies are singing with send and receive traffic!
Uploading the codes/firmware
 - Can I upload the codes/firmware wirelessly? -OR-
 - Would I need an FTDI cable and/or AVR programmer with a program to do it?

 - Would you recommend uploading the codes/firmware to the Moteino's on another device other than the Razzy Pi?

I know to some these questions may seem silly to the veterans here but I'm a noob/learner in the process. I will be kicking myself if I don't ask questions so I would like to say that really am thankful for any and all the help provided to me. :)
Still staying positive though and I am enjoying the learning process that is involved with this project.

Title: Re: GarageMote Kit
Post by: Felix on January 30, 2015, 08:56:53 AM
Please see this page and the programming section to get you started: http://lowpowerlab.com/moteino/
Title: Re: GarageMote Kit
Post by: Noble7ven on February 08, 2015, 06:03:17 PM
Hi fellow low power labbers,

I've finally received the ftdi adapter. I have set up my libraries according to the install page from adafruit.

Here are the libraries in the folder. No dashes all underscores.
(http://s23.postimg.org/s0yy427xj/library.jpg) (http://postimg.org/image/s0yy427xj/)

I do get this error when trying to verify/uploading to the moteino.
(http://s29.postimg.org/n9u3zxd7n/error.jpg) (http://postimg.org/image/n9u3zxd7n/)

Not sure where to go from here.


Title: Re: GarageMote Kit
Post by: ssmall on February 08, 2015, 07:17:44 PM
Make sure you have shutdown all instances of the Arduino code editor after you have installed the libs.  do the files WirelessHEX69.h and WirelessHEX69.cpp files exist under the WirelessProgramming_master directory?
Title: Re: GarageMote Kit
Post by: Noble7ven on February 08, 2015, 08:54:01 PM
Hi ssmall,

I've made sure that I have those files in the pertaining folder underneath the WirelessProgramming_master dir.
(http://s12.postimg.org/xjqqflg55/screenshot.jpg) (http://postimg.org/image/xjqqflg55/)

And here is the error that I get when I make sure that all instances of arduino are closed then I open up Arduino IDE.
(http://s23.postimg.org/96rn7julj/error.jpg) (http://postimg.org/image/96rn7julj/)

Thanks for the help ... i'm not well versed.
Title: Re: GarageMote Kit
Post by: ssmall on February 08, 2015, 09:07:53 PM
According to your first image, the directory that is referenced is SPIFlash_master not WirelessProgramming_master.  The problem is that the compiler cannot find WirelessHEX69.h.  What directory is that file in?
Title: Re: GarageMote Kit
Post by: Noble7ven on February 09, 2015, 12:33:44 AM
Hi ssmall,

The wirelesshex69.h is in is own folder.
(http://s17.postimg.org/ux1hiklfv/wireless.jpg) (http://postimg.org/image/ux1hiklfv/)

I was thinking that the only two folders I needed was the RFM69 and SPIFlash?

Title: Re: GarageMote Kit
Post by: Felix on February 09, 2015, 07:51:15 AM
The name of the library folder is wrong. Remove "_master". It has to match the name of the library files themselves ......
Title: Re: GarageMote Kit
Post by: Noble7ven on February 22, 2015, 08:50:23 PM
Hi Felix and Fellow Friends,

I was able to upload the sketch's to the moteino's! It was all down to using a smaller cord rather than the 4ft one I had.

Now that the moteino's are working I am stuck yet again ... I swear I do hope I can get this going some time haha.

The moteino's themselves with the hall sensors can detect the magnets and then report the position of the garage door. However it will not report anything when I ask for a status. I also cannot hear the relay click on and off when I go to click open/close the garage.

I've checked all the solder points and they are good to go. Not sure but I'm thinking it is a hardware error (On my part) than anything else.

I will include a photo of what the webpage outputs and the recent is it trying to query a status but outputting nothing.
(http://s12.postimg.org/pu0msjeux/upload1.jpg) (http://postimg.org/image/pu0msjeux/)

Title: Re: GarageMote Kit
Post by: Felix on February 23, 2015, 08:21:27 AM
The guide walks you through and tells you how to test it on your bench before you install it. It's easier to debug there than after being placed on your opener. It's another small detail somewhere, just impossible to guess what you might have missed :)
Title: Re: GarageMote Kit
Post by: Noble7ven on February 25, 2015, 01:11:14 AM
Hey Felix, :)

I have given it a proper go with testing the GarageMote base through the Ftdi chip using Arduino terminal. I was able to move the magnets back and forth to register as well as entering "r" for the relay test and I can hear the sweet click of it working :)
(Using this page http://lowpowerlab.com/garagemote/#programming)
(http://s9.postimg.org/h8irwfior/terminal.jpg) (http://postimg.org/image/h8irwfior/)

However when I unplug the GarageMote base from the computer and plug it in to the wall with the 5v power adapter, I get the same time_out with trying to query its status through the webpage. I'm not really sure on what would cause this disconnect.
 - I have double checked to make sure I have the most current index.php off of Github which I do.
 - I have triple checked to make sure I have the following:
    *node -v   (0.10.28)
    *npm -v    (1.4.9)

(http://s8.postimg.org/7mvrxrgn5/upload1.jpg) (http://postimg.org/image/7mvrxrgn5/)

I might do a clean install and start from scratch with the raspberry pi portion ... it can't hurt me much since I've been at this for a couple months now haha.

Just like you mentioned before, I have a feeling it is probably the smallest detail I'm missing but just wanted to share my struggles with hopes this helps someone in the future going through what I am.

Thanks again Felix and ssmall for all the help the both of you have provided to me along my journey. When I am able to finally get this working I shall buy you guys a beer or whatever beverage you guys prefer.

Title: Re: GarageMote Kit
Post by: Felix on February 25, 2015, 10:52:01 AM
Take baby steps, isolate the problem by testing each individual part. First make sure the GMote can talk to the gateway Mote and that the gateway can send and receive messages to your garage mote. Once that is working you should verify your webstack. The nodejs script has to be able to be forwarded through the nginx webserver. All those details are included in the blog page of this setup. That is a fine mechanism with several essential components that all have to be setup right otherwise your webpage might load but if it can't talk to the websocket nothing will work.