Kumoapp and CPU % usage - Jurassic.JavaScriptException

144 views
Skip to first unread message

steve

unread,
Mar 6, 2016, 6:08:36 AM3/6/16
to Wireless Sensor Tags
Hi support

I have simple scripts when door opens beep another tag that works

1. for pro tags 21

var tag_to_beep = <#tag to beep_[12|13|21]_1#>;
<#door_[12|13|52|21]_N#>.forEach(function(t){
t.opened = function(){ tag_to_beep.beep(5); }
});

I have used the N# option  as per you documentation specifies if multiple but I cannot get it to work for the tag to beep option ( I want to be able to select more than 1 tag to beep) . I want to be able to select all my tags i.e. Pro in both beep and door.

as I cannot do this I have to create individual apps that then put me over the CPU load. I placed an N in the below postion

<#tag to beep_[12|13|21]_N#>

but got this error

Jurassic.JavaScriptException: TypeError: 'tag_to_beep.beep' is not a function at anonymous(ScriptEngine , Scope , Object , FunctionInstance , Object[] ) at Jurassic.Library.UserDefinedFunction.CallLateBound(Object thisObject, Object[] argumentValues) in C:\z560_backup\jurassic_0336599937d3\Jurassic\Library\Function\UserDefinedFunction.cs:line 245 at MyTagList.KumoAppEngine.Tag.b__18_0(String json) in C:\z560_backup\MyTagList\KumoApp\KumoAppEngine\Tag.cs:line 155

thanks

Steve


Senyo

unread,
Mar 9, 2016, 1:45:12 AM3/9/16
to Wireless Sensor Tags
Are you sure the door function works with the pro....? I can see in the code that it is entered after 52 which would suggest that you have added it later. I would check to make sure that the door function is possible with the pro...

steve

unread,
Mar 9, 2016, 5:00:26 AM3/9/16
to Wireless Sensor Tags
Hi Senyo

thank you for your support. I can confirm the door function works on this script for the new Pro tags. it beeps the tag instantly when open and in most cases is faster than the push notification, great news. But can get it to select more than one tag to beep.

thanks

Steve 

steve

unread,
Mar 9, 2016, 5:01:21 AM3/9/16
to Wireless Sensor Tags
sorry can not get it to beep more than one tag or select more than one.

Senyo

unread,
Mar 9, 2016, 6:07:03 AM3/9/16
to Wireless Sensor Tags
To be honest mate I've been having cpu/memory issues for the past week, with kumoapps that previously have been working fine. And even more recently the latency with the push notifications have been unbearable.
In a recent post I read some1 was using Openhab running off a raspberry pi 2 to control their events and home automation. After doing some research, it would seem that this option will solve a lot of the problems I'm having with the kumoapps.
I am now the proud owner of a raspberry pi 2, so fingers crossed within a month all my home automation should be triggered through the Openhab server on the Rpi. If your issue persists you might want to give this option a go.

steve

unread,
Mar 9, 2016, 8:48:53 AM3/9/16
to Wireless Sensor Tags
Senyo

Cheers for that. I was thinking about getting a Pi 3? I saw that post about Openhab and visited the support forum. looks like the guy needed some help to get up and running with some of the code but got there. If it works out can you let me know? and I will give it a go. Kumoapps are good when they are working but I use my system for home security and you just can't have a lag in beeping the tag to let you know someone has broken in to your front door. IFTTT works but there can be up to a 1 min lag. kumoapps were instant, Most of the time,  but when I started to write my own apps I get CPU usage faults. Probably me with wrong code and causing issues, but how else are you meant to test, and experiment?

I think a bigger list of support written apps would help. I never see many shared or written be other users, I keep looking. but might be support has to approve them before they go public.

good luck with Pi2 and OpenHab

Pete

unread,
Mar 9, 2016, 1:00:25 PM3/9/16
to Wireless Sensor Tags
I have successfully implemented these tags (along with the PIR and Open/Close sensors) with OpenHAB running on RPi2.  I use them in conjunction with a bunch of Insteon dimmers and outlets.  If you have any questions feel free to hit me up.  It's been working great and has the flexibility to do some really cool stuff!

steve

unread,
Mar 9, 2016, 5:30:18 PM3/9/16
to Wireless Sensor Tags
Hi Pete

thanks for your support. I'll get a RPi2 this weekend or do you know if it works with the new RPi3? this sounds exactly what I need, I'm sure I will need help so thanks for the kind offer.

Steve

Zhiheng Cao

unread,
Mar 9, 2016, 5:35:30 PM3/9/16
to Senyo, Wireless Sensor Tags
Hi Senyo,

Can you tell me if you are hitting CPU limit or memory limit or both? I think you are most likely hitting only memory limit. What is your account email? 

We try to increase the CPU and memory limit so non-abusive apps like yours can run reliably while flagging apps that are infinite loops (a few weeks ago there was an app that updated all tags when there is an update to any tag, i.e. an infinite loop app that eats up CPU. We lowered the CPU limit to make app like this stop). 

Thanks,
support


--
You received this message because you are subscribed to the Google Groups "Wireless Sensor Tags" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wireless-sensor-...@googlegroups.com.
To post to this group, send email to wireless-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/wireless-sensor-tags.
To view this discussion on the web visit https://groups.google.com/d/msgid/wireless-sensor-tags/cd1acf20-8474-4299-9cc4-72dc944d277a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pete

unread,
Mar 9, 2016, 5:39:00 PM3/9/16
to Wireless Sensor Tags
It's just a hardware boost so I don't see why it wouldn't work.  Should be nice and zippy!   There's plenty of tutorials for getting the core of OpenHAB installed and configured...Once that's done, it's not too difficult to hook into the tags.  Do you already have an idea of what you want to do with them (automation-wise)?  

The other thing to check for is to make sure there are OpenHAB bindings (here are the add-ons required to talk to your other hardware) for the other items you might plan to use/control (Wemo, Insteon, Z-Wave, etc). 

Senyo

unread,
Mar 10, 2016, 11:49:47 AM3/10/16
to Wireless Sensor Tags
Hi Pete,
Thanks for chipping in, I have been trying to install Openhab onto my rpi2 but I'm having stability issues with the server booting on start up. So far I have stuck to the same tutorial but I always end up with the same issue. I am able to access the network files from my PCs, however I only get the error 500 message 'from the browser interface' once and that is when I first install. When I restart the pi I get an 'ooooops unable to connect......'
Are you able to recommend any specific tutorials that might see me thought to the end of the installation. I intent to use it with hue, nest, sonos, and ismartalarm which I might need ifttt for..

Hi support,
Thanks for your reply, in most cases it always seem tobe the cpu % I haven't had most of the kumoapps running for a few days 'I have all but given up' but I will have a play with them later and I will let you know how they perform.

steve

unread,
Mar 10, 2016, 1:45:57 PM3/10/16
to Wireless Sensor Tags
Hi Peter

I purchased a new Pi today and should arrive tomorrow so any web  links, guides to set this up would be great I will be using it with PIR tags and wemos.

thanks
Steve

Pete

unread,
Mar 10, 2016, 5:21:30 PM3/10/16
to Wireless Sensor Tags
@Senyo & @steve - 

1.  For completeness, let's start at the beginning.  The easiest way to get the RPi up and running is to install the Raspbian OS via NOOBS.  Unless you've already purchased an SD card with it pre-installed, I'd go with the "Download" method mentioned on this page:

https://www.raspberrypi.org/help/noobs-setup/


2.  Once the OS is installed and running, it's probably best to make sure that everything is up-to-date.  Note: These are also the same steps that should be done periodically just to ensure everything is current:



3.  Now then, on to OpenHAB.  It's been a while now but I believe this is the tutorial that I followed to get OpenHAB installed.



@Senyo - Is that the same tutorial you've been following?  If not, let me know which one you're using now.  Not sure I'll be able to diagnose the exact issue, but I'll try to help.  The error message you're getting might jus the because you don't have a valid sitemap for openHAB to read.  That would mean it doesn't have enough information to display the GUI for you when you attempt to connect via the browser.

Senyo

unread,
Mar 10, 2016, 6:24:48 PM3/10/16
to Wireless Sensor Tags
Pete,
Yes that's the one. And the message I keep getting is "err_connection refused" always happened after I restart the Rpi but I still have access to Openhab configure and Openhab home through the network file on my PC.
The last line of the tailed Openhab log reads [info] [penhab.io.rest.RESTApplication] - stopped REST
API.

Pete

unread,
Mar 10, 2016, 11:02:54 PM3/10/16
to Wireless Sensor Tags
Can you help me understand what exactly you're doing to get to the point where you see that error?  Is that in your browser window or in the logs somewhere?  It doesn't sound like OpenHAB is restarting correctly.  Perhaps you can post more lines form the log during startup.  Also, make sure you've set logging at the DEBUG level.  To do that, open logback.xml (found in your 'configurations' folder) and find the line that reads:

<logger name="org.openhab" level="INFO"/>

and change it to

<logger name="org.openhab" level="DEBUG"/>

That should provide you with better information about what's happening during startup.

Senyo

unread,
Mar 11, 2016, 5:07:57 AM3/11/16
to Wireless Sensor Tags

Thanks Pete,

And it looks like I've fixed it now. I had to use a different start up protocol, because of the debain version I had installed.
I managed to find the solution on GitHub.
Wow my brain is fried after that experience.... On to the next chapter :)

Steve, if you come across the same issue you could find the solution here.

https://github.com/openhab/openhab/wiki/Linux---OS-X#apt-get
image.png

steve

unread,
Mar 11, 2016, 7:05:37 AM3/11/16
to Wireless Sensor Tags
Senyo/Peter - great thanks. My PI should arrive today I have downloaded Noobs so ready to start. i have been working on trying to get a simple kumoapp to work all morning, no joy! as per my initial email can select all tags with
<#door_[12|13|52|21]_N#> that works, but can I select more than one tag to beep? nope. <#tag to beep_[12|13|21]_1#> works ok but  i have tried the N#> and kills everything - hope i get better luck with PI.

Senyo keep us posted on how you get on. as I'm sure others will benefit from your hard work. and its good to see the boards getting busy.

Many thanks

Steve
Reply all
Reply to author
Forward
0 new messages