Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation help needed - Cannot bind #52

Open
ZHonry opened this issue Feb 27, 2020 · 1 comment
Open

Installation help needed - Cannot bind #52

ZHonry opened this issue Feb 27, 2020 · 1 comment

Comments

@ZHonry
Copy link

ZHonry commented Feb 27, 2020

My friends, how do I deal with this problem?
On the advice of a programmer friend, the log output was increased.
image

[TAILING] Tailing last 15 lines for [/HVAC_/] process (change the value with --lines option),
/root/.pm2/logs/HVAC-0-out.log last 15 lines:,
0|HVAC_0 | [MQTT] Connecting to mqtt://192.168.2.6...,
0|HVAC_0 | [UDP] Connected to device at 192.168.2.235,
0|HVAC_0 | [MQTT] Connected to broker,
0|HVAC_0 | { t: 'pack',,
0|HVAC_0 | i: 1,,
0|HVAC_0 | uid: 0,,
0|HVAC_0 | cid: '',,
0|HVAC_0 | tcid: '',,
0|HVAC_0 | pack:,
0|HVAC_0 | 'LP24Ek0OaYogxs3iQLjL4GkmBNTzMwOtezbnQQvadq+F4Js8mGMCoIEjyN0Y3BfgpqjwKof9L5vI0JQ76AS2tMf4gaQXzcgJ2+74CkMVbRFsaH7s7hYVQ+YB/WaUbx4E0boasj6Z1Xpqyl4z/nH5nphFSaIjJJpCRNwGmJT+oECJymYSz66Z1I82cCtFYs6xqWyYvOKrHQL5tpN9F6TfeX10UcDO1f3eTw/NIuJ/oeE=' },
0|HVAC_0 | [UDP] New device registered: 42720b3a,
0|HVAC_0 | [UDP] Unknown message of type bindok: [object Object], [object Object]

@reformhaz
Copy link

in app/deviceFactory.js this line:
this._setDevice(message.cid, pack.name, rinfo.address, rinfo.port)
sets the id to cid which is empty, so I hacked it to read:
this._setDevice(pack.mac, pack.name, rinfo.address, rinfo.port)
that gets over the binding, but I also had to change:
if (pack.t === 'res' && this.device.bound) { pack.opt.forEach((opt, i) => { this.device.props[opt] = pack.v[i] }) this.options.onUpdate(this.device) return }
to
if (pack.t === 'res' && this.device.bound) { pack.opt.forEach((opt, i) => { this.device.props[opt] = pack.p[i] }) this.options.onUpdate(this.device) return }
because pack has no v field, but does have p

Please note I have no idea what and why I'm doing, but using these modifications I can use this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants