Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
We are trying to set up our alert features for our door sensor by changing the value of IsTriggered, which is a property of the Thing from a Thing Shape. We are writing the subscription through the extension Twilio has given us. We are doing a few edits in that script and it works, every time we run we do get the text message from the Twilio account but it seems to lock up the Thing that we Trigger that alert on within Thingworx. The Thing will not open, show properties, and in return locks up most of our system.
Below is the script that we are using:
if(Things["DoorOpenCloseSensor"].ArmedDisarmed==1){
if(Things["DoorOpenCloseSensor"].IsTriggered==true){
var params = {
to: "//MY PHONE NUMBER" /* STRING */,
text: "Your Door Has been Opened!" /* STRING */
};
Things["DoorOpenCloseSensor"].IsTriggered=false;
// no return
Things["TwilioBaseThing"].SendSMSMessage(params);
}
}
Things["DoorOpenCloseSensor"].IsTriggered=false;
When going to the Thingworx Community forums we noticed a listing that was kind of similar to what is going on with our project. Here is the link to that listing: https://community.thingworx.com/thread/2469
Is there a way to get out of this lockup? Is there something wrong in this script that could be causing this lockup?
To narrow this down, can you try using the mail extension to send mails instead of using Twilio to send texts? Does any error message get logged?
Just running a few more tests I've made a new script that sends the SMS messages with out getting locked out of the Thing. The only problem I'm having right now is the one Thing is still locked up, I can't access it. When clicked to see properties, or duplicate, or anything it just shows the loading screen but never actually loads up. I've implemented the new script on the Thing Shape but I still cant access that Thing.
Is there a way that I can unlock that Thing? or get it unstuck so I can edit its properties?
Below is the new scripts that work will all the Things, besides the Thing I cant access because it wont load.
if(me.ArmedDisarmed==1){
var params = {
to: "//my number" /* STRING */,
text: me.SensorName+ ""+ source + " " + eventData.description + " " + me.ArmedDisarmed + " " +me.IsTriggered/* STRING */
};
me.IsTriggered = false;
// no return
Things["TwilioBaseThing"].SendSMSMessage(params);
}
Well, restarting Tomcat would clear that up, but I suppose you will run into this issue again. You can try restarting the Platform Subsystem though. Also, if you go to Monitoring -> Subsystems, how does the Event Processing and Platform Subsystem look like?
When I got to the subsystems Event Processing goes as follows:
Core pool size | 16 | corePoolSize |
Max threads that will be created | 500 | maxPoolSize |
Threads currently in pool | 16 | curentPoolSize |
Active threads | 11 | activeThreads |
Tasks awaiting execution | 0 | queueSize |
Max number of threads that existed at one time | 16 | largestPoolSize |
Total number of tasks submitted | 205 | submitedTaskCount |
Total number of tasks completed | 194 | completedTaskCount |
And the Platform Subsystem looks as follows:
Event queue size | 0 | eventQueueSize |
Stream queue size | 0 | streamQueueSize |
Memory in use (bytes) | 294,000,472 | memoryInUse |
Total memory allocated (bytes) | 839,385,088 | totalMemoryAllocated |
Thing count | 46 | thingCount |
How would I go about resetting the Tomcat and or the Platform Subsystem.
Just assuming when looking at the Subsystems I see a reset button at the top, would clicking that button do the job?
Also will I loose any work that was created by restarting our Subsystem?
Thank you, sorry for the late reply.
Rachel, I don't see anything abnormal in the thread counts or tasks either. You can see that about 9 tasks were skipped or had failed. I'm not sure if restarting the Subsystem would be as effective as restarting Tomcat, as that would re-initialize everything. You will not lose any work if you saved your Things, as this is equivalent to restarting your laptop/ desktop. To restart the Subsystem, you would need to go to Subystems -> Platform Subsystem and then hit the restart button there. As for Tomcat, is this a local instance or a cloud hosted instance? You would need to pretty much stop/ start the Tomcat service.
Hello,
I just restarted the subsystem, and that didn't do the trick. I still can't access the DoorOpenCloseSensor Thing. We are running a cloud instance. Are we personally allowed to restart our own Tomcat, if so how would I go about doing so or do I need someone higher in the Thingworx community to restart it for us.
The link to our cloud service is:
If it is cloud hosted, you would need to contact your initial provider, because restarting Tomcat is a system level thing, and you need access to the actual cloud server in order to do so. Does any error or warnings get logged when you try to access that faulty Thing?
No, I just tried to access the faulty thing and it doesn't give any kind of error or warning in the log.
Today in hope of trying to solve this problem with our frozen Thing, we tried just deleting it. When trying to delete it, we noticed that the sensor wouldn't delete. Along with it gave the error messages shown below. Now we believe that we are receiving these error messages because we removed the alerts on the thing shape and have them on the individual things.I just don't know why it believes that its triggering when I tried to delete it. Along with now I'm having a hard time changing the properties on the other things that are created.
Restarting the server should definitely help in unlocking that Thing. Please do contact your cloud instance provider and check with them if they would be able to restart.