irsheep / MMM-SnmpIntSpeed

MagicMirror Snmp Interface speed module
MIT License
4 stars 4 forks source link

Module suspending due to Uncaught Reference error #3

Open Privacywonk opened 4 years ago

Privacywonk commented 4 years ago

Receiving the following Uncaught Reference error from line 124/125. My setup: MagicMirror 2.9.0 with MMM-Carousel. Code block in question:

  socketNotificationReceived (notification, payload){
                Log.log(this.name + " socketNotificationReceived:" + notification )

                if ( notification == "SNMP_POOL_RESPONSE") {
                        var down = payload.download
                        var up = payload.upload
                        var max = payload.highSpeed
                        upload.refresh(up, max)
                        download.refresh(down, max)
                }
        },

Error details from console:

MMM-SnmpIntSpeed.js:124 Uncaught ReferenceError: upload is not defined
    at Class.socketNotificationReceived (MMM-SnmpIntSpeed.js:124)
    at module.js:246
    at r.<anonymous> (socketclient.js:25)
    at r.emit (index.js:83)
    at r.onevent (index.js:83)
    at r.MMSocket.self.socket.onevent (socketclient.js:19)
    at r.onpacket (index.js:83)
    at r.<anonymous> (index.js:83)
    at r.emit (index.js:83)
    at r.ondecoded (index.js:83)
socketNotificationReceived @ MMM-SnmpIntSpeed.js:124
(anonymous) @ module.js:246
(anonymous) @ socketclient.js:25
r.emit @ index.js:83
r.onevent @ index.js:83
MMSocket.self.socket.onevent @ socketclient.js:19
r.onpacket @ index.js:83
(anonymous) @ index.js:83
r.emit @ index.js:83
r.ondecoded @ index.js:83
(anonymous) @ index.js:83
r.emit @ index.js:83
a.add @ index.js:83
r.ondata @ index.js:83
(anonymous) @ index.js:83
r.emit @ index.js:83
r.onPacket @ index.js:83
(anonymous) @ index.js:83
r.emit @ index.js:83
r.onPacket @ index.js:83
r.onData @ index.js:83
ws.onmessage @ index.js:83
module.js:198 MMM-SnmpIntSpeed is suspended.
MMM-SnmpIntSpeed.js:118 MMM-SnmpIntSpeed socketNotificationReceived:SNMP_POOL_RESPONSE
MMM-SnmpIntSpeed.js:124 Uncaught ReferenceError: upload is not defined
    at Class.socketNotificationReceived (MMM-SnmpIntSpeed.js:124)
    at module.js:246
    at r.<anonymous> (socketclient.js:25)
    at r.emit (index.js:83)
    at r.onevent (index.js:83)
    at r.MMSocket.self.socket.onevent (socketclient.js:19)
    at r.onpacket (index.js:83)
    at r.<anonymous> (index.js:83)
    at r.emit (index.js:83)
    at r.ondecoded (index.js:83)
irsheep commented 4 years ago

Hi,

In MMM-SnmpIntSpeed.js can you add the code below as line 1 var download, upload;

and replace line 140 with script.innerHTML = '' + //'var download, upload;' +

Thank you

Privacywonk commented 4 years ago

No dice. I am still receiving an error state.