# Property '0' of undefined

**URL:** <https://forum.genieacs.com/t/property-0-of-undefined/1539>\
**Category:** Uncategorized\
**Created:** [March 20, 2021, 9:57am UTC](https://forum.genieacs.com/t/property-0-of-undefined/1539 "2021-03-20T09:57:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sixteen](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sixteen](https://forum.genieacs.com/u/sixteen)\
**Post date:** [March 20, 2021, 9:57am UTC](https://forum.genieacs.com/t/property-0-of-undefined/1539/1 "2021-03-20T09:57:07Z")

</div>

hello guys  
I wrote a script to try  
name:show  
log(’!!!show!!!’);  
const now = Date.now();  
const id = declare(“DeviceID.ID”, {value: 1}).value[0];  
log(’!!!ID:’ + id);  
const manu = declare(“DeviceID.Manufacturer”, {value: 1}).value[0];  
log(’!!!DeviceID.Manufacturer:’ + manu);  
const out = declare(“DeviceID.OUI”, {value: 1}).value[0];  
log(’!!!out:’ + out);  
let serial = declare(“DeviceID.SerialNumber”, {value: 1});  
log(’!!!serial:’ + serial.value[0]);

let version=(declare(“Device.DeviceInfo.SoftwareVersion”,{value:1})).value[0];  
log(’!!!version:’ + version);

log(’!!!end!!!’);  
But it seems to have an error

Channel has faulted; channel=“show” retries=1 faultCode=“script.TypeError” faultMessage=“Cannot read property ‘0’ of undefined”

how to make it

---

<div class="post-metadata">

**Author:** ![sixteen](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sixteen](https://forum.genieacs.com/u/sixteen)\
**Post date:** [March 20, 2021, 10:00am UTC](https://forum.genieacs.com/t/property-0-of-undefined/1539/2 "2021-03-20T10:00:33Z")

</div>

The wrong place is here  
let version=(declare(“Device.DeviceInfo.SoftwareVersion”,{value:1})).value[0];  
Once it was successful but awalys wrong!

---

<div class="post-metadata">

**Author:** ![mjducharme](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/mjducharme/32/59_2.png) [@mjducharme](https://forum.genieacs.com/u/mjducharme)\
**Post date:** [March 21, 2021, 5:07am UTC](https://forum.genieacs.com/t/property-0-of-undefined/1539/3 "2021-03-21T05:07:28Z")

</div>

I’m not sure if it is the cause of the problem, but why do you have the extra parentheses around that? You have:

`let version=(declare("Device.DeviceInfo.SoftwareVersion",{value:1})).value[0];`

It should be the same as:

`let version=declare("Device.DeviceInfo.SoftwareVersion",{value:1}).value[0];`

---

<div class="post-metadata">

**Author:** ![sixteen](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sixteen](https://forum.genieacs.com/u/sixteen)\
**Post date:** [March 22, 2021, 1:57am UTC](https://forum.genieacs.com/t/property-0-of-undefined/1539/4 "2021-03-22T01:57:46Z")

</div>

I’ve tried your sentence. Sometimes I can get it, sometimes I can’t

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/4d490e62d62592573c6302e911fb98bdf2214da5.png)

---

<div class="post-metadata">

**Author:** ![mjducharme](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/mjducharme/32/59_2.png) [@mjducharme](https://forum.genieacs.com/u/mjducharme)\
**Post date:** [March 22, 2021, 2:11am UTC](https://forum.genieacs.com/t/property-0-of-undefined/1539/5 "2021-03-22T02:11:23Z")

</div>

Are the devices that are working and those that are not working similar (ex. the same model router by the same manufacturer) or are they different? There are different TR069 parameter tree standards - depending on the device make and model, you might not always find the software version at Device.DeviceInfo.SoftwareVersion. Some routers may instead use InternetGatewayDevice.DeviceInfo.SoftwareVersion

---

<div class="post-metadata">

**Author:** ![sixteen](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sixteen](https://forum.genieacs.com/u/sixteen)\
**Post date:** [March 22, 2021, 3:46am UTC](https://forum.genieacs.com/t/property-0-of-undefined/1539/6 "2021-03-22T03:46:59Z")

</div>

Thank you for your advice, my device is now directly connected to the host to debug, there is no route forwarding. I’ve tried InternetGatewayDevice.DeviceInfo.SoftwareVersion，It makes the same mistake.The script initially showed errors, but it was able to run for a while, which confused me. You can see my latest post, which has details.
