The Vera Community forums have moved!

Advanced => Plugins & Plugin Development => Programming => Caddx/GE/NetworX NX-584/NX-8E Security System => Topic started by: futzle on February 01, 2014, 11:10:25 pm

Title: UI6 readiness
Post by: futzle on February 01, 2014, 11:10:25 pm
Edit:  From version 75 onwards, this plugin should work on UI5 and UI6.
Title: Re: UI6 readiness
Post by: futzle on April 25, 2014, 03:11:36 am
I've bitten the bullet and updated my production Vera to 1.6.641.  (Once you get past the scary default UI and into the Advanced UI it's not that bad...)

With the update I noticed that my conversion of the JavaScript tabs to jQuery was incomplete.  I've now fixed up the remaining tabs so that they work.  I've done minimal testing, so there may still be weirdnesses.

Version 75 is now sitting with MCV for approval.  It should still work on UI5; if not, please tell me.
Title: Re: UI6 readiness
Post by: ke2nny on June 21, 2014, 01:08:00 am
I upgraded my Vera Lite Firmware to UI6 without issue and everything seem to work fine.  I accidently deleted my Caddx NX584 Security System app, so I also deleted my GC100 app.  I tried to re-install everything, But the Connect tab of the Caddx NX584 will not open, so I can enter the serial information.  I have had everything working for the past 2 years, so I would appreciate any help I can get.
Title: Re: UI6 readiness
Post by: futzle on June 21, 2014, 04:13:38 am

I accidently deleted my Caddx NX584 Security System app, so I also deleted my GC100 app.  I tried to re-install everything, But the Connect tab of the Caddx NX584 will not open, so I can enter the serial information.

You can bypass the Connect tab if necessary.

If you have a direct serial connection, or if your GC100 has created a virtual IPSerial port, assign the port to the plugin at Apps > Develop Apps > Serial Port Configuration.

If you are using some other serial-to-IP gateway then you can type the IP address and port number (format: 12.34.56.78:9012) in the IP Address field towards the top of the Advanced tab of the security system plugin device.

Then save, refresh your browser, etc etc

Once you've got it working again then I would like you to help me debug the broken Connect tab, because it should be working (and is for me).
Title: Re: UI6 readiness
Post by: ke2nny on June 21, 2014, 11:37:14 am
GC100 creates a virtual IPSerial port, and it has assigned a port to the plugin at Apps > Develop Apps > Serial Port Configuration

I have included 2 screen shots.  All the other tabs on the Caddx NX584 work fine, it's just the Connect tab.

Title: Re: UI6 readiness
Post by: futzle on June 21, 2014, 06:18:06 pm

GC100 creates a virtual IPSerial port, and it has assigned a port to the plugin at Apps > Develop Apps > Serial Port Configuration

Great. All you have to do is click on the drop down "Used by device" and change "Please select" to the Caddx plugin device. Then save. By doing this you are doing exactly the same as what you would do on the plugin's Connect tab.

Clearly there is a bug in the code for the Connect tab that barfs when there is an IP serial port. (I don't have any any more so I wasn't able to fully test the UI6 migration.) I will need to change around a few things on my Vera to reproduce the bug, which will take time. So to get yourself going right away, do the workaround in my previous paragraph. If you're adept at JavaScript debugging and can pop up the error console on your browser to get the error message and line number then I can probably fix it faster.
Title: Re: UI6 readiness
Post by: ke2nny on June 21, 2014, 10:27:14 pm
okay, the red indicator on the Caddx NX584 has turned to normal, but Partition1 was not created.  I tried my hand at debugging, but I don't get anything when selecting the Connect tab.  The information below is from pressing the other tab. I am trying to help as much as I can with very limited knowledge


2014-5-21 22:22:55 : remove keep                                                                                                        cpanel_data.js?*1.6.641-1-16070424*:13681
2014-5-21 22:23:1 : String.prototype.evalJSON error: SyntaxError: Unexpected identifier                          cpanel_data.js?*1.6.641-1-16070424*:13681
2014-5-21 22:23:9 : String.prototype.evalJSON error: SyntaxError: Unexpected identifier                          cpanel_data.js?*1.6.641-1-16070424*:13681
2014-5-21 22:23:12 : String.prototype.evalJSON error: SyntaxError: Unexpected token :                          cpanel_data.js?*1.6.641-1-16070424*:13681
Uncaught TypeError: Cannot read property 'u:LogEventScanResponse' of undefined
Title: Re: UI6 readiness
Post by: ke2nny on June 21, 2014, 10:34:56 pm
This is what I get when I scan for zones:

2014-5-21 22:31:53 : start parsing lu_status cpanel_data.js?*1.6.641-1-16070424*:13681
2014-5-21 22:31:53 : Starting parseLu. cpanel_data.js?*1.6.641-1-16070424*:13681
2014-5-21 22:31:53 : 22:31:53:553 end parsing lu_status cpanel_data.js?*1.6.641-1-16070424*:13681
2014-5-21 22:31:56 : String.prototype.evalJSON error: SyntaxError: Unexpected token :                          cpanel_data.js?*1.6.641-1-16070424*:13681
Uncaught TypeError: Cannot read property 'u:ZoneScanResponse' of undefined J_CaddxNX584Security.js:456
2014-5-21 22:31:57 : String.prototype.evalJSON error: SyntaxError: Unexpected token :                          cpanel_data.js?*1.6.641-1-16070424*:13681
Uncaught TypeError: Cannot read property 'u:ZoneScanResponse' of undefined J_CaddxNX584Security.js:456
2014-5-21 22:31:57 : String.prototype.evalJSON error: SyntaxError: Unexpected token :                          cpanel_data.js?*1.6.641-1-16070424*:13681
Uncaught TypeError: Cannot read property 'u:ZoneScanResponse' of undefined J_CaddxNX584Security.js:456
2014-5-21 22:31:58 : String.prototype.evalJSON error: SyntaxError: Unexpected token :                          cpanel_data.js?*1.6.641-1-16070424*:13681
Uncaught TypeError: Cannot read property 'u:ZoneScanResponse' of undefined J_CaddxNX584Security.js:456
2014-5-21 22:31:58 : String.prototype.evalJSON error: SyntaxError: Unexpected token :                          cpanel_data.js?*1.6.641-1-16070424*:13681
Uncaught TypeError: Cannot read property 'u:ZoneScanResponse' of undefined J_CaddxNX584Security.js:456
2014-5-21 22:31:59 : String.prototype.evalJSON error: SyntaxError: Unexpected token :                          cpanel_data.js?*1.6.641-1-16070424*:13681
Uncaught TypeError: Cannot read property 'u:ZoneScanResponse' of undefined J_CaddxNX584Security.js:456
2014-5-21 22:31:59 : String.prototype.evalJSON error: SyntaxError: Unexpected token :                          cpanel_data.js?*1.6.641-1-16070424*:13681
Uncaught TypeError: Cannot read property 'u:ZoneScanResponse' of undefined J_CaddxNX584Security.js:456
2014-5-21 22:32:0 : String.prototype.evalJSON error: SyntaxError: Unexpected token :                            cpanel_data.js?*1.6.641-1-16070424*:13681
Uncaught TypeError: Cannot read property 'u:ZoneScanResponse' of undefined J_CaddxNX584Security.js:456
2014-5-21 22:32:0 : String.prototype.evalJSON error: SyntaxError: Unexpected token :                            cpanel_data.js?*1.6.641-1-16070424*:13681
Uncaught TypeError: Cannot read property 'u:ZoneScanResponse' of undefined J_CaddxNX584Security.js:456
2014-5-21 22:32:1 : String.prototype.evalJSON error: SyntaxError: Unexpected token :                            cpanel_data.js?*1.6.641-1-16070424*:13681
Uncaught TypeError: Cannot read property 'u:ZoneScanResponse' of undefined J_CaddxNX584Security.js:456
2014-5-21 22:32:1 : String.prototype.evalJSON error: SyntaxError: Unexpected token :                            cpanel_data.js?*1.6.641-1-16070424*:13681
Uncaught TypeError: Cannot read property 'u:ZoneScanResponse' of undefined J_CaddxNX584Security.js:456
2014-5-21 22:32:2 : String.prototype.evalJSON error: SyntaxError: Unexpected token :                            cpanel_data.js?*1.6.641-1-16070424*:13681
Uncaught TypeError: Cannot read property 'u:ZoneScanResponse' of undefined J_CaddxNX584Security.js:456
Title: Re: UI6 readiness
Post by: futzle on June 22, 2014, 04:14:52 am
Thanks for the error console output. That's about what I would expect to see if the plugin hasn't even created the partition child device: the plugin has likely exited without completing its initialization.  Don't bother with the other tabs until the plugin has created the partition.

If you've got the connection configured properly then the child partition device(s) should pop up almost automatically. The fact that that's not happening tells me that there is a further problem between the plugin and the NX-584. A Luup log might provide a hint. Don't rule out the possibility that the issue is actually with Vera talking to the GC100.
Title: Re: UI6 readiness
Post by: futzle on June 22, 2014, 05:45:10 pm
Some screen captures of your Caddx device's Advanced tab would also help me a lot.
Title: Re: UI6 readiness
Post by: futzle on June 22, 2014, 06:29:04 pm
Here, try this version of the J_CaddxNX584SerialConnection.js file (unzip first).  For me, this makes the Connect tab show serial ports correctly.  I moved my USB-to-Serial adapter directly to the back of the Vera and successfully communicated with my NX-584.

As always, clear your browser cache, reload Luup.  Tested on Firefox.
Title: Re: UI6 readiness
Post by: ke2nny on June 22, 2014, 09:03:22 pm
I now have access to the Connect tab, but the partition still is not available.  I guess I will have to connect to my GC100 with my laptop to see if there is an output.  I'm almost 99% sure my GC100 is working properly, so I'm not sure why my setup no longer works.  I do thank you for all your help.
Title: Re: UI6 readiness
Post by: futzle on June 22, 2014, 10:12:21 pm

I now have access to the Connect tab,

Thanks for testing that. I will wrap it into the next release of the plugin.

Quote
but the partition still is not available

Catching a Luup log could probably pinpoint the problem from here. My theory is that there is something related to creating a set of devices completely from scratch, which of course I'm loath to test on my production system.
Title: Re: UI6 readiness
Post by: ke2nny on June 23, 2014, 04:03:51 am
Hope this is what you need:


Title: Re: UI6 readiness
Post by: futzle on June 23, 2014, 07:23:15 am

Hope this is what you need:

That's great. Now you just need to press the Reload button in the web UI immediately after you type the "tail" command. All the interesting stuff is logged right after a Luup restart. For bonus points, turn on the debugging checkbox in the Caddx plugin's Configure tab before you do it. You need only capture about 30 seconds.
Title: Re: UI6 readiness
Post by: ke2nny on June 23, 2014, 07:35:08 am
I followed you instructions:
Title: Re: UI6 readiness
Post by: futzle on June 23, 2014, 08:04:33 am

I followed you instructions:

Thanks. I will take a look at it soon. I'm not seeing the plugin's normal startup messages, which is odd. It looks a bit like the plugin is hanging while establishing the connection to the GC100. It's a little hard to tell looking at the log on my phone's tiny screen. When I've had a chance to see it on a real computer I will have a better idea.

Are you seeing any persistent messages in the web UI in the top centre? The log suggests that you are.
Title: Re: UI6 readiness
Post by: ke2nny on June 23, 2014, 08:59:26 am
I see a message stating, "Caddx NX584 Security System[25]:Failed to open IO Port"
Title: Re: UI6 readiness
Post by: futzle on June 23, 2014, 05:47:58 pm

I see a message stating, "Caddx NX584 Security System[25]:Failed to open IO Port"

Right. Then the plugin hasn't even started yet because it can't talk to your GC100.  The log you posted shows that the plugin is trying to connect to the right location, repeatedly. Your next steps are to verify that the UI6 update hasn't broken your GC100 link. See if there is anyone else on the forum with a GC100 and UI6; I recall another topic in the last couple of months.
Title: Re: UI6 readiness
Post by: ke2nny on June 24, 2014, 08:06:38 pm
I was able to get it all working by reverting to a backup I made right after I upgraded.  I re-added the Connect tab fix and now everything is working correctly.  I thank you again for all the time you dedicated to my issue.  Thanks!!!!
Title: Re: UI6 readiness
Post by: futzle on June 24, 2014, 09:59:56 pm

I was able to get it all working by reverting to a backup I made right after I upgraded.  I re-added the Connect tab fix and now everything is working correctly.  I thank you again for all the time you dedicated to my issue.  Thanks!!!!

I'm glad you are up and running again. It's a pity that we couldn't identify the ultimate issue. But thanks for discovering the Connect tab JavaScript bug; I will include the altered file in the next release.
Title: Re: UI6 readiness
Post by: ke2nny on June 26, 2014, 11:16:16 am
If you would like, I can install the plug-in and we can continue to troubleshoot.  I just need to know what to do next, but we can continue.
Title: Re: UI6 readiness
Post by: futzle on June 26, 2014, 05:45:59 pm
If you would like, I can install the plug-in and we can continue to troubleshoot.

The bug you encountered smells like one that you probably couldn't reproduce even if you tried.  I wouldn't be game to mess with your working system and risk breaking it permanently.