MQTT interface... time for some testing. Where are my experts?
-
@toggledbits said in MQTT interface... time for some testing. Where are my experts?:
Did you find the probably dated but maybe marginally helpful docs here?
Yes I did .. a quick Q - how do I delete an entity ?
The bit I'm adding currently is
If the process may be protracted and lengthy, the Promise should resolve earlier and the entities by published as discovered.
and trying to avoid having to loop through them all on restarts to see if they already exist. This is an aspect that you must have encountered with Hubitat and Hass.
Making good progress and enjoying it .. great application.
@xappo said in MQTT interface... time for some testing. Where are my experts?:
how do I delete an entity ?
controller.removeEntity( entity )
-- pass the entity, not just the ID.@xappo said in MQTT interface... time for some testing. Where are my experts?:
trying to avoid having to loop through them all on restarts to see if they already exist
Define restarts in this context. If you mean restart of Reactor, no entities exist in the version you are running when Reactor starts up. That's about to change, though... entity persistence is coming. If you mean when the connection to the hub is re-established, that's entirely implementation-dependent for your Controller subclass. My subclasses generally reinventory everything, because you don't know how long the hub has been unavailable, and what may have happened to it while it was down.
I just posted a ton of updates to the doc.
-
I am trying to install this in Docker and getting the following error:
$ docker exec -it reactorjs /bin/sh cd /home/pi/reactor/ext/MQTTController ./install.sh exit
/bin/sh: can't open 'cd': No such file or directoryNot enough of a linux gut to know what the issue is. Anyone have any hints?
Roger
-
You're reading the wrong direction, I think. See the docs.
Edit 2: OK, getting in sync here again... you've given the wrong pathname to
cd
. Give it what the documentation says. You're working inside the container -- gotta follow its rules. -
This is the part I used from the instructions:
"docker exec -it <container-name> /bin/sh cd /var/reactor/ext/MQTTController ./install.sh exit"Results:
pi@RedBMWDeb:/home $ docker exec -it reactorjs /bin/sh cd /var/reactor/ext/MQTTController ./install.sh exit
/bin/sh: can't open 'cd': No such file or directoryThen I tried to determine why the command wouldn't run and determined that maybe the path was wrong on my machine so ran the one in the previous message pointing to the path where MQTTController files were.
pi@RedBMWDeb:~/reactor/ext/MQTTController $ ls
0-README.txt COPYRIGHT MQTTController.js
buildstamp install.sh mqtt_devices.yaml
CHANGELOG.md mqtt_capabilities.yaml package.json -
It looks like you're trying to do all of those commands on one line. That's not right. You do them one at a time.
-
Installing line my line removed that issue. Still running into errors.
Is there a way to determine if the dependencies get installed correctly. I see this on the screen but once I restart reactor it fails.
Installing dependencies...
[..................] \ idealTree:MQTTController: sill idealTree buildDeps.
It sits here for a minute or 2 and then exits. When I modify the reactor.yaml file- id: mqtt name: MQTT enabled: true implementation: MQTTController config: source: "mqtt://192.168.0.16:1883/"
Then I get these error messages in the container logs when ReactorJS starts up
Require stack:-
/var/reactor/ext/MQTTController/MQTTController.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/var/reactor/ext/MQTTController/MQTTController.js:22:14)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:168:29)
[zwavejs-22058]2022-03-01T20:12:27.189Z Controller:CRIT Error: Cannot find module 'mqtt'
-
-
Dependencies didn't get installed properly. Try running the install script again.
-
Just run the dependency install manually:
docker exec -it reactor /bin/sh cd /var/reactor/ext/MQTTController npm i --no-save --omit dev --verbose exit
If it doesn't succeed, post the full output here, and please use the fenced code block formatting. If you don't know how to do that, read here
-
Here is the screen output"
pi@RedBMWDeb:~ $ docker exec -it reactorjs /bin/sh /opt/reactor # cd /var/reactor/ext/MQTTController /var/reactor/ext/MQTTController # npm i --no-save --omit dev npm ERR! code EAI_AGAIN npm ERR! syscall getaddrinfo npm ERR! errno EAI_AGAIN npm ERR! request to https://registry.npmjs.org/mqtt failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2022-03-01T21_10_51_623Z-debug-0.log /var/reactor/ext/MQTTController # /var/reactor/ext/MQTTController #
The log referenced in the error message is not readily findable.
registry.npmjs.org is findable in nslookup so not lookinhg like a DNS error. Alse turned off pihole incase that was an issue. Still same error.
-
What's your network configuration for this container? This looks like the internal networking of the container can't access the outside world.
-
At the very least, DNS isn't up to scratch inside the container, it appears. You might try this:
docker exec -it reactor /bin/sh nslookup www.google.com
That's a DNS lookup from inside the container. Should give you several addresses.
-
C Crille referenced this topic on
-
T toggledbits locked this topic on