How to run Dockerized Landroid Bridge with OH2?

  • Platform information:

    • Hardware: RPi3B+
    • OS: openhabian
    • Java Runtime Environment:
      openjdk version “1.8.0_222”
      OpenJDK Runtime Environment (Zulu8.40.0.178-CA-linux_aarch32hf) (build 1.8.0_222-b178)
      OpenJDK Client VM (Zulu8.40.0.178-CA-linux_aarch32hf) (build 25.222-b178, mixed mode, Evaluation)
    • openHAB version: 1.5-513
  • Issue of the topic: Cannot get Landroid bridge to run because mqtt link not found

  • Please post configurations (if applicable):

  • If logs where generated please post these here using code fences:

      docker run \
      >     -p 3030:3030 \
      >     --name landroid_bridge \
      >     --link mqtt:mqtt \
      >     -v /landroid-bridge/config.json:/usr/src/app/config.json \
      >     virtualzone/landroid-bridge
      Unable to find image 'virtualzone/landroid-bridge:latest' locally
      latest: Pulling from virtualzone/landroid-bridge
      Digest: sha256:d91aebbce6a46f9db76a26a68e6ec549be644a0ded50365b866630f24015582c
      Status: Image is up to date for virtualzone/landroid-bridge:latest
      docker: Error response from daemon: could not get container for mqtt: No such container: mqtt.
    

I am trying to install Landroid bridge according to the github page. I first tried the “Build from Source” instructions, but NPM did not work.So I installed docker and am trying the docker instructions on the page. I get the above error. MQTT was installed with openhabian-config. I have the binding installed and waiting. I updated the landroid-bridge config.json to use port 3030 so as not to interfere with my eventual influx/Grafana.

Are there missing steps in the github instructions?

The github page describes the following:

Since you’re not running MQTT in a container I would start by removing the --link mqtt:mqtt parameter from the docker run command.

EDIT: After some snooping around the dockerfiles on the git page, I tried this:

  1. sudo git clone https://github.com/virtualzone/landroid-bridge.git
  2. cd /landroid-bridge
  3. Modify config.json (and for me Dockerfile.rpi to update port to 3030)
  4. Ran the following command within landroid-bridge directory:
    docker build -t virtualzone/landroid-bridge:arm32v7 -f Dockerfile.rpi .

Which failed at the same npm grunt point as when trying the manual install:

            Step 6/13 : RUN npm run build-prod
 ---> Running in 2cb190786a79

> landroid-bridge@0.1.0 build-prod /usr/src/app
> npm run clean && npm run grunt && npm prune --production


> landroid-bridge@0.1.0 clean /usr/src/app
> rm -rf dist/


> landroid-bridge@0.1.0 grunt /usr/src/app
> grunt

Running "tslint:files" (tslint) task
>> 17 files lint free.

Running "ts:app" (ts) task
Compiling...
Using tsc v3.6.2
>> Warning: created src/.baseDir.ts file because `outDir` was specified in the Gruntfile ts `options`, but not `rootDir`.  Add `rootDir`  under the task or target `options` object to fix this warning.
src/LandroidSRouter.ts(45,50): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
src/LandroidSRouter.ts(55,54): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
src/LandroidSRouter.ts(66,49): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.

>> 3 non-emit-preventing type warnings
>> Error: tsc return code: 2
Warning: Task "ts:app" failed. Use --force to continue.

Aborted due to warnings.
npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! landroid-bridge@0.1.0 grunt: `grunt`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the landroid-bridge@0.1.0 grunt script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-08-30T16_53_49_483Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! landroid-bridge@0.1.0 build-prod: `npm run clean && npm run grunt && npm prune --production`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the landroid-bridge@0.1.0 build-prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-08-30T16_53_49_531Z-debug.log

I’m going crazy here for the last 3 weeks on this same problem. I was under the impression that it was common to run openHAB and associated services on the RPi, but this just is not working. Really hoping someone that has done this can provide me with the right steps.

This has nothing to do with openHAB though.

Check out this PR: