This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

LM and Mikrotik routers
#5
Hi guys,
here is a Scheduled script for Mikrotik RouterOS (v6.41.2) which will monitor WiFi registration table and if one of both MACs appear it will send 1 to grp address 1/1/1 on LogicMachine (192.168.1.13)  via HTTP POST command. If both of MACs disappear from the list, it will send 0 to 1/1/1. 

You can adjust Scheduled script run interval and list of MAC addresses. Or you can send different POST commands for different MAC addresses.

Code:
{
 :local exists [/int wire reg find mac-address="78:02:F8:7A:96:01"];
 :local exists2 [/int wire reg find mac-address="B0:E2:35:CD:46:48"];
 :if ($exists!="" or $exists2!="") do={
    /tool fetch url="http://remote:11111111@192.168.1.13/scada-remote" http-data="m=json&r=grp&fn=write&alias=1/1/1&value=1" http-method=post;
  }  else={
           /tool fetch url="http://remote:11111111@192.168.1.13/scada-remote" http-data="m=json&r=grp&fn=write&alias=1/1/1&value=0" http-method=post;
     }  
}

Here is detailed example.
Reply


Messages In This Thread
LM and Mikrotik routers - by AlexLV - 13.06.2017, 19:41
RE: LM and Mikrotik routers - by AEK - 14.06.2017, 07:50
RE: LM and Mikrotik routers - by AlexLV - 16.09.2017, 19:49
RE: LM and Mikrotik routers - by edgars - 09.03.2018, 13:41
RE: LM and Mikrotik routers - by DGrandes - 09.11.2019, 11:23
RE: LM and Mikrotik routers - by edgars - 11.11.2019, 07:54
RE: LM and Mikrotik routers - by DGrandes - 11.11.2019, 11:29
RE: LM and Mikrotik routers - by edgars - 11.11.2019, 12:39
RE: LM and Mikrotik routers - by DGrandes - 11.11.2019, 14:58
RE: LM and Mikrotik routers - by DGrandes - 30.08.2020, 17:09
RE: LM and Mikrotik routers - by admin - 30.08.2020, 17:25
RE: LM and Mikrotik routers - by DGrandes - 30.08.2020, 17:35
RE: LM and Mikrotik routers - by admin - 30.08.2020, 17:39
RE: LM and Mikrotik routers - by DGrandes - 30.08.2020, 17:45
RE: LM and Mikrotik routers - by admin - 31.08.2020, 11:36
RE: LM and Mikrotik routers - by DGrandes - 31.08.2020, 14:18
RE: LM and Mikrotik routers - by edgars - 01.09.2020, 07:02
LM and Mikrotik routers - by DGrandes - 07.09.2020, 16:24

Forum Jump: