Light Switch only monitor [SOLVED]

Started by megasis, May 04, 2015, 11:59:50 PM

megasis

Since I had the previous version  GarageMote Gateway installed 2 weeks ago, it was very easy to install this  ;D , just copy images and sounds folders, and replace old JS and PHP files  8) .

At first, I had some issues with permissions  :( , images were not showing on the page, so to make it work I just set the permissions to rw-r--r-- to all the new files and change the owner to root to the  JS and PHP files:

cd /var/www/default/images
chmod 644 *
cd /var/www/default/sounds
chmod 644 *

For the JS and PHP files in /var/www/default and /home/pi/moteino, I recited the commands I used 2 weeks ago:

chown root *.js *.php
chgrp root   *.js *.php
chmod 644  *.js *.php

After this the Pi Gateway started working  :) , I just need for each node to register by Open the Garage or by turning On the SwitchMote (Simulator)

The only issue I'm having is with the Switch Mote (simulation), I can't turn the Light Switch ON or OFF from the Gateway page (iPhone), it only show the status (see screen shots) , could it be I'm using an old Sketch? I don't think so  ???.

I will continue testing, I've will post any update.

Thanks for this amazing new interface

megasis

Just a correction, I didn't test the Garage-Mote because last night because it was too late (pass mid night) and I didn't want to wake up my family, but this morning I tried to Open the garage and it didn't work either  :( None of my nodes respond to the Gateway, they only send status.

So I need to check the stack again, most likely, I will backup my current SD and install a new and clean Raspbian image and follow step by step the installation of the Pi gateway.

I'll keep posting

Felix

FYI I just updated the GarageMote example. Let me know how you make progress.

megasis

I completed a fresh install of Raspbian and the Pi Gateway stack, so this is the Update:

Switch Mote is working fine now  ;D, after replacing the sketch GarageMote_Base.ino with the new  PiGateway.ino

Never the less, the GarageMote stop working  :(

I downloaded the GarageMote.ino (updated 19 hours ago) and made little changes:

- set my Encryption key
- commented the line  //#define IS_RFM69HW
       
Now every time I send a Refresh or Open command from my iPhone I get these in the monitor:

**** SCHEDULED dbLogRecycle to run in ~16.82hrs
NEW CONNECTION FROM 127.0.0.1:42036
NODEACTION: {"nodeId":11,"action":"OPN"}
>: ACK:NOK
NODEACTION: {"nodeId":11,"action":"STS"}
>: ACK:NOK
NEW CONNECTION FROM 127.0.0.1:42050
NEW CONNECTION FROM 127.0.0.1:42057
NODEACTION: {"nodeId":23,"action":"BTN1:0"}
>: ACK:OK
>: [23] BTN1:0   [RSSI:-31][ACK-sent]
   [23] DB-Updates:1
NODEACTION: {"nodeId":23,"action":"BTN1:1"}
>: ACK:OK
>: [23] BTN1:1   [RSSI:-31][ACK-sent]
   [23] DB-Updates:1

So, I put back the old GarageMote.ino but still I get the same ACK:NOK

I guess this is related to the new PiGateway.ino, the light was fix with this new gateway but it cannot get Acknowledge from GarageMote

Attached you'll find a screenshot, where you can see the GarageMote last action was 10 hours ago, regardless all the test I've done ever since.

For now, I will backup my SD card with current stack, this was a full fresh install of Raspbian and Pi Gateway stack, so I don't want to lose it.

Thanks in advance for all your help on this


megasis

All is working now  ;D
The problem was I forgot to comment this #define IS_RFM69HW on the GarageMote sketch  >:(.  I did comment that line on the SwitchMote sketch and that's why that one works.

Once I have all 3 nodes talking on the same RFM69 , SwitchMote and GareMote can be controlled from my iPhone  8)

Thanks Felix for all your help on this.  ;)

Felix

Awesome, someone getting it to work means it is achievable :)

megasis

Felix,
We are very happy this is working, I'm waiting on some Budget Approval from my Wife  ::)  mean while I have a Question about Event configuration:

Have you release Sending Text or Email?  for example, having a MotionMote node triggering a Text when it detects movement between 8am and 5pm (Work Days).  I know I installed nodemailer on the PiGateway, but I couldn't find any information of how is this configured. 
Silly question, can we use one of many Email services like gmail, AOL or Yahoo? I know I learn how to send email in Python using my own account in AOL.

Should I create a new post for this email question?

Thanks in advance for all your help on this.

Felix

The magic is all in the top of the gateway.js file. Look for the functions that send email, you have to populate a few fields
AT&T has an email corresponding to your cellphone and if you send an email to that address it will send your cell a SMS, i suspect other carriers have that too. The same way you can of course send yourself and email directly. Just fill in your gmail account and password or app unique password configured in gmail and you're ready to call that function to send email or SMS.
Then open metrics.js and look for the example event for "motionSMS" and you can verify the server time and only call the SMS function if the MOTION occurs in your time window.
If you copy that example make sure you rename the key to a unique event Id, ie make it "motionSMS_8to5"

megasis

Felix,
I'll work on this this weekend (at least Saturday) and let you know how it goes.
Thanks!!  8)