(10.11.2023, 10:59)Daniel Wrote: Obviously you didn't add any android device to push app. The common mistake is to configure android app before LM.
Make sure you are on the same local network as LM. Go to LM android app, edit your user, disable push notification, save then edit and enable again and save.
Refresh push notification app in LM to see if your device was added. You can then test it directly from the app.
Hi,
I am dealing with a restrictive Network and the Customer wants Push Notifications on his Smartphone. I need a Port list for the IT support.
Are you using TCP 443, 5223 and 2197 for Apple and TCP 443, 5228 and 5229/52230 for Android?
From LM side we use 443 and 8883 but this are outgoing ports. The push notifications are Android and iOS system notifications, we don't use any ports on them.
We are facing an issue with the push notification functionality. The application we are using the LM for is taking place in a ship, where we use the Logic Machine 5 (LMp2-GSM) in order to receive with the use of MODBUS RTU alarms from the Monitoring System of the ship (essentially the LM is connected to a PLC device) and then send a few push notifications to the crew of the ship to notify them for alarms etc.
More specifically:
1) a bit from the PLC is turned on, then the user receives a push notification. This is achieved with the use of an Event Script.
2) after a couple of minutes, the alarm will repeat itself unless it has been acknowledged from the crew members. This is achieved with the use of a Resident Script.
3) The acknowledgment is done through the Mosaic UI with the push of a button and an Event Script.
The issue here is that this whole application may not work as intended at all times:
1)the push notification from the first bit may not be sent at all and only receive push notifications from the repeat functionality.
2)the repeat function, which repeats the first message, is generally repeated after the correct time specified time (1minute)
but every few repeats its stops for 10-15 minutes and then starts again.
We are buffled as to why these things occure.
Thank you for your time.
Code:
12345678910
-- this is the Event Script that is activated with each alarm and sends the first message-- Each alarm is a separate event script with a dedicated object that activated itpusher = require('applibs.pusher')
Fire_Alarm=grp.getvalue("32/1/24")
if (Fire_Alarm==true) thenstatus, errors = pusher.send('Captain', '**FIRE ALARM ACTIVATED**\n Please Check The Fire Alarm System!')
status, errors = pusher.send('Chief_engineer', '**FIRE ALARM M/E ALARM ACTIVATED**\n Please Check The Fire Alarm System!')
grp.write('0/1/11',1)
end
--here the repeat function starts-- essentially each alarm that is activated by an Event Script, activates the object '0/1/11' which then starts a counter. When the counter reaches 3 then is sends the correct message depending on the object that is active-- when the alarm is ackowlegded, the object of the activation is turned to 0 and the object '0/1/11' is turned to 0 as wellff=grp.getvalue("0/1/11") -- this bit is set to TRUE with each alarmcount=grp.getvalue('1/1/7') -- this is the counter variableif (ff == true) thencount = count +1grp.update('1/1/7',count)
elseif (ff==false) thengrp.update('1/1/7',0)
grp.update('1/1/3',0)
endifcount >= 3thengrp.update('1/1/3',1) -- this variable when set to TRUE is what initiates the re-send of the push notificationgrp.update('1/1/7',0)
elseifcount == 1thengrp.update('1/1/3',0)
endpusher = require('applibs.pusher')
cnt = grp.getvalue('1/1/3') -- this variable is the trigger for repeatance--table{"32/1/18","32/1/17"}localobjects={
obj1 = grp.getvalue("32/1/2"),
obj2 = grp.getvalue("32/1/3"),
obj3 = grp.getvalue("32/1/4"),
obj4 = grp.getvalue("32/1/5"),
obj5 = grp.getvalue("32/1/6"),
obj6 = grp.getvalue("32/1/7"),
obj7 = grp.getvalue("32/1/8"),
obj8 = grp.getvalue("32/1/9"),
}
localpush={
obj1 = ' **POWER ALARM ACTIVATED**\n Please Check The Monitoring System! ',
obj2 = ' **TANK ALARM ACTIVATED**\n Please Check The Monitoring System! ',
obj3 = ' **PORT M/E ALARM ACTIVATED**\n Please Check The Monitoring System! ',
obj4 = '**STBD M/E ALARM ACTIVATED**\n Please Check The Monitoring System!',
obj5 = '**FIRE ALARM ACTIVATED**\n Please Check The Fire Alarm System!',
obj6 = '**WATERTIGHT DOOR ALARM**\n Please Check The System!',
obj7 = '**HI FOG ACTIVATED**\n Please Check The System!',
obj8 = 'This is the 8th',
}
ifcnt == truethenforobj, isActiveinpairs(objects) doifisActivethenstatus, errors = pusher.send_all(push[obj])
endendend
I have left the system repeating the alarm unacknowledged for about an hour.
The logs show that the script for repeating is executed on time, every time.
The users however have differences on the time and frequency they receive the push notifications.
For example, I may receive a notification every 1 minute but another one may have 20 minutes of interval between the notifications?
Do you think that there may be a fault with the script and it may be executing too quickly?
Are you sending push notifications to Android or iOS? We've increased message priority for Android, see if it helps. Unfortunately it's not possible to increase priority for iOS messages.
(20.12.2024, 07:55)admin Wrote: Are you sending push notifications to Android or iOS? We've increased message priority for Android, see if it helps. Unfortunately it's not possible to increase priority for iOS messages.
We are sending to both IOS and Android devices and both of them have the same issue. The thing is that some times the it is like the service stops completely after repeating the push notification for a few times and then restarts after some time. The logs show that the script is executed on time but the notifications are not sent.
(20.12.2024, 11:17)Daniel Wrote: And what was the outcome based on this log?
The script, based on this log, kept executing properly but the push notifiactions would stop being sent and then restart sending after like 20 minutes or so.
This is happening constantly but in irregular paterns. This is what has been buffling us
(22.01.2025, 12:31)mariosp Wrote: hello guys i made this script about DHW temperature for push notification and doesnt work the id is true. Here is the script