virtualzone / landroid-bridge

Bridge for connecting the Worx Landroid S Lawn Mower to home automation systems like OpenHAB or FHEM.
GNU General Public License v3.0
64 stars 48 forks source link

Update to new Worx-API #88

Closed cm86 closed 4 years ago

cm86 commented 4 years ago

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

int5749 commented 4 years ago

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

riker09 commented 4 years ago

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.

int5749 commented 4 years ago

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.

riker09 commented 4 years ago

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.

riker09 commented 4 years ago

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.

int5749 commented 4 years ago

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 :-/

riker09 commented 4 years ago

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.

int5749 commented 4 years ago

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?

riker09 commented 4 years ago

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.

int5749 commented 4 years ago

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?

riker09 commented 4 years ago

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?

KaaNee commented 4 years ago

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.

riker09 commented 4 years ago

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

int5749 commented 4 years ago

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

MeisterTR commented 4 years ago

should be fixed now

cm86 commented 4 years ago

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

MeisterTR commented 4 years ago

i think you have to reinstall to get the changes

int5749 commented 4 years ago

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

KaaNee commented 4 years ago

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

riker09 commented 4 years ago

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" ]
riker09 commented 4 years ago

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. :slightly_smiling_face:

int5749 commented 4 years ago

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 4 years ago

Yes i also can't get it to work.

What i've done:

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" ]

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

riker09 commented 4 years ago

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",
  4. 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 4 years ago

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`

int5749 commented 4 years ago

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 :-(

Saboti commented 4 years ago

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

riker09 commented 4 years ago

We all have very different backgrounds and I tend to forget that. Sorry for that! :sweat_smile:

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.

riker09 commented 4 years ago

@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 commented 4 years ago

@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 commented 4 years ago

@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

riker09 commented 4 years ago

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 4 years ago

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:

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
Saboti commented 4 years ago

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?

riker09 commented 4 years ago

maybe try on a x86 server? One problem at a time. :slightly_smiling_face:

Can you please post your full package.json?

Saboti commented 4 years ago

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 :-(

riker09 commented 4 years ago

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?

Saboti commented 4 years ago

@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.

KaaNee commented 4 years ago

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

Saboti commented 4 years ago

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?

int5749 commented 4 years ago

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?

int5749 commented 4 years ago

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

Saboti commented 4 years ago

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

Saboti commented 4 years ago

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

int5749 commented 4 years ago

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 4 years ago

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

But he isn't starting

MFG Chris

szmania commented 4 years ago

@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 commented 4 years ago

@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.

szmania commented 4 years ago

@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.

szmania commented 4 years ago

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.