My Landroid-S Roboter Mower

You mean the „System MQTT Broker“?

One additional thing:
Forgot this in my earlier post:
Have you updated this to your MQTT thing in the rules?

val mqttActions = getActions(“mqtt”,“mqtt:broker:d380a519”)

Also have a look here:

That post has helped me a lot…

I am having an error trying to install the bridge and it appears related to sqlite. Did you have to manually install any programs to run this?

I have openhabian on a pi3b+ installed yesterday.

sudo npm install
(node:2930) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
(node:2930) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit

> sqlite3@4.1.0 install /home/openhabian/landroid-bridge/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.1.0/node-v72-linux-arm.tar.gz
node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.1.0 and node@12.9.0 (node-v72 ABI, glibc) (falling back to source compile with node-gyp)
gyp WARN EACCES user "openhabian" does not have permission to access the dev dir "/root/.cache/node-gyp/12.9.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/openhabian/landroid-bridge/node_modules/sqlite3/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/openhabian/landroid-bridge/node_modules/sqlite3/.node-gyp'
gyp ERR! System Linux 4.19.66-v7+
gyp ERR! command "/opt/nodejs/bin/node" "/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/openhabian/landroid-bridge/node_modules/sqlite3/lib/binding/node-v72-linux-arm/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/home/openhabian/landroid-bridge/node_modules/sqlite3/lib/binding/node-v72-linux-arm" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /home/openhabian/landroid-bridge/node_modules/sqlite3
gyp ERR! node -v v12.9.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/opt/nodejs/bin/node /opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/openhabian/landroid-bridge/node_modules/sqlite3/lib/binding/node-v72-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/openhabian/landroid-bridge/node_modules/sqlite3/lib/binding/node-v72-linux-arm --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/openhabian/landroid-bridge/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:209:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
node-pre-gyp ERR! System Linux 4.19.66-v7+
node-pre-gyp ERR! command "/opt/nodejs/bin/node" "/home/openhabian/landroid-bridge/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/openhabian/landroid-bridge/node_modules/sqlite3
node-pre-gyp ERR! node -v v12.9.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute '/opt/nodejs/bin/node /opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/openhabian/landroid-bridge/node_modules/sqlite3/lib/binding/node-v72-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/openhabian/landroid-bridge/node_modules/sqlite3/lib/binding/node-v72-linux-arm --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm WARN landroid-bridge@0.1.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@4.1.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@4.1.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

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

hi, i did set up the landroid bridge yesterday and came across the same error. i installed sqlite3 via sudo apt-get install sqlite3 and it did work after this. when running “npm run grunt” i received some errors and fixed them by editing the LandroidSRouter.ts file -i already commited a bugfix, which does not seem to be included right now.

i can see the landroid status page one localhost:3000 but i am struggeling right now with getting the values from mqtt to openhab. i installed the embedded mqtt broker and mqtt broker connection as well as mqtt generic thing. but no success so far. has anyone manged to get this working an can share the exact configuration?

thx in advance and best regards!

I was able to install sqlite3 as you mentioned, but still get the same errors about the script failing to download sqlite and node. What else did you update to make the install work?

I’ve done the following:
sudo apt-get install sqlite3
sudo apt-get install nodejs

EDIT: looking at some of the issues, I think it is related to the openhabian pi image not having expected components for the bridge install. I am going to instead reinstall Raspbian and install openhab via linux instructions. More learning for me anyway!

what does “node -v” state?
i am running openhabian as well

if i remember correct i built sqlite3 from source:

@powerpolly did you get it working?

Well, I installed the latest Raspbian, openhabian, sqlite3, and nodejs.

I am still getting errors trying to ‘npm install’ the bridge.

What systems are you all running this successfully? I worry that it is this difficult, unless I am missing a major step not mentioned in any guides.

I finally got it installed by using Docker. Now to start figuring out if it works.

Installing docker was also a terrible experience, but I was able to follow these steps in section 2 with some modification to username at the last step:

I recently reinstalled the bridge on a fresh ubuntu VM. these are the steps that worked for me:

sudo apt-get update
sudo apt-get install git
git clone https://github.com/weweave/landroid-bridge.git
cd landroid-bridge
curl -sL [https://deb.nodesource.com/setup_11.x](https://deb.nodesource.com/setup_9.x) | sudo -E bash -
sudo apt-get install -y nodejs
npm install
npm run grunt
1 Like

thank you for the answer. But i ment if you got the embedded mqtt broker working? right now i cant read the values from the landroid-bridge inside openhab.

thank you for the answer. But i ment if you got the embedded mqtt broker working? right now i cant read the values from the landroid-bridge inside openhab.

yes, got it running. used the MQTT Exploration App to check if the messages were successfully sent by the landroid bridge.
the thing you need to configure:

Thing topic landroid "Landroid" @ "Draussen" {
Channels:
    Type number : batteryLevel "BatteryLevel" [ stateTopic="landroid/status/batteryLevel" ]   
    Type number : batteryVoltage "BatteryVoltage" [ stateTopic="landroid/status/batteryVoltage" ]
    Type number : batteryTemperature "BatteryVoltage" [ stateTopic="landroid/status/batteryTemperature" ]
    Type number : rainDelay "rainDelay" [ stateTopic="landroid/status/rainDelay", commandTopic="landroid/set/rainDelay" ]
    Type number : timeExtension "timeExtension" [ stateTopic="landroid/status/timeExtension", commandTopic="landroid/set/timeExtension"]
    Type string : dateTime "LastUpdate" [ stateTopic="landroid/status/dateTime" ]
    Type string : firmware "Firmware" [ stateTopic="landroid/status/firmware" ]
    Type number : wifiQuality "wifiQuality" [ stateTopic="landroid/status/wifiQuality" ]
    Type string : active "active" [ stateTopic="landroid/status/active", commandTopic="landroid/set/active" ]
    Type string : serialNumber "serialNumber" [ stateTopic="landroid/status/serialNumber" ]
    Type number : totalTime "totalTime" [ stateTopic="landroid/status/totalTime" ]
    Type number : totalDistance "totalDistance" [ stateTopic="landroid/status/totalDistance" ]
    Type number : batteryChargeCycle "batteryChargeCycle" [ stateTopic="landroid/status/batteryChargeCycle" ]
    Type number : errorCode "errorCode" [ stateTopic="landroid/status/errorCode" ]
    Type string : errorDescription "errorDescription" [ stateTopic="landroid/status/errorDescription" ]
    Type number : statusCode "statusCode" [ stateTopic="landroid/status/statusCode" ]
    Type string : statusDescription "statusDescription" [ stateTopic="landroid/status/statusDescription" ]
    Type string : batteryCharging "batteryCharging" [ stateTopic="landroid/status/batteryCharging" ]
            
}

every time I change something in the MQTT thing file I have to restart openhab. seems to be a known bug…

Thanks for your help, i will try it later and report back!

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: