virtualzone/landroid-bridge

Update to new Worx-API

cm86 opened this issue ยท 123 comments

cm86 commented

Hello would this become updated for the new api from worx!?
I've had the docker running for a day and I have been banned for 24h.

Mfg
Chris

Hi,
would appreciate this to, as it's no longer possible to connect :-/
Appreciate an updat on this ;-)
Regards
Joerg

The guy who wrote the initial adapter (NPM package iobroker.landroid-s) has handed the code over to the community. The new repository is https://github.com/iobroker-community-adapters/ioBroker.worx and the new package name is iobroker.worx.

Since I recently moved my Landroid-S from my shed to its base station I wanted to re-integrate it into my Home Assistant configuration. But I ran across several errors and now I'm in knee-deep. I hopefully can make it work again and will post my findings here, maybe even create a PR for it.

But there seems to be a difference as this bridge from virtualzone is based on iobroker code, but different. this bridge is not iobroker and no iobroker is required while this bridge is between OpenHab and Landroid. Same issue was last year and a swift update solved the issue. looking forward that Heiner is still active.

Yes, I have come to the same conclusion. While some portions of the code is similar, the new NPM package seems to have a much tighter integration with ioBroker. I think it would be a good start to write a generic package that can connect to the landroid worx cloud. However, my time for this is rather limited.

I'm facing the same connection issues, though, so this ticket is still valid and any solution would be highly appreciated.

here is my setup:

# file: docker-compose.yml
version: '3'

services:
  landroid:
    image: virtualzone/landroid-bridge
    container_name: landroid
    restart: unless-stopped
    ports:
      - "3000:3000"
    volumes:
      - ./config.json:/usr/src/app/config.json

File config.json

{
    "http": {
        "port": 3000
    },
    "landroid-s": {
        "enable": true,
        "email": "[REDACTED]",
        "pwd": "[REDACTED]",
        "dev_sel": 0
    },
    "mqtt": {
        "enable": true,
        "url": "mqtt://10.0.0.55",
        "topic": "landroid"
    },
    "scheduler": {
        "enable": false,
        "cron": false,
        "weather": {
            "provider": "wunderground",
            "apiKey": "YOUR_API_KEY",
            "latitude": 50.00,
            "longitude": 8.00
        },
        "db": "./scheduler.db",
        "earliestStart": 10,
        "latestStop": 15,
        "startEarly": true,
        "offDays": 2,
        "squareMeters": 200,
        "perHour": 50,
        "mowTime": 60,
        "chargeTime": 60,
        "daysForTotalCut": 4,
        "rainDelay": 90,
        "threshold": 30
    }
}

These messages appear in the container log:

[2020-02-26T18:40:50.511] [INFO] IoBrokerAdapter - mower 0 selected
[2020-02-26T18:41:48.976] [INFO] LandroidS - Could not finish initialization, retrying...
Mqtt url: undefined
[2020-02-26T18:41:50.640] [INFO] IoBrokerAdapter - mower 0 selected
[2020-02-26T18:42:48.976] [INFO] LandroidS - Could not finish initialization, retrying...
Mqtt url: undefined
[2020-02-26T18:42:50.521] [INFO] IoBrokerAdapter - mower 0 selected
[2020-02-26T18:43:48.976] [INFO] LandroidS - Could not finish initialization, retrying...

I have found out that the Mqtt url: undefined is harmless, this is a debug message from the used library. There is an issue for that, but development seems to have moved on so I wouldn't hold my breath waiting on a fix.

Yes, I have come to the same conclusion. While some portions of the code is similar, the new NPM package seems to have a much tighter integration with ioBroker. I think it would be a good start to write a generic package that can connect to the landroid worx cloud. However, my time for this is rather limited.

I'm facing the same connection issues, though, so this ticket is still valid and any solution would be highly appreciated.

Yes, also from my end

It looks like only link to AWS has changed, but no idea how to change this in the distribution :-/

Do you know which link has changed? If so, a simple search and replace could make it work again. I have a little bit experience with programming in TypeScript and Docker.

That's what I've got from the desktop App to manage Landroid
a1optpg91s0ydf-ats.iot.eu-west-1.amazonaws.com

I made a brief check to the files from this bridge and found ASW links pointing to east-x.amazonaws.com, so this might be the one. As I'm not experienced enough, I left it ;-)
Happy if you find a way to change this?

Sorry, but where did you find links to east-x.amazonaws.com in this repository? When I search for aws this issue right here is the only occurence.

This is e.g. from aws4.js
RequestSigner.prototype.createHost = function() { var region = this.isSingleRegion() ? '' : (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region, service = this.service === 'ses' ? 'email' : this.service return service + region + '.amazonaws.com' }
I simply used totalcommander search in files for amazonaws.com and found various occurence, not sure if this can be changed?

Did you grep your local files with Total Commander? If so, did you include your node_modules folder? Could you post the path to the file with the match, please?

Hi guys,
trying the same. changed log-level to debug and here is what i found out:

bridge is using "old" api or better: old iobroker.library for worx (https://github.com/MeisterTR/ioBroker.landroid-s) and tries to get some parameters which aren't there, so it's logging "board undefined selected":

https://github.com/MeisterTR/ioBroker.landroid-s/blob/master/lib/mqttCloud.js
Line 135 it tries to get "mqtt_topic_prefix" which was provided by a "board" which were get before (list of boards). MAYBE this could be fixed because the mower in your profile does provide mqtt informations.
But also found out, that there is a new "library" for worx, but only used in a iobroker-adapter - or just only implemented in:

https://github.com/iobroker-community-adapters/ioBroker.worx/blob/master/lib/api.js

So this has to be taken and implemented in an own running bridge (which i prefer because it's open to all apps, like openhab, other mqtt handling app).

Done for today.

This is a good sum up of my own findings. Thank you for putting them into words, @KaaNee . I did a quick compare of the two files mentioned (ioBroker.landroid-s/blob/master/lib/mqttCloud.js, ioBroker.worx/blob/master/lib/api.js) and tried to use the newer one with virtualzone/landroid-bridge but have not gotten very far. I'll talk to @MeisterTR and see wether it is possible to move the landroid API to its own package.

[EDIT]
For reference: Here's the issue in the old repository: https://github.com/MeisterTR/ioBroker.landroid-s/issues/34

Sorry, but where did you find links to east-x.amazonaws.com in this repository? When I search for aws this issue right here is the only occurence.

Hi, sorry was busy over past day(s) :-/

Here is result from my TotalCommander
\landroid-bridge\node_modules\aws4\aws4.js
\landroid-bridge\node_modules\aws4\README.md
\landroid-bridge\node_modules\es6-promise\README.md
\landroid-bridge\node_modules\mqtt\README.md
\landroid-bridge\node_modules\node-pre-gyp\lib\info.js
\landroid-bridge\node_modules\node-pre-gyp\lib\publish.js
\landroid-bridge\node_modules\node-pre-gyp\lib\unpublish.js
\landroid-bridge\node_modules\node-pre-gyp\README.md
\landroid-bridge\node_modules\psl\data\rules.json
\landroid-bridge\node_modules\psl\dist\psl.js
\landroid-bridge\node_modules\psl\dist\psl.min.js
\landroid-bridge\node_modules\spdx-license-ids\README.md
\landroid-bridge\node_modules\sqlite3\package.json

Regards
Joerg

should be fixed now

cm86 commented

So I've tried to use the docker image...
But it's still saying mqtt url undefined.
Where did you solve the issue!?
Do I have to use locally!?

Thanks in advance.
Chris

i think you have to reinstall to get the changes

i think you have to reinstall to get the changes

Thanks for you effort and support on this.
Just to be precise, it's now included in this landroid-bridge and I shall be able to "simply" download this new version and install?

I just ask as I don't see any files updated when I'm on main page of this distr.

Regards
Joerg

i think you have to reinstall to get the changes

Hi, thanks @MeisterTR for applying these changes (nearly the same i did locally) :-)
May you please publish the npm package ?
https://www.npmjs.com/package/iobroker.landroid-s

It should be compatible with 2.5.5 (i'm not sure how to flag this in npm), as the dependency in landroid-bridge is "^2.5.5" (^= compatible with ).

Thanks in advance. If i can help or take some work, just let us know.

Regards,
Kai

Until these changes are published as an individual NPM package you can use the following Dockerfile to get a working image again (tested succesfully in my local HA setup):

FROM node:11-alpine AS prod

WORKDIR /usr/src/app

# Add package.json
COPY package*.json .

RUN apk add --no-cache git

# Restore node modules
RUN npm install --production



## BUILD STEP
FROM prod AS build

# Add everything else not excluded by .dockerignore
COPY . .

# Build it
RUN npm install && \
    npm run build-prod



## FINAL STEP
FROM prod as final

RUN apk del git

COPY --from=build /usr/src/app/dist ./dist

EXPOSE 3000
CMD [ "node", "dist/server.js" ]

I have created PR #89 that contains the multi-staged builds from the above Dockerfile. I will wait on @MeisterTR and see if he creates a new NPM package in the next few days. If not, above file will probably make it into another PR. ๐Ÿ™‚

Until these changes are published as an individual NPM package you can use the following Dockerfile to get a working image again (tested succesfully in my local HA setup):

FROM node:11-alpine AS prod

WORKDIR /usr/src/app

# Add package.json
COPY package*.json .

RUN apk add --no-cache git

# Restore node modules
RUN npm install --production



## BUILD STEP
FROM prod AS build

# Add everything else not excluded by .dockerignore
COPY . .

# Build it
RUN npm install && \
    npm run build-prod



## FINAL STEP
FROM prod as final

RUN apk del git

COPY --from=build /usr/src/app/dist ./dist

EXPOSE 3000
CMD [ "node", "dist/server.js" ]

Hi Riker,
again thanks a lot for your effort and support. I modified both docker files
Dockerfile
Dockerfile.rpi

but, it's still not working :-/ Probably I made something wrong? Happy for any advise/help

Regards
Joerg

cm86 commented

Yes i also can't get it to work.

What i've done:

  • Cloned this repo
  • edited the Dockerfile to

Until these changes are published as an individual NPM package you can use the following Dockerfile to get a working image again (tested succesfully in my local HA setup):

FROM node:11-alpine AS prod

WORKDIR /usr/src/app

# Add package.json
COPY package*.json .

RUN apk add --no-cache git

# Restore node modules
RUN npm install --production



## BUILD STEP
FROM prod AS build

# Add everything else not excluded by .dockerignore
COPY . .

# Build it
RUN npm install && \
    npm run build-prod



## FINAL STEP
FROM prod as final

RUN apk del git

COPY --from=build /usr/src/app/dist ./dist

EXPOSE 3000
CMD [ "node", "dist/server.js" ]
  • Build the container with docker build -t landroid-bridge .
  • run the container with docker run -d -p 3000:3000 --name landroid_bridge -v /opt/landroid-bridge/config.json:/usr/src/app/config.json --restart=unless-stopped landroid-bridge

Looked at the docker logs...
[2020-03-04T18:15:03.908] [INFO] LandroidS - Initializing Landroid Cloud Service... Mqtt url: undefined [2020-03-04T18:15:05.458] [INFO] IoBrokerAdapter - mower 0 selected

Maybe i'm doing something wrong?

mfg
Chris

Sorry, yeah. Actually I forgot to add my modified package.json. Remember, MeisterTR has updated the ioBroker.landroid-s repository? You need to build the Docker image with these changes.

These are the steps required:

  1. Clone this repository
  2. Update Dockerfile (see above)
  3. Modify package.json
@@ -34,7 +34,7 @@
     "cache": "^2.1.0",
     "cron": "^1.7.1",
     "express": "^4.17.0",
-    "iobroker.landroid-s": "^2.5.5",
+    "iobroker.landroid-s": "github:MeisterTR/ioBroker.landroid-s#bc5bda3a495a87105bb4723b472c15846aec8e4e",
     "log4js": "^4.3.0",
     "moment": "^2.24.0",
     "mqtt": "^2.18.8",
  1. Build Docker image

This is the reason why the Dockerfile above has apk add --no-cache git in it (and later the removal of that package) and the Dockerfile from my PR does not.

cm86 commented

So I have this too.
But I ran into this error
`[root@HomeAssistant landroid-bridge]# docker build -t landroid-bridge . Sending build context to Docker daemon 1.435MB
Step 1/13 : FROM node:11-alpine AS prod
---> f18da2f58c3d
Step 2/13 : WORKDIR /usr/src/app
---> Using cache
---> e07cf2732dc9
Step 3/13 : COPY package*.json .
---> Using cache
---> aad89be759ff
Step 4/13 : RUN apk add --no-cache git
---> Using cache
---> f18cc0133cda
Step 5/13 : RUN npm install --production
---> Running in 838249831e04
npm ERR! file /usr/src/app/package.json
npm ERR! code EJSONPARSE
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token
npm ERR! JSON.parse in JSON at position 101 while parsing '{ "name": "landroid-bridge", "version": '
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-03-05T21_22_26_313Z-debug.log
The command '/bin/sh -c npm install --production' returned a non-zero code: 1`

And I've never used Docker before, was happy to have it installed with NPM :-/
Just to ask: is there a brief decription how to use Docker to package this?
I think I have Git installed already, but as I said: I'm not a programmer :-(

Hi,
I just updated the package.json with the github link to the updates Repo from @MeisterTR .
Like the example from @riker09 .
Than I build it localy and start it.
Shortly after the start it shows the Error:
[2020-03-06T09:00:09.847] [INFO] LandroidS - Could not finish initialization, retrying...

Did someone successfully run it without docker or can me help with this error?

regards Saboti

We all have very different backgrounds and I tend to forget that. Sorry for that! ๐Ÿ˜…

So, bear with me, be patient, and I believe we can pull it off together. Regarding the question from @int5749 here's the command to build a Docker container:

docker build --tag virtualzone/landroid-bridge:YOURTAG .

This command must be issued inside the folder where the Dockerfile is located. Note the dot at the end of the line, it is very important and easy to forget. Also, you can tag your image any way you see fit. You don't need the virtualzone/ prefix in the image name. You can just name it landroid-bridge and omit the :YOURTAG, Docker automatically tags the image with :latest in this case. You only need to make sure you're actually using the image you have build:

docker run \
    -p 3000:3000 \
    --name landroid_bridge \
    --link mqtt:mqtt \
    -v /tmp/config.json:/usr/src/app/config.json \
    virtualzone/landroid-bridge:YOURTAG

This command is taken from the README.md of this repository. I have only added the :YOURTAG.

@Saboti Yes, landroid-bridge is working for me. Are you running the code locally (with node dist/server.js or inside a docker container?

@cm86 Please provide your modified package.json. Use three backticks before and after the code for better indentation and (optional) syntax highlighting right here in the issue. The editor also has a pointy brackets button (< >) to format code. Just select the lines you want to mark as code and click the button. You can add json after the first three backticks to apply syntax highlighting.

This is the modified package.json I've been using:

{
  "name": "landroid-bridge",
  "version": "0.1.0",
  "description": "Publishes readings from the Worx Landroid S Lawn Mower via HTTP (REST, JSON) and MQTT.",
  "main": "index.js",
  "scripts": {
    "test": "NODE_ENV=dev mocha --reporter spec --require ts-node/register 'test/**/*.test.ts'",
    "grunt": "grunt",
    "start": "node dist/server.js",
    "dev": "npm run clean && npm run grunt && NODE_ENV=dev node dist/server.js",
    "clean": "rm -rf dist/",
    "build-prod": "npm run clean && npm run grunt && npm prune --production"
  },
  "author": "weweave UG <mail@weweave.net>",
  "license": "GPL-3.0",
  "devDependencies": {
    "@types/express": "^4.16.1",
    "@types/mocha": "^5.2.6",
    "@types/node": "^12.0.2",
    "@types/sqlite3": "^3.1.5",
    "chai": "^4.2.0",
    "grunt": "^1.0.4",
    "grunt-cli": "^1.3.2",
    "grunt-contrib-watch": "^1.1.0",
    "grunt-ts": "^6.0.0-beta.22",
    "grunt-tslint": "^5.0.2",
    "mocha": "^6.1.4",
    "ts-node": "^8.1.1",
    "tslint": "^5.16.0",
    "typescript": "^3.4.5"
  },
  "dependencies": {
    "body-parser": "^1.19.0",
    "cache": "^2.1.0",
    "cron": "^1.7.1",
    "express": "^4.17.0",
    "iobroker.landroid-s": "github:MeisterTR/ioBroker.landroid-s#bc5bda3a495a87105bb4723b472c15846aec8e4e",
    "log4js": "^4.3.0",
    "moment": "^2.24.0",
    "mqtt": "^2.18.8",
    "sqlite3": "^4.0.8"
  }
}

@Saboti Yes, landroid-bridge is working for me. Are you running the code locally (with node dist/server.js or inside a docker container?

@riker09 i run it locally with node dist/server.js

That should work as well. I assume that you have removed the node_modules folder and ran npm install again? (Because this is what happens during the docker build inside the container)

cm86 commented

So i also got it to work.
First i cleaned up my docker environment off all containers/images that are not working

docker system prune -a

Here are the Steps:

  • edit Dockerfile
    -- so mine looks now like that:
FROM node:11-alpine AS prod

WORKDIR /usr/src/app

# Add package.json
COPY package*.json .

RUN apk add --no-cache git

# Restore node modules
RUN npm install --production



## BUILD STEP
FROM prod AS build

# Add everything else not excluded by .dockerignore
COPY . .

# Build it
RUN npm install && \
    npm run build-prod



## FINAL STEP
FROM prod as final

RUN apk del git

COPY --from=build /usr/src/app/dist ./dist

EXPOSE 3000
CMD [ "node", "dist/server.js" ]
  • edit package.json
    -- so mine looks like that
{
  "name": "landroid-bridge",
  "version": "0.1.0",
  "description": "Publishes readings from the Worx Landroid S Lawn Mower via HTTP (REST, JSON) and MQTT.",
  "main": "index.js",
  "scripts": {
    "test": "NODE_ENV=dev mocha --reporter spec --require ts-node/register 'test/**/*.test.ts'",
    "grunt": "grunt",
    "start": "node dist/server.js",
    "dev": "npm run clean && npm run grunt && NODE_ENV=dev node dist/server.js",
    "clean": "rm -rf dist/",
    "build-prod": "npm run clean && npm run grunt && npm prune --production"
  },
  "author": "weweave UG <mail@weweave.net>",
  "license": "GPL-3.0",
  "devDependencies": {
    "@types/express": "^4.16.1",
    "@types/mocha": "^5.2.6",
    "@types/node": "^12.0.2",
    "@types/sqlite3": "^3.1.5",
    "chai": "^4.2.0",
    "grunt": "^1.0.4",
    "grunt-cli": "^1.3.2",
    "grunt-contrib-watch": "^1.1.0",
    "grunt-ts": "^6.0.0-beta.22",
    "grunt-tslint": "^5.0.2",
    "mocha": "^6.1.4",
    "ts-node": "^8.1.1",
    "tslint": "^5.16.0",
    "typescript": "^3.4.5"
  },
  "dependencies": {
    "body-parser": "^1.19.0",
    "cache": "^2.1.0",
    "cron": "^1.7.1",
    "express": "^4.17.0",
    "iobroker.landroid-s": "github:MeisterTR/ioBroker.landroid-s#bc5bda3a495a87105bb4723b472c15846aec8e4e",
    "log4js": "^4.3.0",
    "moment": "^2.24.0",
    "mqtt": "^2.18.8",
    "sqlite3": "^4.0.8"
  }
}
  • build the image
    -- with this command
docker build --tag virtualzone/landroid-bridge:selfmade .
  • run the container
docker run -d    -p 3000:3000     --name landroid_bridge -v /opt/landroid-bridge/config.json:/usr/src/app/config.json     --restart=unless-stopped   virtualzone/landroid-bridge:selfmade

so thanks for your support

That should work as well. I assume that you have removed the node_modules folder and ran npm install again? (Because this is what happens during the docker build inside the container)

really strange, I delete the Folder and installed again. Same Error happen.
I even tryed it on another Server. Same Error :(
Problem is at Home i use a OrangePi Plus2e with an Armv7 so I didn't get the Docker to work so far.
Any Ideas?

maybe try on a x86 server? One problem at a time. ๐Ÿ™‚

Can you please post your full package.json?

package.json

{
"name": "landroid-bridge",
"version": "0.1.0",
"description": "Publishes readings from the Worx Landroid S Lawn Mower via HTTP (REST, JSON) and MQTT.",
"main": "index.js",
"scripts": {
"test": "NODE_ENV=dev mocha --reporter spec --require ts-node/register 'test/**/*.test.ts'",
"grunt": "grunt",
"start": "node dist/server.js",
"dev": "npm run clean && npm run grunt && NODE_ENV=dev node dist/server.js",
"clean": "rm -rf dist/",
"build-prod": "npm run clean && npm run grunt && npm prune --production"
},
"author": "weweave UG mail@weweave.net",
"license": "GPL-3.0",
"devDependencies": {
"@types/express": "^4.16.1",
"@types/mocha": "^5.2.6",
"@types/node": "^12.0.2",
"@types/sqlite3": "^3.1.5",
"chai": "^4.2.0",
"grunt": "^1.0.4",
"grunt-cli": "^1.3.2",
"grunt-contrib-watch": "^1.1.0",
"grunt-ts": "^6.0.0-beta.22",
"grunt-tslint": "^5.0.2",
"mocha": "^6.1.4",
"ts-node": "^8.1.1",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
},
"dependencies": {
"body-parser": "^1.19.0",
"cache": "^2.1.0",
"cron": "^1.7.1",
"express": "^4.17.0",
"iobroker.landroid-s": "github:MeisterTR/ioBroker.landroid-s#bc5bda3a495a87105bb4723b472c15846aec8e4e",
"log4js": "^4.3.0",
"moment": "^2.24.0",
"mqtt": "^2.18.8",
"sqlite3": "^4.0.8"
}
}

Had the same idea. I have a hetzner Server. Did try it there. fresh install. Same Error :-(

I ran into some issues when trying to npm install with the unmodified Docker image. I had to install git first, since the NPM package manager will try to fetch from GitHub. But since you don't seem to have an issue with npm install but rather with the running program I fear I'm out of ideas.

Maybe one more thing: Please provide the full log output of a single run. Did you verify that your credentials in the config.json are valid?

@riker09 this is realy strange. If i'am switching to debug i see that he connects to the Cloud an get my Mower.
And than [2020-03-06T13:54:13.496] [INFO] LandroidS - Could not finish initialization, retrying...
I even tryed to update my node to v12. No difference.
I'am also out of ideas.

Hey Guys,

for finding the source of "Could not finish..." please try to change following line in your config.json:

"logLevel": "info",

into

"logLevel": "debug",

Pay attention to the comma at the end of the line.
Then restart/start the server.
Now you should get more Output on the console. Then tell here, what was the last thing that worked or written before "Could not finish...".

BTW: Check that you don't paste just all of the output, since there may be your private data between those outputs. (Password, email, MAC-Address of your mower). This should not be published.

Regards,
Kai

Hi @KaaNee
[2020-03-06T15:23:11.818] [INFO] server.ts - Starting Landroid Bridge... [2020-03-06T15:23:11.836] [INFO] server.ts - Setting port to 3000... [2020-03-06T15:23:12.100] [INFO] Mqtt - Connecting to MQTT Broker... [2020-03-06T15:23:12.112] [INFO] App - Adding static files path /opt/landroid-bridge/www [2020-03-06T15:23:12.115] [INFO] Scheduler - Skipping scheduler initialization (not enabled) [2020-03-06T15:23:12.136] [INFO] LandroidS - Initializing Landroid Cloud Service... [2020-03-06T15:23:12.151] [DEBUG] IoBrokerAdapter - post:{"username":"xxxxxxxxxxx","password":"xxxxxxxx","grant_type":"password","client_id":1,"type":"app","client_secret":"xxxxxxxxxxxxxxxx","scope":"*"} [2020-03-06T15:23:12.153] [DEBUG] IoBrokerAdapter - nCH3A0WvMYn66vGorjSrnGZ2YtjQWDiCvjg7jNxK [2020-03-06T15:23:12.301] [INFO] Mqtt - Successfully connected to MQTT Broker! [2020-03-06T15:23:13.049] [DEBUG] IoBrokerAdapter - post to oauth/token: {"token_type":"Bearer","expires_in":31536000,"access_token":"xxx","refresh_token":"xxx"} [2020-03-06T15:23:13.050] [DEBUG] IoBrokerAdapter - [2020-03-06T15:23:13.534] [DEBUG] IoBrokerAdapter - users/me: {"id":xxxx,"email":"xxxx","name":"xxxx","surname":null,"user_type":"customer","locale":"en","push_notifications":true,"location":{"latitude":xxxxx,"longitude":xxxx},"terms_of_use_agreed":true,"country_id":276,"mqtt_endpoint":"a1optpg91s0ydf-ats.iot.eu-west-1.amazonaws.com","actions_on_google_pin_code":null,"created_at":"2019-05-16 19:53:45","updated_at":"2019-11-02 12:25:49"} [2020-03-06T15:23:13.535] [DEBUG] IoBrokerAdapter - Mqtt url: a1optpg91s0ydf-ats.iot.eu-west-1.amazonaws.com [2020-03-06T15:23:13.536] [DEBUG] IoBrokerAdapter - [2020-03-06T15:23:14.023] [DEBUG] IoBrokerAdapter - AWS certificate done [2020-03-06T15:23:14.024] [DEBUG] IoBrokerAdapter - [2020-03-06T15:23:14.264] [DEBUG] IoBrokerAdapter - product-items [{"id":xxx,"product_id":xxxx,"user_id":xxxxxx,"serial_number":"xxxxx","mac_address":"xxxxx","name":"M500","setup_location":{"latitude":xxxx,"longitude":xxxx},"locked":false,"firmware_version":2.92,"firmware_auto_upgrade":true,"distance_covered":40086,"mower_work_time":3078,"blade_work_time":3078,"battery_charge_cycles":42,"messages_in":663,"messages_out":16747,"push_notifications":true,"city":{"id":xxxxx,"country_id":276,"name":"xxxxxxx","latitude":xxxxxx,"longitude":xxxx,"created_at":"2018-02-15 22:36:41","updated_at":"2018-02-15 22:36:41"},"sim":null,"push_notifications_level":"warning","lawn_size":57,"lawn_perimeter":null,"raw_messages_in":26328,"raw_messages_out":16747,"test":0,"iot_registered":true,"warranty_registered":true,"pin_code":null,"time_zone":"Europe/Berlin","purchased_at":"2019-05-16 00:00:00","warranty_expires_at":"2022-05-16 00:00:00","registered_at":"2019-05-17 00:00:00","online":false,"app_settings":null,"accessories":{"ultrasonic":true},"features":{"wifi_connection":"smartlink_tube_display","display_type":"tube","lock":true,"pin":true,"rain_delay":true,"chassis":"m_2019","mqtt":true,"provisionable":true,"wifi_pairing":"smartlink","tracking_firmware":true,"provisoning_replaceable":true},"auto_schedule_settings":null,"auto_schedule":false,"pending_radio_link_validation":null,"mqtt_topics":{"command_in":"PRM100/98D86344D30C/commandIn","command_out":"PRM100/98D86344D30C/commandOut"},"created_at":"2019-04-02 07:55:04","updated_at":"2020-03-06 01:14:38"}] [2020-03-06T15:23:14.265] [INFO] IoBrokerAdapter - mower 0 selected [2020-03-06T15:23:14.266] [DEBUG] IoBrokerAdapter - Mac adress set to: xxxxxxx [2020-03-06T15:23:14.573] [DEBUG] IoBrokerAdapter - Mqtt connected! [2020-03-06T15:24:12.152] [INFO] LandroidS - Could not finish initialization, retrying...
Switched to Debug. My Mower is found in the Cloud. Don't know why he cant finish the initalization.
Maybe because my Mover is Switched off? Does he needs to be online?

We all have very different backgrounds and I tend to forget that. Sorry for that! ๐Ÿ˜…

So, bear with me, be patient, and I believe we can pull it off together. Regarding the question from @int5749 here's the command to build a Docker container:

docker build --tag virtualzone/landroid-bridge:YOURTAG .

This command must be issued inside the folder where the Dockerfile is located. Note the dot at the end of the line, it is very important and easy to forget. Also, you can tag your image any way you see fit. You don't need the virtualzone/ prefix in the image name. You can just name it landroid-bridge and omit the :YOURTAG, Docker automatically tags the image with :latest in this case. You only need to make sure you're actually using the image you have build:

docker run \
    -p 3000:3000 \
    --name landroid_bridge \
    --link mqtt:mqtt \
    -v /tmp/config.json:/usr/src/app/config.json \
    virtualzone/landroid-bridge:YOURTAG

This command is taken from the README.md of this repository. I have only added the :YOURTAG.

OK, I have downloaded Docker. Do I require a DockerID, or would it work without?
How does Docker know what to download from where?

OK, ich habe Docker installiert, aber keinen Account erstellt
eine CMD geรถffnet und hello-world test ergab keinen Fehler
Dann habe ich den Befehl
docker build --tag landroid-bridge:YOURTAG .
ausgefรผhrt und schon hagelt es Fehler :-(

DockerError.txt

Good News. It's working now.
I just reconnected my Landroid with my Wlan.
Thanks for all the Support.
Regards Saboti

OK, ich habe Docker installiert, aber keinen Account erstellt
eine CMD geรถffnet und hello-world test ergab keinen Fehler
Dann habe ich den Befehl
docker build --tag landroid-bridge:YOURTAG .
ausgefรผhrt und schon hagelt es Fehler :-(

DockerError.txt

Hi, bist Du unter Windows unterwegs?
Wenn ja, denke ich das ist das Hauptproblem. Das hier bezieht sich alles auf Linux. Mit Dockery unter Windows kenne ich mich leider nicht aus.
GruรŸ Saboti

Yes, I'm running all on Windows, thought I already mentioned. And this might be the reason why it's not working, even I expected that commands would be the same as they are used within the "bridge". This case it looks I have to wait until someone fixes NPM package, as last year :-/

cm86 commented

So hello again...
I have another problem...

  • first, the webserver answered me with
    cannot GET
    --> here I copied the www folder from the repo into the container on path (wasn't present there inside the container)
    /usr/src/app/
    --> solved
  • second
    When I'm starting the mower over home assistant or over the webui, it's not starting...
    Docker logs are shown as following
[2020-03-07T18:34:36.545] [INFO] LandroidS - Sending to landroid cloud: {"cmd":1}
[2020-03-07T18:34:38.895] [INFO] Mqtt - Publishing MQTT message to topic landroid/status/dateTime: 2020-03-07 19:34:39
[2020-03-07T18:34:38.895] [INFO] Mqtt - Publishing MQTT message to topic landroid/status/batteryVoltage: 19.77
[2020-03-07T18:34:38.896] [INFO] Mqtt - Publishing MQTT message to topic landroid/status/batteryTemperature: 12.3
[2020-03-07T18:34:38.896] [INFO] Mqtt - Publishing MQTT message to topic landroid/status/pitch: -1.1 ```


But he isn't starting

MFG Chris

@Saboti

I just reconnected my Landroid with my Wlan.

Could you please expand on this? You mean you just restarted your router, restarted the mower or you reconfigured wifi on the mower through the mobile app or mower ui?

I'm having same issue with below, but it's able to get my info from the landroid cloud in the debug logs.

[DEBUG] IoBrokerAdapter - Worxcloud MQTT offline
[INFO] LandroidS - Could not finish initialization, retrying...

Tried everything. I'm running locally. Can't seem to get the docker images to work on raspberry pi zero. What would the Dockerfile_rpi look like if it were updated?

@Saboti

I just reconnected my Landroid with my Wlan.

Could you please expand on this? You mean you just restarted your router, restarted the mower or you reconfigured wifi on the mower through the mobile app or mower ui?

I'm having same issue with below, but it's able to get my info from the landroid cloud in the debug logs.

[DEBUG] IoBrokerAdapter - Worxcloud MQTT offline
[INFO] LandroidS - Could not finish initialization, retrying...

Tried everything. I'm running locally. Can't seem to get the docker images to work on raspberry pi zero. What would the Dockerfile_rpi look like if it were updated?

Hi, yes I only did reconfigure the Wlan of the Mower within the App.
After this everything worked.

Regards Saboti.
P.S. Hat the same Problems with the Dockery Image for PI. Because of this, I run it locally.

@Saboti

I just reconnected my Landroid with my Wlan.

Could you please expand on this? You mean you just restarted your router, restarted the mower or you reconfigured wifi on the mower through the mobile app or mower ui?
I'm having same issue with below, but it's able to get my info from the landroid cloud in the debug logs.

[DEBUG] IoBrokerAdapter - Worxcloud MQTT offline
[INFO] LandroidS - Could not finish initialization, retrying...

Tried everything. I'm running locally. Can't seem to get the docker images to work on raspberry pi zero. What would the Dockerfile_rpi look like if it were updated?

Hi, yes I only did reconfigure the Wlan of the Mower within the App.
After this everything worked.

Regards Saboti.
P.S. Hat the same Problems with the Dockery Image for PI. Because of this, I run it locally.

I'm seeing that you never received this in your logs:

[DEBUG] IoBrokerAdapter - Worxcloud MQTT offline
[INFO] LandroidS - Could not finish initialization, retrying...

Instead you received this (which is the only place in our logs that we differ):

[DEBUG] IoBrokerAdapter - Mqtt connected!
[INFO] LandroidS - Could not finish initialization, retrying...

I tried reconfiguring wifi and that didn't seem to fix it.

In your logs does it still give this as the aws endpoint?

[DEBUG] IoBrokerAdapter - Mqtt url: a1optpg91s0ydf-ats.iot.eu-west-1.amazonaws.com

I can ping "a1optpg91s0ydf-ats.iot.eu-west-1.amazonaws.com", but "Worxcloud MQTT offline" means that this mqtt url is incorrect according to the source. Which has got me scratching my head.

hmm I can get status through my android app, but now I can't set anything. Wonder if this is related. Wonder if banned my account to access the cloud mqtt server.

ok this is working now, I changed from mosquitto port 1883 to 8883 encrypted.

Great to hear that everybody is ironing out their quirks! ๐Ÿ™‚

@szmania The updated RPI Dockerfile would probably look something like this (no guarantees):

FROM arm32v7/node:8 AS base

WORKDIR /usr/src/app

# Add package.json
COPY package*.json .

RUN apk add --no-cache git

# Restore node modules
RUN npm install --production



## BUILD STEP
FROM base AS build

# Add everything else not excluded by .dockerignore
COPY . .

# Build it
RUN npm install && \
    npm run build-prod



## FINAL STEP
FROM base AS final

RUN apk del git

COPY --from=build /usr/src/app/dist ./dist

EXPOSE 3000
CMD [ "node", "dist/server.js" ]

The only change towards my modified X86 image is the base image (arm32v7/node:8). However, I don't have a way to test that file, so if you were able to get it running in the meantime I suggest, you don't change anything unless you really have to.

PS: The original Dockerfile.rpi looks a bit confusing to me. For building an arm32-based image is used, but the final container runs on node:8-alpine. I'm not an expert on that particular image and I suppose this could run on any arm32 based device. However, I'm not taking chances in my modified version and use the same image for base, build and final stage.

Got a working RPI Dockerfile:

FROM arm32v7/node:8-alpine AS base

WORKDIR /usr/src/app

# Add package.json
COPY package*.json .

RUN apk --no-cache add git python2-dev make g++ gcc

# Restore node modules
RUN npm install --production

## BUILD STEP
FROM base AS build

# Add everything else not excluded by .dockerignore
COPY . .

# Build it
RUN npm install && \
    npm run build-prod

## FINAL STEP
FROM base AS final

RUN apk del git python2-dev make g++ gcc

COPY --from=build /usr/src/app/dist ./dist

EXPOSE 3000
CMD [ "node", "dist/server.js" ]

Regards Saboti

Aha, so it was just some missing packages in the OS. python2-dev make g++ gcc

This is good to know, since I'm planning to move the bridge to Raspberry Pi. ๐Ÿ‘

ok this is working now, I changed from mosquitto port 1883 to 8883 encrypted.

@szmania Can you explain where you changed the port? I am having the same issue.

So hello again...
I have another problem...

  • first, the webserver answered me with
    cannot GET
    --> here I copied the www folder from the repo into the container on path (wasn't present there inside the container)
    /usr/src/app/
    --> solved
  • second
    When I'm starting the mower over home assistant or over the webui, it's not starting...
    Docker logs are shown as following
[2020-03-07T18:34:36.545] [INFO] LandroidS - Sending to landroid cloud: {"cmd":1}
[2020-03-07T18:34:38.895] [INFO] Mqtt - Publishing MQTT message to topic landroid/status/dateTime: 2020-03-07 19:34:39
[2020-03-07T18:34:38.895] [INFO] Mqtt - Publishing MQTT message to topic landroid/status/batteryVoltage: 19.77
[2020-03-07T18:34:38.896] [INFO] Mqtt - Publishing MQTT message to topic landroid/status/batteryTemperature: 12.3
[2020-03-07T18:34:38.896] [INFO] Mqtt - Publishing MQTT message to topic landroid/status/pitch: -1.1 ```


But he isn't starting

MFG Chris

@cm86 did you find a solution to the second problem, where you couldn't start the mower?
I have the exact same problem...

OK after multiple hours I'm still not able to get it to work.

ATM it seems that the connection to AWS is working and all the data from the mover is received accroding to the Log:

2020-03-21T22:59:37.667] [DEBUG] IoBrokerAdapter - Mac adress set to: <MAC> <-- Shows the correct MAC

[2020-03-21T22:59:37.665] [DEBUG] IoBrokerAdapter - product-items <-- Shows all the Data

But I still have this message:

[2020-03-21T22:58:38.113] [DEBUG] IoBrokerAdapter - Worxcloud MQTT offline
[2020-03-21T22:59:35.496] [INFO] LandroidS - Could not finish initialization, retrying...

And when I Sub to the MQTT I dont get any messages.
I disabled MQTT since one solution was to change to an encryptet Port for the MQTT, just to know if the error came from my MQTT somehow

@szmania When it started to work for you, did you still have these messages in your log? Or is it working regardless these Errors?

I also don't see anything on the Web-GUI , it just says Loading. And I also had to copy the www-Folder manually to the Container.

Are there more Logs I can check? It's frustrating that all the Data are there but it still fails somehow.....

Im Running it in a Docker on a Raspberry

The mqtt seems to already be using ssl, so I don't know what port he switched to secure.
But for me it turned out I was temporarily banned, probably due to rate limiting and all the retries.
I stopped the container and left the mower alone for 1-2 days, and then it started working.
I still have the problem, that I can't send commands through the bridge OR the app though. At least now I can read the mower state. It has been like this since took the mower out of storage to prepare for spring. There was a firmware update but it didn't help.

P.S.
When I was banned, the app worked through 4G and did not on my WiFi. But I haven't been able to send commands with any network or IP, so it must be different problem.

OK seems like my IP was bocked as well, now its working for a day

cm86 commented

So hello again...
I have another problem...

  • first, the webserver answered me with
    cannot GET
    --> here I copied the www folder from the repo into the container on path (wasn't present there inside the container)
    /usr/src/app/
    --> solved
  • second
    When I'm starting the mower over home assistant or over the webui, it's not starting...
    Docker logs are shown as following
[2020-03-07T18:34:36.545] [INFO] LandroidS - Sending to landroid cloud: {"cmd":1}
[2020-03-07T18:34:38.895] [INFO] Mqtt - Publishing MQTT message to topic landroid/status/dateTime: 2020-03-07 19:34:39
[2020-03-07T18:34:38.895] [INFO] Mqtt - Publishing MQTT message to topic landroid/status/batteryVoltage: 19.77
[2020-03-07T18:34:38.896] [INFO] Mqtt - Publishing MQTT message to topic landroid/status/batteryTemperature: 12.3
[2020-03-07T18:34:38.896] [INFO] Mqtt - Publishing MQTT message to topic landroid/status/pitch: -1.1 ```


But he isn't starting

MFG Chris

@cm86 did you find a solution to the second problem, where you couldn't start the mower?
I have the exact same problem...

Hello again and sorry for the late reply.
No i can't even control the mower over the bridge/home assistant...
I have also the experiance that if the bridge is running my Android is stugling a bit.
I think it's because i have also been blocked...

So i also got it to work.
First i cleaned up my docker environment off all containers/images that are not working

docker system prune -a

Here are the Steps:

  • edit Dockerfile
    -- so mine looks now like that:
FROM node:11-alpine AS prod

WORKDIR /usr/src/app

# Add package.json
COPY package*.json .

RUN apk add --no-cache git

# Restore node modules
RUN npm install --production



## BUILD STEP
FROM prod AS build

# Add everything else not excluded by .dockerignore
COPY . .

# Build it
RUN npm install && \
    npm run build-prod



## FINAL STEP
FROM prod as final

RUN apk del git

COPY --from=build /usr/src/app/dist ./dist

EXPOSE 3000
CMD [ "node", "dist/server.js" ]
  • edit package.json
    -- so mine looks like that
{
  "name": "landroid-bridge",
  "version": "0.1.0",
  "description": "Publishes readings from the Worx Landroid S Lawn Mower via HTTP (REST, JSON) and MQTT.",
  "main": "index.js",
  "scripts": {
    "test": "NODE_ENV=dev mocha --reporter spec --require ts-node/register 'test/**/*.test.ts'",
    "grunt": "grunt",
    "start": "node dist/server.js",
    "dev": "npm run clean && npm run grunt && NODE_ENV=dev node dist/server.js",
    "clean": "rm -rf dist/",
    "build-prod": "npm run clean && npm run grunt && npm prune --production"
  },
  "author": "weweave UG <mail@weweave.net>",
  "license": "GPL-3.0",
  "devDependencies": {
    "@types/express": "^4.16.1",
    "@types/mocha": "^5.2.6",
    "@types/node": "^12.0.2",
    "@types/sqlite3": "^3.1.5",
    "chai": "^4.2.0",
    "grunt": "^1.0.4",
    "grunt-cli": "^1.3.2",
    "grunt-contrib-watch": "^1.1.0",
    "grunt-ts": "^6.0.0-beta.22",
    "grunt-tslint": "^5.0.2",
    "mocha": "^6.1.4",
    "ts-node": "^8.1.1",
    "tslint": "^5.16.0",
    "typescript": "^3.4.5"
  },
  "dependencies": {
    "body-parser": "^1.19.0",
    "cache": "^2.1.0",
    "cron": "^1.7.1",
    "express": "^4.17.0",
    "iobroker.landroid-s": "github:MeisterTR/ioBroker.landroid-s#bc5bda3a495a87105bb4723b472c15846aec8e4e",
    "log4js": "^4.3.0",
    "moment": "^2.24.0",
    "mqtt": "^2.18.8",
    "sqlite3": "^4.0.8"
  }
}
  • build the image
    -- with this command
docker build --tag virtualzone/landroid-bridge:selfmade .
  • run the container
docker run -d    -p 3000:3000     --name landroid_bridge -v /opt/landroid-bridge/config.json:/usr/src/app/config.json     --restart=unless-stopped   virtualzone/landroid-bridge:selfmade

so thanks for your support

Great to see this progressing. Thanks to all involved. Was using landroid-bridge up to the fall of 2019 but now having difficulty getting it back up and running... presumably because of the API changes. Tried downloading a new Docker container but doesn't appear to have been created (yet?).

I'm running Docker on Synology (x86), Any tips on building this using cli or Portainer?
I can create a dockerfile but not sure what to do with package.json. Any tips appreciated :-D

@rosscullen make sure that your landroid is turned on, have wifi connection established and place it in the charging station. If it will not help try to disconnect from the mobile app and connect it again. In my case it worked :)

@rosscullen make sure that your landroid is turned on, have wifi connection established and place it in the charging station. If it will not help try to disconnect from the mobile app and connect it again. In my case it worked :)

Thanks for advise @ciechompl but didn't the API change in February? Have all the above done, works fine on the app.

I did as @rosscullen sugested two post up, but when loading the web page I get this error:

Cannot GET /

cm86 commented

I did as @rosscullen sugested two post up, but when loading the web page I get this error:

Cannot GET /

Here you have to copy the www folder from the repo into /usr/src/app/ in the container...

cm86 commented

So but can anyone control the mower through the web-ui!?
I'm asking because I can't control him through the web-ui...

@cm86 How do I copy these files into the container?

cm86 commented

@cm86 How do I copy these files into the container?
docker copy /path/ containername:/usr/src/app/

I managed to copy the www and the webpage is active, but loading 0% still. in the logs I get this error:
[2020-03-27T22:24:21.195] [ERROR] App - Unhandled exception: TypeError: Cannot read property 'log' of undefined

cm86 commented

I managed to copy the www and the webpage is active, but loading 0% still. in the logs I get this error:
[2020-03-27T22:24:21.195] [ERROR] App - Unhandled exception: TypeError: Cannot read property 'log' of undefined

Hmm I think I had the same error... (Don't know for sure)
Have you already tried to restart the container!?

yes

cm86 commented

Ok maybe you have to clean the log directory in the container...

I restarted again, and now Im back to:

[2020-03-27T22:31:45.778] [INFO] LandroidS - Could not finish initialization, retrying...

cm86 commented

Is your mower online!?
If yes, I don't know much more what could help...

Yes, and app is updating fine, but thank you

in my case mower had to be not be only "online" (e.g. turned on in my room :)) but also placed in charger = without message "outside of wire"

Mine is sitting in its charger, turned on, and on the wifi. The apps updates and I get current battery status, but still the same error

Hi,

I created an own container from the dockerfile some posts up. After that I reconfigured the WiFi connection with the App. The connection works and send status information about the mower. But currently no control is possible. In another forum I found a installation guide with a MQTT bridge. This used an CA certificate for the connection to the Amazon AWS server. And with that I can control the mower.

Here the link

#90 (comment)

Hi again,

the issue regarding the mower control is located in the mqttCloud.js in the sendMessage function.

on this point the mqtt_topic_prefix(board) and macAddress are not defined. Therefore the publish string is not correct.

mqttCloud.prototype.sendMessage = function (message) { //var topicIn = this.mqtt_topic_prefix + "/" + this.macAddress + '/commandIn'; var topicIn = "DB510/" + this.macAddress + '/commandIn'; this.adapter.log.debug('Sending Message: ' + message); //var sends = '{"cmd":3}'; this.adapter.log.debug('Sending Message topicIn: ' + topicIn); this.device.publish(topicIn, message); };

I adjust a bit, fit to my mower and now I can control them.

maybe someone can check this and solve the problem.

Many thanks.

cm86 commented

Hmm how did you adjust it for your mower.
Or the bedder question, what have i to do to fit to my WR143E/M1000 (2019)?
And the post before you are writing from an CA certificate?! Where to get this and where to put this to get things to work?

mfg Chris

Please forgot this post with the CA. This was my first thought that I had because after trying control the mower the connection restart.

In the debug log you can find a JSON for the product items. This comes once on the beginning of a connection. There is a tag "mqtt_topics" which includes the mqtt strings for incoming and outgoing message. The first part is the board (e.g. DB510). Btw. normally there is an extra api call for the board types in the source code. But it doesnt work. Maybe a change on the api version again.

[DEBUG] IoBrokerAdapter - product-items [{"id":25154,"product_id":39,"user_id":XXXXX,....."mqtt_topics":{"command_in":"DB510/F0FEXXXXXXX/commandIn","command_out":"DB510/F0FE6XXXXXXX/commandOut"},"created_at":"2017-03-13 19:29:29","updated_at":"2020-03-28 01:03:37"}]

Connect to the container via console. Change to the folder node_modules\iobroker.landroid-s\lib. Here you can fnd the mqttCloud.js. Open with an editor and change the line which I commented.

MfG
Mirko

Great, this fixed it for me! I have tried to fix it in a way so that it should work for all boards. If anyone is interested and does not want to manually change mqttCloud.js, just change the line

"iobroker.landroid-s": "github:MeisterTR/ioBroker.landroid-s#bc5bda3a495a87105bb4723b472c15846aec8e4e",

in package.json to

"iobroker.landroid-s": "github:philippsandhaus/ioBroker.landroid-s#4f1a36c0844970b33c4b10f1fd58fc1d5f8ff5aa",

I have no idea what happend.. .During last night, i suddenly started to work. I have implented the changes from @philippsandhaus and it works like a charm. Thank you all.

I put an image on kaareseras/landroid-bridge for all to use, if you dont whant to build our own.

Thank you all

Great, this fixed it for me! I have tried to fix it in a way so that it should work for all boards. If anyone is interested and does not want to manually change mqttCloud.js, just change the line

"iobroker.landroid-s": "github:MeisterTR/ioBroker.landroid-s#bc5bda3a495a87105bb4723b472c15846aec8e4e",

in package.json to

"iobroker.landroid-s": "github:philippsandhaus/ioBroker.landroid-s#4f1a36c0844970b33c4b10f1fd58fc1d5f8ff5aa",

Just a question: Does this approach only work for docker apps or would this work in a regular build from scratch?

I have no experience with docker :(

Does it generally work with a build from scratch?

This schould work for both, The docker is just a prebuild image that can run anywhere. But it might be a good oppertunity for you to try docer. This image has also the www folder copied over and bash installed, so you just need to run it.

Hi everyone,

I tried to get my bridge up and running Throughout 2019 I was able to query my WR141 / M500 2019. Due to an outage of my home automation (Openhab 2.5) I had to reinstall the bridge.

These are the exact steps which I did:

I installed from scratch by

git clone https://github.com/virtualzone/landroid-bridge.git
cd landroid-bridge
npm install
npm run grunt

I changed my config.json to the following:

{
"http": {
"port": 3000
},
"landroid-s": {
"enable": true,
"email": "xxx",
"pwd": "xxx",
"dev_sel": 0
},
"mqtt": {
"enable": true,
"url": "mqtt://xxx:xxx@localhost",
"topic": "landroid"
},
"logLevel": "debug",
"scheduler": {
"enable": false,
"cron": false,
"weather": {
"provider": "darksky",
"apiKey": "xxx",
"latitude": xxx,
"longitude": xxx
},
"db": "./scheduler.db",
"earliestStart": 14,
"latestStop": 20,
"startEarly": true,
"offDays": 0,
"squareMeters": 300,
"perHour": 50,
"mowTime": 75,
"chargeTime": 75,
"daysForTotalCut": 2,
"rainDelay": 120,
"threshold": 30
}
}

I changed my package.json twice. One time I tried to change the line

"iobroker.landroid-s":
to
"iobroker.landroid-s": "github:philippsandhaus/ioBroker.landroid-s#4f1a36c0844970b33c4b10f1fd58fc1d5f8ff5aa",
but also to
"iobroker.landroid-s": "github:MeisterTR/ioBroker.landroid-s#bc5bda3a495a87105bb4723b472c15846aec8e4e",

The whole file looks like this now

{
"name": "landroid-bridge",
"version": "0.1.0",
"description": "Publishes readings from the Worx Landroid S Lawn Mower via HTTP (REST, JSON) and MQTT.",
"main": "index.js",
"scripts": {
"test": "NODE_ENV=dev mocha --reporter spec --require ts-node/register 'test/**/*.test.ts'",
"grunt": "grunt",
"start": "node dist/server.js",
"dev": "npm run clean && npm run grunt && NODE_ENV=dev node dist/server.js",
"clean": "rm -rf dist/",
"build-prod": "npm run clean && npm run grunt && npm prune --production"
},
"author": "weweave UG mail@weweave.net",
"license": "GPL-3.0",
"devDependencies": {
"@types/express": "^4.16.1",
"@types/mocha": "^5.2.6",
"@types/node": "^12.0.2",
"@types/sqlite3": "^3.1.5",
"chai": "^4.2.0",
"grunt": "^1.0.4",
"grunt-cli": "^1.3.2",
"grunt-contrib-watch": "^1.1.0",
"grunt-ts": "^6.0.0-beta.22",
"grunt-tslint": "^5.0.2",
"mocha": "^6.1.4",
"ts-node": "^8.1.1",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
},
"dependencies": {
"body-parser": "^1.19.0",
"cache": "^2.1.0",
"cron": "^1.7.1",
"express": "^4.17.0",
"iobroker.landroid-s": "github:philippsandhaus/ioBroker.landroid-s#4f1a36c0844970b33c4b10f1fd58fc1d5f8ff5aa",
"log4js": "^4.3.0",
"moment": "^2.24.0",
"mqtt": "^2.18.8",
"sqlite3": "^4.0.8"
}
}

I changed the mqttCloud.js file as described here.

All of the above didnt get my bridge up and running.

This is the messages I get when I try to start it:

[12:45:02] openhabian@openhab:$ cd landroid-bridge
[12:45:03] openhabian@openhab:
/landroid-bridge$ node dist/server.js
[2020-03-30T12:45:11.893] [INFO] server.ts - Starting Landroid Bridge...
[2020-03-30T12:45:11.912] [INFO] server.ts - Setting port to 3000...
[2020-03-30T12:45:12.163] [INFO] Mqtt - Connecting to MQTT Broker...
[2020-03-30T12:45:12.175] [INFO] App - Adding static files path /home/openhabian/landroid-bridge/www
[2020-03-30T12:45:12.179] [INFO] Scheduler - Skipping scheduler initialization (not enabled)
[2020-03-30T12:45:12.209] [INFO] LandroidS - Initializing Landroid Cloud Service...
[2020-03-30T12:45:12.223] [DEBUG] IoBrokerAdapter - post:{"username":"xxx","password":"x","grant_type":"password","client_id":1,"type":"app","client_secret":"xxx","scope":"*"}
[2020-03-30T12:45:12.417] [INFO] Mqtt - Successfully connected to MQTT Broker!
[2020-03-30T12:45:13.180] [DEBUG] IoBrokerAdapter - post to oauth/token: {"token_type":"Bearer","expires_in":31536000,"access_token":""}
[2020-03-30T12:45:13.181] [DEBUG] IoBrokerAdapter -
[2020-03-30T12:45:13.474] [DEBUG] IoBrokerAdapter - users/me: {"id":xxx,"email":"xxx","name":"xxx","surname":null,"user_type":"customer","locale":"de","push_notifications":true,"location":{"latitude":xxx,"longitude":xxx},"terms_of_use_agreed":true,"country_id":276,"mqtt_endpoint":"a1optpg91s0ydf-ats.iot.eu-west-1.amazonaws.com","actions_on_google_pin_code":null,"created_at":"2019-04-12 17:23:55","updated_at":"2019-04-13 14:42:06"}
Mqtt url: undefined
[2020-03-30T12:45:13.480] [DEBUG] IoBrokerAdapter -
[2020-03-30T12:45:13.691] [DEBUG] IoBrokerAdapter - AWS certificate done
[2020-03-30T12:45:13.692] [DEBUG] IoBrokerAdapter -
[2020-03-30T12:45:13.847] [DEBUG] IoBrokerAdapter - product-items [{"id":323525,"product_id":49,"user_id":167433,"serial_number":"xxx","mac_address":"xxx","name":"M","setup_location":{"latitude":xxx,"longitude":xxx},"locked":true,"firmware_version":2.92,"firmware_auto_upgrade":true,"distance_covered":506502,"mower_work_time":32975,"blade_work_time":29135,"battery_charge_cycles":384,"messages_in":1182,"messages_out":20782,"push_notifications":true,"city":{"id":2847662,"country_id":276,"name":"xxx","latitude":xxx,"longitude":xxx,"created_at":"2018-02-15 22:21:49","updated_at":"2018-02-15 22:21:49"},"sim":null,"push_notifications_level":"warning","lawn_size":400,"lawn_perimeter":null,"raw_messages_in":172437,"raw_messages_out":20782,"test":0,"iot_registered":true,"warranty_registered":true,"pin_code":"2808","time_zone":"Europe/Berlin","purchased_at":"2019-04-12 00:00:00","warranty_expires_at":"2022-04-12 00:00:00","registered_at":"2019-04-13 00:00:00","online":false,"app_settings":null,"accessories":null,"features":{"unrestricted_mowing_time":true,"multi_zone":true,"wifi_connection":"smartlink_tube_display","display_type":"tube","lock":true,"pin":true,"rain_delay":true,"chassis":"m_2019","mqtt":true,"provisionable":true,"wifi_pairing":"smartlink","tracking_firmware":true,"provisoning_replaceable":true},"auto_schedule_settings":null,"auto_schedule":false,"pending_radio_link_validation":null,"mqtt_topics":{"command_in":"PRM100/xxx/commandIn","command_out":"PRM100/xxx/commandOut"},"created_at":"2019-02-23 11:20:09","updated_at":"2020-03-27 01:20:48"}]
[2020-03-30T12:45:13.848] [INFO] IoBrokerAdapter - mower 0 selected
[2020-03-30T12:45:13.848] [DEBUG] IoBrokerAdapter - Mac adress set to: xxx
[2020-03-30T12:45:13.849] [DEBUG] IoBrokerAdapter -
[2020-03-30T12:45:14.006] [DEBUG] IoBrokerAdapter - Board: [{"id":1,"code":"DB510","revision":6,"features":{"mqtt":true,"wifi_pairing":"smartlink","tracking_firmware":true,"provisoning_replaceable":true},"created_at":"2017-06-08 12:55:13","updated_at":"2020-02-03 00:07:03"},{"id":2,"code":"DB504","revision":6,"features":{"mqtt":true,"wifi_pairing":"udp_broadcast"},"created_at":"2017-06-08 12:55:13","updated_at":"2020-01-22 21:57:53"},{"id":4,"code":"DB504NW","revision":6,"features":null,"created_at":"2018-05-30 16:08:53","updated_at":"2020-01-22 21:57:53"},{"id":5,"code":"DB510NW","revision":6,"features":{"tracking_firmware":true,"provisoning_replaceable":true},"created_at":"2018-05-30 16:08:53","updated_at":"2020-02-03 00:07:03"},{"id":6,"code":"PRM100","revision":7,"features":{"mqtt":true,"provisionable":true,"wifi_pairing":"smartlink","tracking_firmware":true,"provisoning_replaceable":true},"created_at":"2018-11-21 19:44:00","updated_at":"2020-02-03 00:07:03"},{"id":7,"code":"DB520","revision":0,"features":{"mqtt":true,"wifi_pairing":"smartlink","provisionable":true,"tracking_firmware":true,"provisoning_replaceable":true},"created_at":"2020-01-22 21:57:53","updated_at":"2020-02-03 00:07:03"},{"id":8,"code":"PRM100","revision":8,"features":{"mqtt":true,"provisionable":true,"wifi_pairing":"smartconfig","tracking_firmware":true,"provisoning_replaceable":true},"created_at":"2020-01-22 21:57:53","updated_at":"2020-02-03 00:07:03"},{"id":9,"code":"DB510","revision":5,"features":{"mqtt":true,"wifi_pairing":"smartlink","provisoning_replaceable":true},"created_at":"2020-01-22 21:57:53","updated_at":"2020-02-03 00:07:03"},{"id":10,"code":"PRM100NW","revision":7,"features":{"provisionable":true,"tracking_firmware":true,"provisoning_replaceable":true},"created_at":"2020-01-22 21:57:53","updated_at":"2020-02-03 00:07:03"},{"id":11,"code":"PRM100NW","revision":8,"features":{"provisionable":true,"tracking_firmware":true,"provisoning_replaceable":true},"created_at":"2020-01-22 21:57:53","updated_at":"2020-02-03 00:07:03"}]
[2020-03-30T12:45:14.007] [DEBUG] IoBrokerAdapter -
[2020-03-30T12:45:14.265] [DEBUG] IoBrokerAdapter - products: A lot of generic product nonesense following
[2020-03-30T12:45:14.268] [DEBUG] IoBrokerAdapter - Board : undefined selected

It gets the correct MAC-adress but still leaves me with [DEBUG] IoBrokerAdapter - Board : undefined selected.

Any suggestions?

Hi,

based on the source code the JSON for the boards should have a tag "mqtt_topic_prefix". But I cannot see it in your log.

You could try to change this in the mqttCloud.js

self.adapter.log.debug("Board : " + self.boards[j].mqtt_topic_prefix + " selected"); self.mqtt_topic_prefix = self.boards[j].mqtt_topic_prefix;

to

self.adapter.log.debug("Board : " + self.boards[j].code + " selected"); self.mqtt_topic_prefix = self.boards[j].code;

but without warrenty.

Hi,

based on the source code the JSON for the boards should have a tag "mqtt_topic_prefix". But I cannot see it in your log.

You could try to change this in the mqttCloud.js

self.adapter.log.debug("Board : " + self.boards[j].mqtt_topic_prefix + " selected"); self.mqtt_topic_prefix = self.boards[j].mqtt_topic_prefix;

to

self.adapter.log.debug("Board : " + self.boards[j].code + " selected"); self.mqtt_topic_prefix = self.boards[j].code;

but without warrenty.

I changed the code but it didn't work. After chaning and running the code this is the messages:

[07:33:59] openhabian@openhab:$ cd landroid-bridge
[07:34:04] openhabian@openhab:
/landroid-bridge$ node dist/server.js
[2020-03-31T07:34:25.437] [INFO] server.ts - Starting Landroid Bridge...
[2020-03-31T07:34:25.454] [INFO] server.ts - Setting port to 3000...
[2020-03-31T07:34:25.676] [INFO] Mqtt - Connecting to MQTT Broker...
[2020-03-31T07:34:25.687] [INFO] App - Adding static files path /home/openhabian/landroid-bridge/www
[2020-03-31T07:34:25.689] [INFO] Scheduler - Skipping scheduler initialization (not enabled)
[2020-03-31T07:34:25.709] [INFO] LandroidS - Initializing Landroid Cloud Service...
[2020-03-31T07:34:25.721] [DEBUG] IoBrokerAdapter - post:{"username":"xxx","password":"xxx","grant_type":"password","client_id":1,"type":"app","client_secret":"xxx","scope":"*"}
[2020-03-31T07:34:25.723] [DEBUG] IoBrokerAdapter - xxx
[2020-03-31T07:34:25.863] [INFO] Mqtt - Successfully connected to MQTT Broker!
[2020-03-31T07:34:32.305] [DEBUG] IoBrokerAdapter - post to oauth/token: {"token_type":"Bearer","expires_in":31536000,"access_token":"xxx","refresh_token":"xxx"}
[2020-03-31T07:34:32.308] [DEBUG] IoBrokerAdapter - xxx
[2020-03-31T07:34:33.157] [DEBUG] IoBrokerAdapter - users/me: {"id":xxx,"email":"xxx","name":"xxx","surname":null,"user_type":"customer","locale":"de","push_notifications":true,"location":{"latitude":xxx,"longitude":xxx},"terms_of_use_agreed":true,"country_id":276,"mqtt_endpoint":"a1optpg91s0ydf-ats.iot.eu-west-1.amazonaws.com","actions_on_google_pin_code":null,"created_at":"2019-04-12 17:23:55","updated_at":"2019-04-13 14:42:06"}
Mqtt url: undefined
[2020-03-31T07:34:33.167] [DEBUG] IoBrokerAdapter - xxx
[2020-03-31T07:34:35.059] [DEBUG] IoBrokerAdapter - AWS certificate done
[2020-03-31T07:34:35.060] [DEBUG] IoBrokerAdapter - xxx
[2020-03-31T07:34:35.645] [DEBUG] IoBrokerAdapter - product-items [{"id":323525,"product_id":49,"user_id":xxx,"serial_number":"xxx","mac_address":"xxx","name":"M","setup_location":{"latitude":xxx,"longitude":xxx},"locked":true,"firmware_version":2.92,"firmware_auto_upgrade":true,"distance_covered":507555,"mower_work_time":33045,"blade_work_time":29202,"battery_charge_cycles":386,"messages_in":1182,"messages_out":20862,"push_notifications":true,"city":{"id":2847662,"country_id":276,"name":"xxx","latitude":51.549999,"longitude":6.6,"created_at":"2018-02-15 22:21:49","updated_at":"2018-02-15 22:21:49"},"sim":null,"push_notifications_level":"warning","lawn_size":400,"lawn_perimeter":null,"raw_messages_in":172437,"raw_messages_out":20862,"test":0,"iot_registered":true,"warranty_registered":true,"pin_code":"2808","time_zone":"Europe/Berlin","purchased_at":"2019-04-12 00:00:00","warranty_expires_at":"2022-04-12 00:00:00","registered_at":"2019-04-13 00:00:00","online":false,"app_settings":null,"accessories":null,"features":{"unrestricted_mowing_time":true,"multi_zone":true,"wifi_connection":"smartlink_tube_display","display_type":"tube","lock":true,"pin":true,"rain_delay":true,"chassis":"m_2019","mqtt":true,"provisionable":true,"wifi_pairing":"smartlink","tracking_firmware":true,"provisoning_replaceable":true},"auto_schedule_settings":null,"auto_schedule":false,"pending_radio_link_validation":null,"mqtt_topics":{"command_in":"PRM100/xxx/commandIn","command_out":"PRM100/xxx/commandOut"},"created_at":"2019-02-23 11:20:09","updated_at":"2020-03-31 01:27:07"}]
[2020-03-31T07:34:35.646] [INFO] IoBrokerAdapter - mower 0 selected
[2020-03-31T07:34:35.647] [DEBUG] IoBrokerAdapter - Mac adress set to: xxx
[2020-03-31T07:34:35.648] [DEBUG] IoBrokerAdapter - xxx
[2020-03-31T07:34:36.067] [DEBUG] IoBrokerAdapter - Board: [{"id":1,"code":"DB510","revision":6,"features":{"mqtt":true,"wifi_pairing":"smartlink","tracking_firmware":true,"provisoning_replaceable":true},"created_at":"2017-06-08 12:55:13","updated_at":"2020-02-03 00:07:03"},{"id":2,"code":"DB504","revision":6,"features":{"mqtt":true,"wifi_pairing":"udp_broadcast"},"created_at":"2017-06-08 12:55:13","updated_at":"2020-01-22 21:57:53"},{"id":4,"code":"DB504NW","revision":6,"features":null,"created_at":"2018-05-30 16:08:53","updated_at":"2020-01-22 21:57:53"},{"id":5,"code":"DB510NW","revision":6,"features":{"tracking_firmware":true,"provisoning_replaceable":true},"created_at":"2018-05-30 16:08:53","updated_at":"2020-02-03 00:07:03"},{"id":6,"code":"PRM100","revision":7,"features":{"mqtt":true,"provisionable":true,"wifi_pairing":"smartlink","tracking_firmware":true,"provisoning_replaceable":true},"created_at":"2018-11-21 19:44:00","updated_at":"2020-02-03 00:07:03"},{"id":7,"code":"DB520","revision":0,"features":{"mqtt":true,"wifi_pairing":"smartlink","provisionable":true,"tracking_firmware":true,"provisoning_replaceable":true},"created_at":"2020-01-22 21:57:53","updated_at":"2020-02-03 00:07:03"},{"id":8,"code":"PRM100","revision":8,"features":{"mqtt":true,"provisionable":true,"wifi_pairing":"smartconfig","tracking_firmware":true,"provisoning_replaceable":true},"created_at":"2020-01-22 21:57:53","updated_at":"2020-02-03 00:07:03"},{"id":9,"code":"DB510","revision":5,"features":{"mqtt":true,"wifi_pairing":"smartlink","provisoning_replaceable":true},"created_at":"2020-01-22 21:57:53","updated_at":"2020-02-03 00:07:03"},{"id":10,"code":"PRM100NW","revision":7,"features":{"provisionable":true,"tracking_firmware":true,"provisoning_replaceable":true},"created_at":"2020-01-22 21:57:53","updated_at":"2020-02-03 00:07:03"},{"id":11,"code":"PRM100NW","revision":8,"features":{"provisionable":true,"tracking_firmware":true,"provisoning_replaceable":true},"created_at":"2020-01-22 21:57:53","updated_at":"2020-02-03 00:07:03"}]
[2020-03-31T07:34:36.069] [DEBUG] IoBrokerAdapter - xxx
[2020-03-31T07:34:36.983] [DEBUG] IoBrokerAdapter - products: a lot of product infos....
[2020-03-31T07:34:36.988] [DEBUG] IoBrokerAdapter - Board : PRM100 selected
^

The Board changed to PRM100 instead of

[2020-03-30T12:45:14.268] [DEBUG] IoBrokerAdapter - Board : undefined selected

which is adaquate to my WR141, but it cannot finish and starts all over. Any other ideas? I could imagine to roll back to start the install all over. Is there any guided installation to what steps exactly to do? Reading through this thread isn't very easy nor relatable. A step by step guide like 1st change xyz in file zyx 2nd change abc in cba.... would be kindly appreciated!

Any other suggestions?

could you try the mqttCloud.js from here

https://github.com/MeisterTR/ioBroker.landroid-s/tree/master/lib

this is the last version and works for me in docker kaareseras/landroid-bridge.

I'm new to docker and learning.

First stupid question. Where do I need to store the cloned file? Unzip it?

Second stupid question. There is NO app folder in /usr/src

This could help to understand docker.

https://docker-curriculum.com/

I see the docker files are changed in de repo. How to load the arm64v8?

Getting there ..... and stops at step 7/18

Sending build context to Docker daemon 508MB
Step 1/18 : FROM alpine:3.11 AS qemu
---> 0d8bd234c4c8
Step 2/18 : RUN apk --update add --no-cache curl
---> Using cache
---> 2047d8794ee2
Step 3/18 : RUN cd /tmp && curl -L https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz | tar zxvf - -C . && mv qemu-3.0.0+resin-arm/qemu-arm-static .
---> Using cache
---> 367fcec358f0
Step 4/18 : FROM arm64v8/node:12-alpine AS prod
---> be7c0ffeb20b
Step 5/18 : COPY --from=qemu /tmp/qemu-arm-static /usr/bin/
---> Using cache
---> 4ea8dfd07d45
Step 6/18 : WORKDIR /tmp/landroid-bridge-master
---> Running in 3b4a71d1bcda
Removing intermediate container 3b4a71d1bcda
---> fc7981ed2231
Step 7/18 : COPY package*.json .
COPY failed: no source files were specified

Did you clone the whole github. Or just copy the Dockerfile?

The whole github.

The Dockerfile was updated two hours ago. Maybe a wrong COPY. From my point of view it should be without *. But be carefull, the package.json includes a old ioBroker-Landroid-s package. Pull this docker kaareseras/landroid-bridge and everything works.

Hi all, just bought a Landroid so am new to this thread! It looks like a lot of progress has been made but is this specifically Docker (manually HA installation) rather than Hassio at this stage?

@simikuen Could you point me to the repo - I would like to try the new docker image, as I also encountered the reconnection issues with the current update (as mentioned by youreself). Thx

For me it runs with this docker kaareseras/landroid-bridge.

I have updated to the latest version of @stefanlaheij but unfortunately still no connection: [2020-04-09T15:13:19.508] [DEBUG] IoBrokerAdapter - Worxcloud MQTT offline