Skip to content

router.getAttachedDevices() often returns undefined #22

@JackAida

Description

@JackAida

Ive been using router.getAttachedDevices() to get each devices current download and upload speeds but often everything but ip and mac returns undefined, below is an example of how all devices attached look 90% of the time, one in around 500 attempts will give me something usable, I have tried making it wait some time between each call and if you spam call it you get it quicker but you also get an error that pops up from time to time regarding some nodejs queuing thing.

Is there a way I can more reliably get the .getAttachedDevices() information?

AttachedDevice {
    IP: '192.168.1.80',
    Name: 'teiraaaa',
    NameUserSet: undefined,
    MAC: 'XX:XX:XX:XX:XX:XX',
    ConnectionType: 'wireless',
    SSID: undefined,
    Linkspeed: 433,
    SignalStrength: 100,
    AllowOrBlock: 'Allow',
    Schedule: undefined,
    DeviceType: undefined,
    DeviceTypeV2: undefined,
    DeviceTypeUserSet: undefined,
    DeviceTypeName: undefined,
    DeviceTypeNameV2: undefined,
    DeviceModel: undefined,
    DeviceModelUserSet: undefined,
    Upload: undefined,
    Download: undefined,
    QosPriority: undefined,
    Grouping: undefined,
    SchedulePeriod: undefined,
    ConnAPMAC: undefined
  }

Currently checking to see how many attempts it takes to get the correct information to see how many tries it actually takes the above one in 500 attempts was just a guess:

deviceArray = await router.getAttachedDevices();
	if(deviceArray[0].Download == undefined){attempts++;}else{
	        console.log("took: " + attempts + " to get the correct information");
		attempts = 0;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions