Closed digitlength closed 3 years ago
I have the exact same error... any clue?
Hello, i was working about my own issue #46 and I think we have the same problem.
If you see the logs, there are two problems:
1st:
(node:29037) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
at /home/pi/broadlink-mqtt-bridge/src/actions/files.js:131:25
In this line, the program was looking for the subdirectory /srv/openhab2-conf/broadlink-mqtt-bridge/commands
I create it with:
mkdir /srv/openhab2-conf/broadlink-mqtt-bridge/commands
Next I run the same script:
npm run production
I have an error in the run of the script, but it works and continue. The error is because the directory is empty (no command):
2020-07-05 10:11:53 [error]: Missing commands
2nd:
Next, I went to the next error, the log Error:
TypeError: log is not a function
I saw the code, and I saw than the error was produced by this code:
218 if (!isKnownDevice) {
219 log(`\n\x1b[35m[Info]\x1b[0m We've discovered an unknown Broadlink device. This likely won't cause any issues.\n\nPlease raise an issue in the GitHub repository (https://github.com/lprhodes/homebridge-broadlink-rm/issues) with details of the type of device and its device type code: " ${deviceType.toString(16)}". The device is connected to your network with the IP address "${host.address}".\n`);
220
221 return null;
222 }
This will indicate that ¡My Broadlink device is not recongnised! and that is the main problem of all.
I have a new RM4 mini... I think that is the problem...
I think that the log function is not correctly defined into this function. I make a little workaround adding "console" like that:
218 if (!isKnownDevice) {
219 console.log(`\n\x1b[35m[Info]\x1b[0m We've discovered an unknown Broadlink device. This likely won't cause any issues.\n\nPlease raise an issue in the GitHub repository (https://github.com/lprhodes/homebridge-broadlink-rm/issues) with details of the type of device and its device type code: " ${deviceType.toString(16)}". The device is connected to your network with the IP address "${host.address}".\n`);
220
221 return null;
222 }
And that works. The situation seems very diferent, because I can run the service and i recive next messages:
[Info] We've discovered an unknown Broadlink device. This likely won't cause any issues.
Please raise an issue in the GitHub repository (https://github.com/lprhodes/homebridge-broadlink-rm/issues) with details of the type of device and its device type code: "62bc". The device is connected to your network with the IP address "192.168.1.46".
2020-07-05 10:12:18 [info]: Broadlink Discovery completed. Found 1 devices.
2020-07-05 10:12:53 [debug]: Check if we have any devices: 1 found.
I continue working. In the lprhodes/homebridge-broadlink-rm/issues seems that is not attended...
First error: I've updated so that if commands folder is missing (default or custom path in config) a better error is generated.
Second error: I've removed my custom fork from https://github.com/lprhodes/broadlinkjs-rm and now using this npm library. For support on devices they need to be fixed here.
Please post your issue there and when fixed I can make a library upgrade.
I have installed using the manual method on https://github.com/fbacker/broadlink-mqtt-bridge/wiki/Installation.
The only difference is that I do not have the /srv/ directory, so I installed in my home directory to prevent requiring elevated user credentials.
On running
npm run production
I get the following output in the console:The log file mentioned at the end of the error above shows as below:
For info, I'm trying to connect to an RM4C Mini.