How mac address is not connected.

Hi. I am trying to make a script with AFF that indicates to me through a print ("") when a device is not connected to the LAN from GX400 by means of the mac address and to know which are not connected, but being a data that changes of position, it’s hard.
To know the mac address of connected device in the LAN I use MSCIID (aleos.10621)

The firmware is 4.4.4

Cheers.

Allan

Hi Allan,

we need more information to better understand the demand.
1)
are you able to retrieve the MAC address of connected devices with AAF?
2)
what exactly is the problem you face?

From what I can read I seem to understand you have a number of connected assets behind your Airlink device which is not always the same. Hence the MAC address table changing over time.
If this is the case you should use following parameters to help you track the evolution:

  • use the register API to be notified of any change on a given parameter
  • use the “connected client” parameter to track how many clients are connected.

Hi sure

  1. Yes, by MSCIID (aleos.msciid) specifically msci id 10621 to 10635

  2. -where can I find the registration API and how can I use it? Since there is information that is not found on the internet.
    -what is the “connected client” parameter?

Thanks

Hi Allan,

here the link on the Source for the register API:
source.sierrawireless.com/resour … #scrollTo=#(devicetree).register&url=~/media/Support_Downloads/AirLink/AAF/aleos_af_api-13.0/devicetree.html

The “connected client” parameter is available in the Status>LAN tab of AceManager.

here below is a small code snipet for using the register API.

local sched = require 'sched'
local dev = require 'devicetree'
local sys = require 'system'


local current_carrier = ""
local operator_path = 'system.cellular.gsm.link.operator'
          
-------------------------------------------------------------------------------------------------
-- function called automatically when carrier changes     
function when_carrier_changes (data)
    
-- set current operator to be the new one
current_carrier = data['system.cellular.gsm.link.operator'] 
print ("switched carrier, now current carrier is: ", current_carrier)
       
end

-------------------------------------------------------------------------------------------------
local function main()
dev.init()  

-- read current carrier 
current_carrier = dev.get ('system.cellular.gsm.link.operator')
print("current_carrier:", current_carrier)

dev.register('system.cellular.gsm.link.operator', when_carrier_changes)    

end

sched.run(main)
sched.loop()

Hi, thanks for your help.

  1. What would be the MSCIID or parameter of devicetree to call connected clients?

  2. I have 3 clients connected to the Gateway Lan, example:
    “b0:a1:00:56:59:c1”, “5a:f0:b1:aa:ff:54” and “00:af:b5:d4:97:ff”

I see which ones are connected in Status > LAN > IP/MAC, but:
When one of those mac addresses is disconnected from the gateway, I want it to be notified in AFF as well as the previous script.

Cheers.

Hi Allan,

msci id for the “connected clients” paramater is 5006.

in order to know when there is a change in the MAC address table you have 2 possibilities:

  • register to the “connected clients” parameter using above sample script, and following path in the register API: ‘aleos.5006’
  • or regularly poll the MAC address table (eg every 15sec) and parse it for any change. To do so you can do a while true loop calling the devicetree.get API over the whole MAC address table and call the sched.wait() API (eg sched.wait(15)) before the end of the loop.

reg,
nmp

In general I would recommend the ‘register’ approach rather than polling. You’ll get notification as soon as the change happens and does not un-necessary processing because of the polling.