My Landroid-S Roboter Mower

I have the same problem as you, i think there is a mixup between “string” and “number” i dont know how to fix this, maybe there are someone with better coding skilles ???

Ok picture is delete here is the code

import { NextFunction, Request, Response } from “express”;
import { BaseRouter } from “./BaseRouter”;
import { LandroidDataset } from “./LandroidDataset”;
import { LandroidS } from “./LandroidS”;

class LandroidSRouter extends BaseRouter {
protected init(): void {
this.router.get("/status", this.status.bind(this));
this.router.post("/start", this.startMower.bind(this));
this.router.post("/stop", this.stopMower.bind(this));
this.router.post("/pause", this.pauseMower.bind(this));
this.router.put("/set/rainDelay/:value", this.setRainDelay.bind(this));
this.router.put("/set/timeExtension/:value", this.setTimeExtension.bind(this));
this.router.put("/set/schedule/:weekday", this.setSchedule.bind(this));
this.router.post("/poll", this.poll.bind(this));
}

private status(req: Request, res: Response, next: NextFunction): void {
    let latestUpdate: LandroidDataset = LandroidS.getInstance().getLatestUpdate();
    if (latestUpdate) {
        res.status(200).send(latestUpdate.serialize());
    } else {
        this.internalServerError(res);
    }
}

private startMower(req: Request, res: Response, next: NextFunction): void {
    LandroidS.getInstance().startMower();
    this.ok(res);
}

private stopMower(req: Request, res: Response, next: NextFunction): void {
    LandroidS.getInstance().stopMower();
    this.ok(res);
}

private pauseMower(req: Request, res: Response, next: NextFunction): void {
    LandroidS.getInstance().pauseMower();
    this.ok(res);
}

private setRainDelay(req: Request, res: Response, next: NextFunction): void {
    let value = req.params.value;  <------------------------------------------------ THIS IS string
    try {
        LandroidS.getInstance().setRainDelay(value); <------------------------------THIS IS number
        this.ok(res);
    } catch (e) {
        this.badRequest(res, e.message);
    }
}

private setTimeExtension(req: Request, res: Response, next: NextFunction): void {
    let value = req.params.value; <------------------------------------------------ THIS IS string
    try {
        LandroidS.getInstance().setTimeExtension(value);  <------------------------------THIS IS number
        this.ok(res);
    } catch (e) {
        this.badRequest(res, e.message);
    }
}

private setSchedule(req: Request, res: Response, next: NextFunction): void {
    let weekday = req.params.weekday; <------------------------------------------------ THIS IS string
    let payload = req.body;
    try {
        LandroidS.getInstance().setSchedule(weekday, payload); <------------------------------THIS IS number
        this.ok(res);
    } catch (e) {
        this.badRequest(res, e.message);
    }
}

private poll(req: Request, res: Response, next: NextFunction): void {
    LandroidS.getInstance().poll();
    this.ok(res);
}

}

export default new LandroidSRouter().router;

Please don‘t use hatdcopies here, instead paste your code snippets in code fences.
Some of our very helpfull members check and answer posts on a small phone screen…

i have delete the picture and paste the code :slight_smile:

1 Like

here is my fix

1 Like

Thank you koma

Now have at at nearly running, i had to delete it and start from the begining.

The first time i was running “npm install” i stopped it because i thoght i was raspberry hanging, but in reallity its just a slow process, the result was missing drifferent node files.

In my second try i waited for “npm install” to finish
i repaired the LandroidSRouter file as recommende by koma
Then npm run grunt and after that the settings in the config.json
i the end node dist/server.js

1 Like

I do still have some problem with my Mqtt connection, im running a mosquito mqtt on the same raspberry as openhab, i used the same pw and user login as i use om my home made esp8266 modules.

i just dobbelt checked my email and pw for the worx website, they are correct

i get this message
pi@mainrasp:~/landroid-bridge $ node dist/server.js
[2019-09-10T15:47:35.408] [INFO] server.ts - Starting Landroid Bridge…
[2019-09-10T15:47:35.431] [INFO] server.ts - Setting port to 3000…
[2019-09-10T15:47:35.938] [INFO] Mqtt - Connecting to MQTT Broker…
[2019-09-10T15:47:35.961] [INFO] App - Adding static files path /home/pi/landroid-bridge/www
[2019-09-10T15:47:35.968] [INFO] Scheduler - Creating SQLite database at /home/pi/landroid-bridge/scheduler.db
[2019-09-10T15:47:36.119] [INFO] Mqtt - Successfully connected to MQTT Broker!
[2019-09-10T15:47:36.146] [INFO] LandroidS - Initializing Landroid Cloud Service…
Mqtt url: undefined
[2019-09-10T15:47:37.599] [INFO] IoBrokerAdapter - mower 0 selected
[2019-09-10T15:48:36.148] [INFO] LandroidS - Could not finish initialization, retrying…
Mqtt url: undefined
[2019-09-10T15:48:37.447] [INFO] IoBrokerAdapter - mower 0 selected
[2019-09-10T15:49:36.157] [INFO] LandroidS - Could not finish initialization, retrying…
Mqtt url: undefined
[2019-09-10T15:49:37.465] [INFO] IoBrokerAdapter - mower 0 selected

OK i looked in the LandroidS.ts file… it was waiting for a mqtt message from worx server
I started the mower from the mobil phone app

I think everything is ok now :slight_smile:

I have a M500 (2019) model. I know the new models are communicating over the cloud but is there also a way to get the binding to work?

The worx landroid S models is also working over the cloud…

and the binding works with 2019 models?
If I try to connect to the mower IP with user:pass I get 404

You can not connect directly to the mower, you need to connect via the binding
through the worxs landroid cloud, more or less the same way as the mobil phone app wrks

Is there no way to make a direct connection without the cloud?

If not, then i will buy a mower from another company…

Is there any mover which can be controlled directly over wifi and without cloud? Maybe with a custom firmware like the xiaomi roborocks for house cleaning?

Hello,

since some weeks I’m not longer able to start the brigde on my RPI3. When I try to start the bridge the following error appiers:

~/landroid-bridge$ node dist/server.js
/home/openhabian/landroid-bridge/dist/Config.js:29
throw new Error(“Could not parse config.json”);
^

Error: Could not parse config.json
at Config.loadConfig (/home/openhabian/landroid-bridge/dist/Config.js:29:19)
at new Config (/home/openhabian/landroid-bridge/dist/Config.js:13:14)
at Object. (/home/openhabian/landroid-bridge/dist/Config.js:36:19)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Module.require (internal/modules/cjs/loader.js:598:17)
at require (internal/modules/cjs/helpers.js:11:18)

The bridge worked for months without Problems and I did not any changes on my config then on my overall setup.

I also posted this topic within the github project, but there was no answer at all.

Thank you for your help.
Jan

Hi all,

is there a plan to include this binding (without bridge) into official OH release? It’s working fine with bridge, but I like to have a less complexity as possible :wink:

2 Likes

Hi Alex,
I just have migrated to OH 2.5.1 and imagine if you can help with some guidance how to use MQTT 2.5 instead of legacy bridge??

Regards
Joerg

You still need to install the Landroid bridge software, everything esle is the same as for every other mqtt item you have moved from mqtt v1 binding to mqtt v2.5.

That was assumed, it‘s more about

  • do I still need to have Mosquitto installed?
  • some advise how to setup Bridge and Things in .things
  • how to adopt items properly

Some examples would be great, to avoid issues others already had :wink:

btw: Bridge seems to be down, least some are not able to connect :frowning:
Anyone here where Bridge still works?? Or have an idea how to update bridge?

I implemented a binding for landroid mowers:

1 Like

@nibi70

Thank you so much for your binding.
However, I have not succeeded in installing it. I copied the jar file from the given address and put it into the addon folder of my openhab 2.5.3 version. Even after rebooting several times, the bindig will not be displayed.
Are there any tips for this?

Solved.