Giter Site home page Giter Site logo

am43-ctrl's Introduction

AM43 Blinds Drive Controller Util

Util for controlling a am43 Cover, either over MQTT or via a HTTP API. When used over MQTT it works together with home-assistant and performs auto disovery configuration of the cover component. (Eg. https://nl.aliexpress.com/item/4000106179323.html) This util should work with all blind drives which make use of the Blind Engine App. (A-OK, Zemismart,...)

Hardware Installation

Install the blinds and configure top and bottom positions through the BlindsEngine App. Retrieve the MacAddress of the device (for example by using nRF Connect app for android or sudo bluetoothctl and scan on)

Requirements

sudo apt install libudev-dev

Installation

Run npm install https://github.com/binsentsu/am43-ctrl

For making the application persistent across device reboots a possibility is to use pm2: https://www.npmjs.com/package/pm2

Or by using native systemd:

  • create file am43ctrl.service in /etc/systemd/system :
[Unit]
Description=AM43-ctrl
After=multi-user.target

[Service]
ExecStart=/AM43DIRECTORY/node_modules/.bin/am43ctrl MAC1 MAC12 -l 3001 -d --url mqtt://BROKERIP -u BROKERUSER -p BROKERPASS -d
Restart=always
User=root
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
WorkingDirectory=/AM43DIRECTORY

[Install]
WantedBy=multi-user.target

Then use following commands to persist:

sudo systemctl daemon-reload
sudo systemctl enable am43ctrl
sudo systemctl start am43ctrl

You can obtain logging through: sudo journalctl -u am43ctrl.service

Usage

sudo am43ctrl by itself will print usage information

You need to manually specify a list of MAC addresses to connect to, e.g.: sudo am43ctrl f5:11:7b:ee:f3:43

You must then specify options to use either MQTT, HTTP or both

To use with HTTP

Specify a port for the API to listen on with -l: sudo am43ctrl MACx MACy -l 3000

To use with MQTT

Specify a broker URL with --url option: sudo am43ctrl --url mqtt://yourbroker (mqtt/mqtts/ws/wss accepted)

Username and password for MQTT may be specified with -u and -p option

If no password argument is supplied, you can enter it interactively

Bluetooth polling interval is randomly selected at startup (10-20 minutes), but can be defined with -i option: sudo am43ctrl MACx MACy -l 3000 -i 10

A minimum successfull connection 'fail-time' can be defined with -f option: sudo am43ctrl MACx MACy -l 3000 -f 120000 If no valid connection with a device occurs during seconds, the program will exit. Disabled by default.

Base topic defaults to homeassistant, but may be configured with the --topic option

MQTT

To issue commands:

OPEN: <baseTopic>/cover/<deviceID>/set - message: 'OPEN'

CLOSE: <baseTopic>/cover/<deviceID>/set - message: 'CLOSE'

STOP: <baseTopic>/cover/<deviceID>/set - message: 'STOP'

SET_POSITION: 100 is closed 0 is open <baseTopic>/cover/<deviceID>/setposition - message: '21'

In addition, for use with Home Assistant MQTT Discovery:

Three entities will be pubished to homeassistant discovery topic:

Cover: 

{
    "name": "MAC",
    "availability_topic": "homeassistant/cover/MACx/connection",
    "payload_available": "Online",
    "payload_not_available": "Offline",
    "command_topic": "homeassistant/cover/MACx/set",
    "position_topic": "homeassistant/cover/MACx/state",
    "set_position_topic" : "homeassistant/cover/MACx/setposition",
    "position_open": 0,
    "position_closed": 100,
    "payload_open": "OPEN",
    "payload_close": "CLOSE",
    "payload_stop": "STOP",
    "unique_id": "am43_MACx_cover",
    "position_template": '{{value_json[\'position\']}}',
    "device": {
        "identifiers": "am43_MACx",
        "name": "MACx",
        "manufacturer": "Generic AM43"
    }
}

Battery Sensor:

{
    "name": "MAC Battery",
    "availability_topic": "homeassistant/cover/MACx/connection",
    "state_topic": "homeassistant/cover/MACx/state
    "payload_available": "Online",
    "payload_not_available": "Offline",
    "device_class" : "battery",
    "unit_of_measurement": "%",
    "unique_id": "am43_MACx_battery_sensor",
    "value_template": '{{value_json[\'battery\']}}',
    "device": {
        "identifiers": "am43_MACx",
        "name": "MACx",
        "manufacturer": "Generic AM43"
    }
}

Light Sensor:

{
    "name": "MAC Battery",
    "availability_topic": "homeassistant/cover/MACx/connection",
    "state_topic": "homeassistant/cover/MACx/state
    "payload_available": "Online",
    "payload_not_available": "Offline",
    "unit_of_measurement": "%",
    "unique_id": "am43_MACx_light_sensor",
    "value_template": '{{value_json[\'light\']}}',
    "device": {
        "identifiers": "am43_MACx",
        "name": "MACx",
        "manufacturer": "Generic AM43"
    }
}

Parameters

<deviceID> has format of the device's MAC address in lowercase, with the colon's stripped out and cannot be changed

HTTP Endpoints

GET /: list devices. Response type: [String : Device] - ID as String key, Device as value

{
   "c03dc8105277":{
      "id":"c03dc8105277",
      "lastconnect":"2019-11-23T17:39:48.949Z",
      "lastaction":"OPEN",
      "state":"OPEN",
      "battery":42,
      "light":0,
      "position":0
   }
}

GET /<deviceID>: Get individual device data (or 404 if no device by that ID).

Response type: Device example:

{
   "id":"c03dc8105277",
   "lastconnect":"2019-11-23T17:39:48.949Z",
   "lastaction":"OPEN",
   "state":"OPEN",
   "battery":42,
   "light":0,
   "position":0
}

POST /<deviceID>/open: Send OPEN command to am43. Response type: 200 - OK or 404 - Not Found

POST /<deviceID>/close: Send CLOSE command to am43. Response type: 200 - OK or 404 - Not Found

POST /<deviceID>/stop: Send STOP command to am43. Response type: 200 - OK or 404 - Not Found

am43-ctrl's People

Contributors

binsentsu avatar evolter avatar hausner avatar provinzio avatar rocket4321 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

am43-ctrl's Issues

installation issue

Ubuntu 18.04 LTS x64
After running install script problem with dependent packages, installation stopped with error:

npm ERR! code ELIFECYCLE
npm ERR! errno 1

prebuild-install info begin Prebuild-install version 5.3.4
prebuild-install info looking for cached prebuild @ /home/username/.npm/_prebuilds/91abd0-usb-v1.6.3-node-v83-linux-x64.tar.gz
prebuild-install http request GET https://github.com/tessel/node-usb/releases/download/v1.6.3/usb-v1.6.3-node-v83-linux-x64.tar.gz
prebuild-install http 404 https://github.com/tessel/node-usb/releases/download/v1.6.3/usb-v1.6.3-node-v83-linux-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=14.3.0 runtime=node arch=x64 libc= platform=linux)

Percentage position by HTTP

Am I right the position cant be set via http besides open and close? Is the only option to do this via MQTT?

Deprecated warning in Home Assistant

Im not sure whether the author is still active in this repo.
I have been using it for a few years now, and has been pretty happy with it.

However MQTT requirements for Home Assistant have changed now which means using this repo with HA throws the following warning:

image

sadly I have no idea how to fix it and it would be sad to have to abandon this repo once HA updates again.

Anyone with the skills (and time) to have a look at this?

Docker? Anyone?

Hey guys, first of all: THANK YOU!
Amazing job you did there.

Second: did you guys try to pack everything inside a Docker image?
I've try with the node7 image but I had some problems with libusb...
I'm still trying though....

skip scanning devices

I don't know why if it's some time of deep sleep mode or other devices are already connected to the am43 blinds but sometimes the scanning can't find the device and I'm sure about the MAC address. I used to experience this when I had a python script so I just skipped scanning altogether and every time it needs to connect to the device it just takes the MAC address and tries to establish a connection.

just wondering if it really needs to scan the devices in the beginning. since it has the MAC address already scanning seems unnecessary, but I could be wrong.

docker run  --net=host --privileged 6b05856664be                                                                                                              3:01PM
2020-05-21T05:01:12.193Z am43* scanning for 1 device(s) [ '025964f227b3' ]
2020-05-21T05:01:12.466Z am43 Found 02c9051179b3 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:12.575Z am43 Found c0288ddd2364 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:12.692Z am43 Found 007c2d2e5ffb but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:12.729Z am43 Found 4f33533b4ee1 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:12.772Z am43 Found 54bd79d4b9d1 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:12.832Z am43 Found 6690250b0b77 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:13.059Z am43 Found 4fbb93a6b10a but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:14.471Z am43 Found 707781370e46 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:01:14.864Z am43 Found 612757372771 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:02:18.111Z am43 Found 2979ffaa3680 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:02:44.006Z am43 Found 41a10abe52a6 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:03:57.133Z am43 Found e6c695db110e but will not connect as it was not specified in the list of devices [ '025964f227b3' ]
2020-05-21T05:06:29.395Z am43 Found 0149beb0e1c1 but will not connect as it was not specified in the list of devices [ '025964f227b3' ]

<stuck here forever>

Auto run command with pm2 or anything

Thank you for your perfect code.

I have connect my AM43 to home assistant but when I close terminal, this connection will stop. I have try with pm2 which you suggest but this still happen or I have something wrong when config it Could you suggest some thing to run command in background and after reboot or guide me to config pm2 right?

My command:
sudo am43ctrl xx:xx:xx:xx:xx:xx --url mqtt://192.168.xxx.xxx:xxxx -u mqtt -p passwd

Thank you so much

constant mqtt close

Hi

Great work! I used to use another project that send commands via bluetooth but there was no integration with HA. I just love to see the Covers in HA now that I'm running your project.

However, I'm running into an issue every now and then where it doesn't send the discovery message to HA(I believe) and you can see that something isn't right as it constantly logs mqtt close messages.

root@ubuntu:/am43# NOBLE_HCI_DEVICE_ID=0 /am43/node_modules/.bin/am43ctrl 025964f227b3 02c9051179b3  --url mqtt://192.168.1.1:1863 -p xxx -u admin -d
  am43* scanning for 2 device(s) [ '025964f227b3', '02c9051179b3' ] +0ms
  am43* discovered 025964f227b3 +186ms
  am43 Found 6690250b0b77 but will not connect as it was not specified in the list of devices [ '025964f227b3', '02c9051179b3' ] +0ms
  am43 Found 612757372771 but will not connect as it was not specified in the list of devices [ '025964f227b3', '02c9051179b3' ] +35ms
  am43 Found 7bfde96bbaff but will not connect as it was not specified in the list of devices [ '025964f227b3', '02c9051179b3' ] +77ms
  am43* discovered 02c9051179b3 +163ms
  am43* all expected devices connected, stopping scan +0ms
  am43:025964f227b3 mqtt topic homeassistant/cover/025964f227b3 +0ms
  am43:025964f227b3 interval: 1200000 +0ms
  am43:02c9051179b3 mqtt topic homeassistant/cover/02c9051179b3 +0ms
  am43:02c9051179b3 interval: 720000 +0ms
  am43:025964f227b3 mqtt offline +5ms
  am43:025964f227b3 mqtt close +1ms
  am43:02c9051179b3 mqtt offline +4ms
  am43:02c9051179b3 mqtt close +0ms
  am43:025964f227b3 mqtt close +1s
  am43:02c9051179b3 mqtt close +1s
  am43:025964f227b3 mqtt close +1s
  am43:02c9051179b3 mqtt close +1s
  am43:025964f227b3 mqtt close +1s
  am43:02c9051179b3 mqtt close +1s
  am43:025964f227b3 mqtt close +1s
  am43:02c9051179b3 mqtt close +1s
  am43:02c9051179b3 Connection busy for other device, delaying data read... +989ms
  am43:025964f227b3 mqtt close +1s
  am43:02c9051179b3 mqtt close +12ms
  am43:025964f227b3 AM43 connected for data reading +926ms
  am43:02c9051179b3 Connection busy for other device, delaying data read... +989ms
  am43:025964f227b3 mqtt close +74ms
  am43:02c9051179b3 mqtt close +11ms
  am43:025964f227b3 discovered data char +104ms
  am43:025964f227b3 received characteristic update +75ms
  am43:025964f227b3 Notification data: 9aa205000000005a67 +0ms
  am43:025964f227b3 Notification identifier: a2 +0ms
  am43:025964f227b3 Bat %: 90 +0ms
  am43:025964f227b3 received characteristic update +29ms
  am43:025964f227b3 Notification data: 9aaa02000230 +0ms
  am43:025964f227b3 Notification identifier: aa +0ms
  am43:025964f227b3 Light %: 2 +0ms
  am43:025964f227b3 received characteristic update +51ms
  am43:025964f227b3 Notification data: 9aa7071f322b000000300c +0ms
  am43:025964f227b3 Notification identifier: a7 +0ms
  am43:025964f227b3 Position %: 43 +0ms
  am43:025964f227b3 Reading data completed +0ms
  am43:025964f227b3 received characteristic update +9ms
  am43:025964f227b3 Notification data: 9aa80032 +1ms
  am43:025964f227b3 Notification identifier: a8 +0ms
  am43:025964f227b3 Reading data completed +0ms
  am43:025964f227b3 received characteristic update +21ms
  am43:025964f227b3 Notification data: 9aa9100000001100000000010000110000000022 +0ms
  am43:025964f227b3 Notification identifier: a9 +1ms
  am43:025964f227b3 Reading data completed +0ms
  am43:02c9051179b3 Connection busy for other device, delaying data read... +990ms
  am43:025964f227b3 mqtt close +710ms
  am43:02c9051179b3 mqtt close +12ms
  am43:025964f227b3 disconnected for data reading +269ms
  am43:025964f227b3 Reading data was successful +0ms
  am43:025964f227b3 state changed received: {"id":"025964f227b3","lastconnect":"2020-05-21T04:40:58.256Z","lastaction":null,"state":"OPEN","battery":90,"light":2,"position":43} +1ms
  am43:025964f227b3 mqtt close +732ms
  am43:02c9051179b3 mqtt close +1s
  am43:02c9051179b3 AM43 connected for data reading +891ms
  am43:025964f227b3 mqtt close +1s
  am43:02c9051179b3 mqtt close +110ms
  am43:02c9051179b3 discovered data char +39ms
  am43:02c9051179b3 received characteristic update +75ms
  am43:02c9051179b3 Notification data: 9aa205000000004e73 +0ms
  am43:02c9051179b3 Notification identifier: a2 +0ms
  am43:02c9051179b3 Bat %: 78 +0ms
  am43:02c9051179b3 received characteristic update +45ms
  am43:02c9051179b3 Notification data: 9aaa02000133 +0ms
  am43:02c9051179b3 Notification identifier: aa +0ms
  am43:02c9051179b3 Light %: 1 +0ms
  am43:02c9051179b3 received characteristic update +60ms
  am43:02c9051179b3 Notification data: 9aa7071f32000bb8123086 +0ms
  am43:02c9051179b3 Notification identifier: a7 +0ms
  am43:02c9051179b3 Position %: 0 +0ms
  am43:02c9051179b3 Reading data completed +0ms
  am43:02c9051179b3 received characteristic update +1ms
  am43:02c9051179b3 Notification data: 9aa80032 +0ms
  am43:02c9051179b3 Notification identifier: a8 +0ms
  am43:02c9051179b3 Reading data completed +0ms
  am43:02c9051179b3 received characteristic update +59ms
  am43:02c9051179b3 Notification data: 9aa9100000001100000000010000110000000022 +0ms
  am43:02c9051179b3 Notification identifier: a9 +0ms
  am43:02c9051179b3 Reading data completed +0ms
  am43:025964f227b3 mqtt close +1s
  am43:02c9051179b3 mqtt close +723ms
  am43:02c9051179b3 disconnected for data reading +239ms
  am43:02c9051179b3 Reading data was successful +0ms
  am43:02c9051179b3 state changed received: {"id":"02c9051179b3","lastconnect":"2020-05-21T04:41:01.224Z","lastaction":null,"state":"OPEN","battery":78,"light":1,"position":0} +0ms
noble warning: unknown handle 70 disconnected!
  am43:025964f227b3 mqtt close +1s
  am43:02c9051179b3 mqtt close +762ms
  am43:025964f227b3 mqtt close +1s
  am43:02c9051179b3 mqtt close +1s
  am43:025964f227b3 mqtt close +1s
  am43:02c9051179b3 mqtt close +1s
  am43:025964f227b3 mqtt close +1s
  am43:02c9051179b3 mqtt close +1s
  am43:025964f227b3 mqtt close +1s
  am43:02c9051179b3 mqtt close +1s
...

and it never stops logging "mqtt close +1s"

any ideas what that might be?

Discovered data char: "TypeError: Cannot read property 'on' of undefined"

Recently updated to the latest version.

2020-04-29T21:59:22.497Z am43:02d4146eaf57 discovered data char
/usr/lib/node_modules/am43-ctrl/src/am43.js:117
characteristic.on('data', function (data, isNotification) {
^

TypeError: Cannot read property 'on' of undefined
at discoveryResult (/usr/lib/node_modules/am43-ctrl/src/am43.js:117:32)
at /usr/lib/node_modules/am43-ctrl/node_modules/@abandonware/noble/lib/peripheral.js:119:13
at Service. (/usr/lib/node_modules/am43-ctrl/node_modules/@abandonware/noble/lib/service.js:56:7)
at Object.onceWrapper (events.js:417:26)
at Service.emit (events.js:310:20)
at Noble.onCharacteristicsDiscover (/usr/lib/node_modules/am43-ctrl/node_modules/@abandonware/noble/lib/noble.js:398:13)
at NobleBindings.emit (events.js:310:20)
at NobleBindings.onCharacteristicsDiscovered (/usr/lib/node_modules/am43-ctrl/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:368:8)
at Gatt.emit (events.js:310:20)
at Object.callback (/usr/lib/node_modules/am43-ctrl/node_modules/@abandonware/noble/lib/hci-socket/gatt.js:514:12)

Installed packages:

cat */package.json | jq '._from'

"abbrev@1"
"accepts@~1.3.7"
"ansi-regex@^2.0.0"
"ansi-styles@^3.2.0"
"aproba@^1.0.3"
"are-we-there-yet@~1.1.2"
"[email protected]"
"async-limiter@~1.0.0"
"balanced-match@^1.0.0"
"base64-js@^1.0.2"
"bindings@^1.4.0"
"bl@^4.0.1"
"[email protected]"
"brace-expansion@^1.1.7"
"buffer-from@^1.0.0"
"buffer@^5.5.0"
"[email protected]"
"callback-stream@^1.0.2"
"camelcase@^5.0.0"
"chownr@^1.1.1"
"cliui@^5.0.0"
"code-point-at@^1.0.0"
"color-convert@^1.9.0"
"[email protected]"
"commist@^1.0.0"
"[email protected]"
"concat-stream@^1.6.2"
"console-control-strings@~1.1.0"
"[email protected]"
"content-type@~1.0.4"
"[email protected]"
"[email protected]"
"core-util-is@~1.0.0"
"debug@^4.0.1"
"decamelize@^1.2.0"
"decompress-response@^4.2.0"
"deep-extend@^0.6.0"
"delegates@^1.0.0"
"depd@~1.1.2"
"destroy@~1.0.4"
"detect-libc@^1.0.2"
"d@1"
"duplexify@^3.6.0"
"[email protected]"
"emoji-regex@^7.0.1"
"encodeurl@~1.0.2"
"end-of-stream@^1.1.0"
"es5-ext@~0.10.14"
"es6-iterator@~2.0.1"
"es6-map@^0.1.5"
"es6-set@~0.1.5"
"es6-symbol@~3.1.1"
"escape-html@~1.0.3"
"etag@~1.8.1"
"event-emitter@~0.3.5"
"expand-template@^2.0.3"
"express@^4.16.3"
"extend@^3.0.0"
"ext@^1.1.2"
"[email protected]"
"finalhandler@~1.1.2"
"find-up@^3.0.0"
"forwarded@~0.1.2"
"[email protected]"
"fs-constants@^1.0.0"
"fs-minipass@^1.2.5"
"fs.realpath@^1.0.0"
"gauge@~2.7.3"
"get-caller-file@^2.0.1"
"[email protected]"
"glob@^7.1.3"
"glob-parent@^3.1.0"
"glob-stream@^6.1.0"
"has-unicode@^2.0.0"
"help-me@^1.0.1"
"[email protected]"
"iconv-lite@^0.4.4"
"ieee754@^1.1.4"
"ignore-walk@^3.0.1"
"inflight@^1.0.4"
"inherits@~2.0.3"
"ini@~1.3.0"
"[email protected]"
"is-absolute@^1.0.0"
"isarray@~1.0.0"
"is-extglob@^2.1.0"
"is-fullwidth-code-point@^1.0.0"
"is-glob@^3.1.0"
"is-negated-glob@^1.0.0"
"is-relative@^1.0.0"
"is-unc-path@^1.0.0"
"is-windows@^1.0.1"
"json-stable-stringify-without-jsonify@^1.0.1"
"leven@^2.1.0"
"locate-path@^3.0.0"
"[email protected]"
"[email protected]"
"methods@~1.1.2"
"[email protected]"
"[email protected]"
"mime-types@~2.1.24"
"mimic-response@^2.0.0"
"minimatch@^3.0.4"
"minimist@^1.2.5"
"minipass@^2.8.6"
"minizlib@^1.2.1"
"mkdirp-classic@^0.5.2"
"mkdirp@^0.5.1"
"mqtt@^2.18.2"
"mqtt-packet@^5.6.0"
"ms@^2.1.1"
"nan@^2.14.0"
"napi-build-utils@^1.0.1"
"[email protected]"
"needle@^2.2.1"
"[email protected]"
"next-tick@~1.0.0"
"node-abi@^2.7.0"
"node-addon-api@^2.0.0"
"node-pre-gyp@^0.14.0"
"noop-logger@^0.1.1"
"nopt@^4.0.1"
"npm-bundled@^1.0.1"
"npmlog@^4.0.2"
"npm-normalize-package-bin@^1.0.1"
"npm-packlist@^1.1.6"
"number-is-nan@^1.0.0"
"object-assign@^4.1.0"
"once@^1.3.0"
"on-finished@~2.3.0"
"ordered-read-streams@^1.0.0"
"osenv@^0.1.4"
"os-homedir@^1.0.0"
"os-tmpdir@^1.0.0"
"parseurl@~1.3.3"
"path-dirname@^1.0.0"
"path-exists@^3.0.0"
"path-is-absolute@^1.0.0"
"[email protected]"
"p-limit@^2.0.0"
"p-locate@^3.0.0"
"prebuild-install@^5.3.3"
"process-nextick-args@~2.0.0"
"proxy-addr@~2.0.5"
"p-try@^2.0.0"
"pumpify@^1.3.5"
"pump@^3.0.0"
"[email protected]"
"range-parser@~1.2.1"
"[email protected]"
"rc@^1.2.7"
"readable-stream@^2.0.6"
"readline-sync@^1.4.9"
"reinterval@^1.1.0"
"remove-trailing-separator@^1.0.1"
"require-directory@^2.1.1"
"require-main-filename@^2.0.0"
"rimraf@^2.6.1"
"safe-buffer@~5.1.1"
"safer-buffer@>= 2.1.2 < 3"
"sax@^1.2.4"
"semver@^5.3.0"
"[email protected]"
"[email protected]"
"set-blocking@~2.0.0"
"[email protected]"
"signal-exit@^3.0.0"
"simple-concat@^1.0.0"
"simple-get@^3.0.3"
"split2@^2.1.1"
"statuses@~1.5.0"
"stream-shift@^1.0.0"
"string_decoder@~1.1.1"
"string-width@^1.0.1"
"strip-ansi@^3.0.1"
"strip-json-comments@~2.0.1"
"tar-fs@^2.0.0"
"tar@^4.4.2"
"tar-stream@^2.0.0"
"through2-filter@^3.0.0"
"through2@^2.0.1"
"to-absolute-glob@^2.0.0"
"[email protected]"
"tunnel-agent@^0.6.0"
"typedarray@^0.0.6"
"type-is@~1.6.18"
"type@^1.0.1"
"ultron@~1.1.0"
"unc-path-regex@^0.1.2"
"unique-stream@^2.0.2"
"[email protected]"
"usb@^1.6.2"
"util-deprecate@~1.0.1"
"[email protected]"
"vary@~1.1.2"
"websocket-stream@^5.1.2"
"which-module@^2.0.0"
"which-pm-runs@^1.0.0"
"wide-align@^1.1.0"
"wrap-ansi@^5.1.0"
"wrappy@1"
"ws@^3.2.0"
"xtend@^4.0.1"
"y18n@^4.0.0"
"yallist@^3.0.3"
"yargs@^13.2.2"
"yargs-parser@^13.1.2"

Noble Warning: unknown handle 64 disconnected!

Hi, when i run the script nothings happend i get this warning when he is scanning for the device

./am43ctrl 02b62c22d6bc --mqtt-url -d mqtt://192.168.178.5:1883 -u username -p password -topic
am43* scanning for 2 device(s) [ ‘02b62c22d6bc’, ‘mqtt//192.168.178.5’ ] +0ms
noble warning: unknown handle 64 disconnected!
noble warning: unknown handle 64 disconnected!

Read position of blinds

Enable reading of the current blind position, so state can be published to HA position topic.

Exiting since no device has every connected...

Hi, got this to mostly run with some issues. can't run the program without adding the direct path to it.
But eventually got it to run, but now the program ends with
am43* scanning for 1 device(s) [ 'dc234d17ea82' ] +0ms am43* discovered dc234d17ea82 +402ms am43* Exiting since no device has every connected... +11m
The mac should be the correct one. Read out of the app that can control the AM43

I do get the MQTT messages, but I cannot control the motor with Home assistant

Deprecation warning from home assistant

This might be a quick fix in MQTTConnector.js, but I am not sure if we can just change value_template with position_topic.

Warning from Home Assistant:

Logger: homeassistant.components.mqtt.cover
Source: components/mqtt/cover.py:130
Integration: MQTT (documentation, issues)
First occurred: 07:45:23 (2 occurrences)
Last logged: 07:45:23
using 'value_template' for 'position_topic' is deprecated and will be removed from Home Assistant in version 2021.6, please replace it with 'position_template'

Shade Stopped Working But Battery is fine

Hey there, for some reason with the latest update for HASS.IO core core-2021.6.6 and supervisor-2021.06.3 and host OS 6.0 For some reason my AM43 shade item is no longer working.

I am receiving good data for the battery level and light sensor but I cannot raise or lower shades. I see no errors in the MQTT log and when I run the AM43 software I see no errors in it either.

Does anyone know where I could look next?

Dont work

sudo ./am43ctrl
/home/xxxxx/node_modules/am43-ctrl/src/am43.js:29
static busyDevice = null;
^

SyntaxError: Unexpected token =
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/home/pi/node_modules/am43-ctrl/index.js:7:14)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

'value_template' must be set together with 'state_topic'

I updated to the latest am43-ctrl and Home Assistant (supervised) and am now receiving the follow error.
I cannot control the blinds anymore.

Any ideas on this? As far as I can see, state_topic is defined with the MQTT message.

2021-06-24 16:06:08 ERROR (MainThread) [homeassistant.util.logging] Exception in async_discover when dispatching 'mqtt_discovery_new_cover_mqtt': ({'name': '0245f32c8f21', 'command_topic': 'homeassistant/cover/0245f32c8f21/set', 'position_topic': 'homeassistant/cover/0245f32c8f21/state', 'set_position_topic': 'homeassistant/cover/0245f32c8f21/setposition', 'position_open': 0, 'position_closed': 100, 'availability_topic': 'homeassistant/cover/0245f32c8f21/connection', 'payload_available': 'Online', 'payload_not_available': 'Offline', 'payload_open': 'OPEN', 'payload_close': 'CLOSE', 'payload_stop': 'STOP', 'value_template': "{{value_json['position']}}", 'unique_id': 'am43_0245f32c8f21_cover', 'device': {'identifiers': 'am43_0245f32c8f21', 'name': '0245f32c8f21', 'manufacturer': 'Generic AM43'}, 'platform': 'mqtt'},)
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
    return schema(data)
  File "/usr/src/homeassistant/homeassistant/components/mqtt/cover.py", line 118, in validate_options
    raise vol.Invalid(
voluptuous.error.Invalid: 'value_template' must be set together with 'state_topic'.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py", line 160, in async_discover
    config = schema(discovery_payload)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 218, in __call__
    return self._exec((Schema(val) for val in self.validators), v)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 341, in _exec
    raise e if self.msg is None else AllInvalid(self.msg, path=path)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 337, in _exec
    v = func(v)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 276, in __call__
    raise er.MultipleInvalid([e])
voluptuous.error.MultipleInvalid: 'value_template' must be set together with 'state_topic'.

Further tries to open/close the blinds will throw the error

2021-06-24 16:07:31 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities cover.0245f32c8f21

I had a second look into the log and the code. It should be regarding the entry at https://github.com/binsentsu/am43-ctrl/blob/master/src/MQTTConnector.js#L51.

Read blinds light sensor

Publish the value of the light sensor to a HA sensor, so one could make automations for closing blinds based on this value.

Application crashed (Cannot read property 'on' of undefined)

With the exception below

6 Apr 19:08:02 - TypeError: Cannot read property 'on' of undefined
at discoveryResult (/home/pi/.node-red/node_modules/am43-ctrl/src/am43.js:117:32)
at /home/pi/.node-red/node_modules/@abandonware/noble/lib/peripheral.js:119:13
at Service. (/home/pi/.node-red/node_modules/@abandonware/noble/lib/service.js:56:7)
at Object.onceWrapper (events.js:421:26)
at Service.emit (events.js:314:20)
at Noble.onCharacteristicsDiscover (/home/pi/.node-red/node_modules/@abandonware/noble/lib/noble.js:398:13)
at NobleBindings.emit (events.js:314:20)
at NobleBindings.onCharacteristicsDiscovered (/home/pi/.node-red/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:368:8)
at Gatt.emit (events.js:314:20)
at Object.callback (/home/pi/.node-red/node_modules/@abandonware/noble/lib/hci-socket/gatt.js:514:12)
at Gatt.onAclStreamData (/home/pi/.node-red/node_modules/@abandonware/noble/lib/hci-socket/gatt.js:133:26)
at AclStream.emit (events.js:326:22)
at AclStream.push (/home/pi/.node-red/node_modules/@abandonware/noble/lib/hci-socket/acl-stream.js:33:10)
at NobleBindings.onAclDataPkt (/home/pi/.node-red/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:288:15)
at Hci.emit (events.js:314:20)
at Hci.onSocketData (/home/pi/.node-red/node_modules/@abandonware/noble/lib/hci-socket/hci.js:495:14)
at BluetoothHciSocket.emit (events.js:314:20)

What is problem? I don't know linux.

I don't know linux.

raspbian lite.
installed nodejs, git, libusb, libudev.
I tried nodejs 10.x and 12.x.
same result.

===================================================
pi@raspberrypi:~ $ npm install https://github.com/binsentsu/am43-ctrl

[email protected] install /home/pi/node_modules/usb
prebuild-install --verbose || node-gyp rebuild

prebuild-install info begin Prebuild-install version 5.3.3
prebuild-install info looking for cached prebuild @ /home/pi/.npm/_prebuilds/470134-usb-v1.6.3-node-v72-linux-arm.tar.gz
prebuild-install http request GET https://github.com/tessel/node-usb/releases/download/v1.6.3/usb-v1.6.3-node-v72-linux-arm.tar.gz
prebuild-install http 404 https://github.com/tessel/node-usb/releases/download/v1.6.3/usb-v1.6.3-node-v72-linux-arm.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=12.16.3 runtime=node arch=arm libc= platform=linux)
make: Entering directory '/home/pi/node_modules/usb/build'
CC(target) Release/obj.target/libusb/libusb/libusb/core.o
CC(target) Release/obj.target/libusb/libusb/libusb/descriptor.o
CC(target) Release/obj.target/libusb/libusb/libusb/hotplug.o
CC(target) Release/obj.target/libusb/libusb/libusb/io.o
CC(target) Release/obj.target/libusb/libusb/libusb/strerror.o
CC(target) Release/obj.target/libusb/libusb/libusb/sync.o
CC(target) Release/obj.target/libusb/libusb/libusb/os/poll_posix.o
CC(target) Release/obj.target/libusb/libusb/libusb/os/threads_posix.o
CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_usbfs.o
CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_udev.o
AR(target) Release/obj.target/usb.a
COPY Release/usb.a
CXX(target) Release/obj.target/usb_bindings/src/node_usb.o
In file included from ../src/helpers.h:3,
from ../src/node_usb.h:21,
from ../src/node_usb.cc:1:
../node_modules/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../node_modules/nan/nan.h:2232:62: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
, reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
^
In file included from ../src/node_usb.h:14,
from ../src/node_usb.cc:1:
../src/node_usb.cc: At global scope:
/home/pi/.cache/node-gyp/12.16.3/include/node/node.h:608:43: warning: cast between incompatible function types from ‘void ()(v8::Localv8::Object)’ to ‘node::addon_register_func’ {aka ‘void ()(v8::Localv8::Object, v8::Localv8::Value, void*)’} [-Wcast-function-type]
(node::addon_register_func) (regfunc),
^
/home/pi/.cache/node-gyp/12.16.3/include/node/node.h:642:3: note: in expansion of macro ‘NODE_MODULE_X’
NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
^~~~~~~~~~~~~
../src/node_usb.cc:95:1: note: in expansion of macro ‘NODE_MODULE’
NODE_MODULE(usb_bindings, Initialize)
^~~~~~~~~~~
../src/node_usb.cc: In function ‘void handleHotplug(std::pair<libusb_device*, libusb_hotplug_event>)’:
../src/node_usb.cc:151:58: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, const char*, int, v8::Localv8::Value)’ is deprecated [-Wdeprecated-declarations]
Nan::MakeCallback(Nan::New(hotplugThis), "emit", 2, argv);
^
In file included from ../src/helpers.h:3,
from ../src/node_usb.h:21,
from ../src/node_usb.cc:1:
../node_modules/nan/nan.h:1001:46: note: declared here
NAN_DEPRECATED inline v8::Localv8::Value MakeCallback(
^~~~~~~~~~~~
../src/node_usb.cc:151:58: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, const char
, int, v8::Localv8::Value)’ is deprecated [-Wdeprecated-declarations]
Nan::MakeCallback(Nan::New(hotplugThis), "emit", 2, argv);
^
In file included from ../src/helpers.h:3,
from ../src/node_usb.h:21,
from ../src/node_usb.cc:1:
../node_modules/nan/nan.h:1001:46: note: declared here
NAN_DEPRECATED inline v8::Localv8::Value MakeCallback(
^~~~~~~~~~~~
In file included from ../src/node_usb.h:12,
from ../src/node_usb.cc:1:
/home/pi/.cache/node-gyp/12.16.3/include/node/v8.h: In instantiation of ‘void v8::PersistentBase::SetWeak(P
, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfonode::ObjectWrap&) ’:
/home/pi/.cache/node-gyp/12.16.3/include/node/node_object_wrap.h:85:78: required from here
/home/pi/.cache/node-gyp/12.16.3/include/node/v8.h:10226:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfonode::ObjectWrap::Callback’ {aka ‘void (
)(const v8::WeakCallbackInfonode::ObjectWrap&)’} to ‘Callback’ {aka ‘void ()(const v8::WeakCallbackInfo&)’} [-Wcast-function-type]
reinterpret_cast(callback), type);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/.cache/node-gyp/12.16.3/include/node/v8.h: In instantiation of ‘void v8::PersistentBase::SetWeak(P
, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)]’:
../node_modules/nan/nan_object_wrap.h:65:61: required from here
/home/pi/.cache/node-gyp/12.16.3/include/node/v8.h:10226:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfoNan::ObjectWrap::Callback’ {aka ‘void (
)(const v8::WeakCallbackInfoNan::ObjectWrap&)’} to ‘Callback’ {aka ‘void ()(const v8::WeakCallbackInfo&)’} [-Wcast-function-type]
CXX(target) Release/obj.target/usb_bindings/src/device.o
In file included from ../src/helpers.h:3,
from ../src/node_usb.h:21,
from ../src/device.cc:1:
../node_modules/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker
)’:
../node_modules/nan/nan.h:2232:62: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
, reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
^
../src/device.cc: In member function ‘void Req::submit(Device*, v8::Localv8::Function, uv_work_cb, uv_work_cb)’:
../src/device.cc:220:70: warning: cast between incompatible function types from ‘uv_work_cb’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
uv_queue_work(uv_default_loop(), &req, backend, (uv_after_work_cb) after);
^~~~~
../src/device.cc: In static member function ‘static void Req::default_after(uv_work_t*)’:
../src/device.cc:237:64: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value)’ is deprecated [-Wdeprecated-declarations]
Nan::MakeCallback(device, Nan::New(baton->callback), 1, argv);
^
In file included from ../src/helpers.h:3,
from ../src/node_usb.h:21,
from ../src/device.cc:1:
../node_modules/nan/nan.h:959:46: note: declared here
NAN_DEPRECATED inline v8::Localv8::Value MakeCallback(
^~~~~~~~~~~~
../src/device.cc:237:64: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value
)’ is deprecated [-Wdeprecated-declarations]
Nan::MakeCallback(device, Nan::New(baton->callback), 1, argv);
^
In file included from ../src/helpers.h:3,
from ../src/node_usb.h:21,
from ../src/device.cc:1:
../node_modules/nan/nan.h:959:46: note: declared here
NAN_DEPRECATED inline v8::Localv8::Value MakeCallback(
^~~~~~~~~~~~
In file included from ../src/node_usb.h:12,
from ../src/device.cc:1:
/home/pi/.cache/node-gyp/12.16.3/include/node/v8.h: In instantiation of ‘void v8::PersistentBase::SetWeak(P*, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfonode::ObjectWrap&) ’:
/home/pi/.cache/node-gyp/12.16.3/include/node/node_object_wrap.h:85:78: required from here
/home/pi/.cache/node-gyp/12.16.3/include/node/v8.h:10226:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfonode::ObjectWrap::Callback’ {aka ‘void (
)(const v8::WeakCallbackInfonode::ObjectWrap&)’} to ‘Callback’ {aka ‘void ()(const v8::WeakCallbackInfo&)’} [-Wcast-function-type]
reinterpret_cast(callback), type);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/.cache/node-gyp/12.16.3/include/node/v8.h: In instantiation of ‘void v8::PersistentBase::SetWeak(P
, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)]’:
../node_modules/nan/nan_object_wrap.h:65:61: required from here
/home/pi/.cache/node-gyp/12.16.3/include/node/v8.h:10226:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfoNan::ObjectWrap::Callback’ {aka ‘void (
)(const v8::WeakCallbackInfoNan::ObjectWrap&)’} to ‘Callback’ {aka ‘void ()(const v8::WeakCallbackInfo&)’} [-Wcast-function-type]
CXX(target) Release/obj.target/usb_bindings/src/transfer.o
In file included from ../src/helpers.h:3,
from ../src/node_usb.h:21,
from ../src/transfer.cc:1:
../node_modules/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker
)’:
../node_modules/nan/nan.h:2232:62: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
, reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
^
../src/transfer.cc: In function ‘void handleCompletion(Transfer*)’:
../src/transfer.cc:126:72: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value)’ is deprecated [-Wdeprecated-declarations]
Nan::MakeCallback(self->handle(), Nan::New(self->v8callback), 3, argv);
^
In file included from ../src/helpers.h:3,
from ../src/node_usb.h:21,
from ../src/transfer.cc:1:
../node_modules/nan/nan.h:959:46: note: declared here
NAN_DEPRECATED inline v8::Localv8::Value MakeCallback(
^~~~~~~~~~~~
../src/transfer.cc:126:72: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value
)’ is deprecated [-Wdeprecated-declarations]
Nan::MakeCallback(self->handle(), Nan::New(self->v8callback), 3, argv);
^
In file included from ../src/helpers.h:3,
from ../src/node_usb.h:21,
from ../src/transfer.cc:1:
../node_modules/nan/nan.h:959:46: note: declared here
NAN_DEPRECATED inline v8::Localv8::Value MakeCallback(
^~~~~~~~~~~~
In file included from ../src/node_usb.h:12,
from ../src/transfer.cc:1:
/home/pi/.cache/node-gyp/12.16.3/include/node/v8.h: In instantiation of ‘void v8::PersistentBase::SetWeak(P*, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfonode::ObjectWrap&) ’:
/home/pi/.cache/node-gyp/12.16.3/include/node/node_object_wrap.h:85:78: required from here
/home/pi/.cache/node-gyp/12.16.3/include/node/v8.h:10226:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfonode::ObjectWrap::Callback’ {aka ‘void (
)(const v8::WeakCallbackInfonode::ObjectWrap&)’} to ‘Callback’ {aka ‘void ()(const v8::WeakCallbackInfo&)’} [-Wcast-function-type]
reinterpret_cast(callback), type);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/.cache/node-gyp/12.16.3/include/node/v8.h: In instantiation of ‘void v8::PersistentBase::SetWeak(P
, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)]’:
../node_modules/nan/nan_object_wrap.h:65:61: required from here
/home/pi/.cache/node-gyp/12.16.3/include/node/v8.h:10226:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfoNan::ObjectWrap::Callback’ {aka ‘void (
)(const v8::WeakCallbackInfoNan::ObjectWrap&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo&)’} [-Wcast-function-type]
SOLINK_MODULE(target) Release/obj.target/usb_bindings.node
COPY Release/usb_bindings.node
make: Leaving directory '/home/pi/node_modules/usb/build'

@abandonware/[email protected] install /home/pi/node_modules/@abandonware/bluetooth-hci-socket
node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/abandonware/node-bluetooth-hci-socket/releases/download/0.5.3-5/binding-0.5.3-5-node-v72-linux-arm.tar.gz
node-pre-gyp WARN Pre-built binaries not found for @abandonware/[email protected] and [email protected] (node-v72 ABI, glibc) (falling back to source compile with node-gyp)
make: Entering directory '/home/pi/node_modules/@abandonware/bluetooth-hci-socket/build'
CXX(target) Release/obj.target/binding/src/BluetoothHciSocket.o
In file included from ../src/BluetoothHciSocket.cpp:8:
../../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
, reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
^
In file included from /home/pi/.cache/node-gyp/12.16.3/include/node/node_buffer.h:25,
from ../src/BluetoothHciSocket.cpp:7:
../src/BluetoothHciSocket.cpp: At global scope:
/home/pi/.cache/node-gyp/12.16.3/include/node/node.h:608:43: warning: cast between incompatible function types from ‘void ()(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void ()(v8::Localv8::Object)’} to ‘node::addon_register_func’ {aka ‘void ()(v8::Localv8::Object, v8::Localv8::Value, void)’} [-Wcast-function-type]
(node::addon_register_func) (regfunc),
^
/home/pi/.cache/node-gyp/12.16.3/include/node/node.h:642:3: note: in expansion of macro ‘NODE_MODULE_X’
NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
^~~~~~~~~~~~~
../src/BluetoothHciSocket.cpp:578:1: note: in expansion of macro ‘NODE_MODULE’
NODE_MODULE(binding, BluetoothHciSocket::Init);
^~~~~~~~~~~
SOLINK_MODULE(target) Release/obj.target/binding.node
COPY Release/binding.node
COPY /home/pi/node_modules/@abandonware/bluetooth-hci-socket/lib/binding/binding.node
TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/home/pi/node_modules/@abandonware/bluetooth-hci-socket/build'
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

  • [email protected]
    added 71 packages from 50 contributors, updated 1 package and audited 771 packages in 47.472s

1 package is looking for funding
run npm fund for details

found 0 vulnerabilities

pi@raspberrypi:~ $ sudo am43ctrl
sudo: am43ctrl: command not found
pi@raspberrypi:~ $ sudo am43-ctrl
sudo: am43-ctrl: command not found
pi@raspberrypi:~ $ sudo am43ctrl 02:XX:XX:XX:XX:XX
sudo: am43ctrl: command not found

=================================================
what is problem?

Lag Between Commands

Hi,

I have successfully installed your node app. Works great, however there is excessive lag time when issuing commands.

For example, in Home Assistant if I press Down, it may take the blinds anywhere from 2-20 seconds to respond. As such, it is nearly impossible to press Stop and get the right Level. Is there something I can modify in the script that would remove this lag?

Thanks

Can't start (unexpected token)

# ./am43ctrl MYMAC -l 3000

/home/user/node_modules/am43-ctrl/src/am43.js:29
    static busyDevice = null;
                      ^

SyntaxError: Unexpected token =
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/user/node_modules/am43-ctrl/index.js:7:14)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

I have followed the instructions, and no errors were found during the installation.
What am I doing wrong? Or this software is obsolete now?

Thank you!

Unable to install on RSPI 3

sudo npm install -g https://github.com/binsentsu/am43-ctrl
npm ERR! code 128
npm ERR! Command failed: git clone --mirror -q https://github.com/binsentsu/am43-ctrl.git /root/.npm/_cacache/tmp/git-clone-ee07ae50/.git
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-ee07ae50/.git'
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-03-05T19_11_59_142Z-debug.log


   File: /root/.npm/_logs/2020-03-05T19_11_59_142Z-debug.log                

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'https://github.com/binsentsu/am43-ctrl' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 92d9549b04dae94f
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for git+https://github.com/binsentsu/am43-ct$
7 silly fetchPackageMetaData fatal: could not create leading directories of '/r$
8 timing stage:rollbackFailedOptional Completed in 3ms
9 timing stage:runTopLevelLifecycles Completed in 1313ms
10 verbose stack Error: Command failed: git clone --mirror -q https://github.co$
10 verbose stack fatal: could not create leading directories of '/root/.npm/_ca$
10 verbose stack
10 verbose stack at ChildProcess.exithandler (child_process.js:294:12)
10 verbose stack at maybeClose (internal/child_process.js:982:16)
10 verbose stack at Socket.stream.socket.on (internal/child_process.js:389:$
10 verbose stack at Socket.emit (events.js:198:13)
10 verbose stack at Pipe._handle.close (net.js:607:12)
11 verbose cwd /home/pi
12 verbose Linux 4.19.66-v7+
13 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "https://github.c$
14 verbose node v10.19.0
15 verbose npm v6.14.2
16 error code 128
17 error Command failed: git clone --mirror -q https://github.com/binsentsu/am4$
17 error fatal: could not create leading directories of '/root/.npm/_cacache/tm$
18 verbose exit [ 1, true ]

How do I find the mac address more easily?

Hi! I've got everything set up, I can see the (not yet connected) device in HA, can execute all commands etc.. However, how do I find out the mac of the device? I've tried 'BLE Scanner' and 'nRF Connect' on the play store and sudo hcitool -i hci0 lescan on the RPI but I get so many results that I don't know which to choose. I live in student housing so that might be the issue. Also gave the device a name in the aOK app.

Thanks!! Kind regards, Jan

pi@raspberrypi:~/am43/node_modules/.bin sudo hcitool -i hci0 lescan
LE Scan ...
71:36:43:AA:F0:16 (unknown)
71:36:43:AA:F0:16 (unknown)
59:11:3B:CB:D7:E6 (unknown)
45:87:29:9A:63:C2 (unknown)
45:87:29:9A:63:C2 (unknown)
09:63:9D:42:95:3D (unknown)
5D:47:CA:A6:F0:88 (unknown)
72:1A:8E:31:71:43 (unknown)
72:1A:8E:31:71:43 (unknown)
71:54:2C:80:BE:56 (unknown)
71:54:2C:80:BE:56 (unknown)
59:54:4C:48:50:5E (unknown)
59:54:4C:48:50:5E (unknown)
7C:4E:17:B9:C6:37 (unknown)
7C:4E:17:B9:C6:37 (unknown)
5D:47:CA:A6:F0:88 (unknown)
6C:16:2B:80:81:1A (unknown)
4A:4D:65:31:08:37 (unknown)
4A:4D:65:31:08:37 (unknown)
4B:B0:38:32:9D:D0 (unknown)
4B:B0:38:32:9D:D0 (unknown)
09:7B:FD:2C:23:F3 (unknown)
CE:46:30:B9:B9:F3 (unknown)
CE:46:30:B9:B9:F3 Mi Smart Band 4
2D:75:12:18:5A:A9 (unknown)
4C:65:A8:DF:C1:EA (unknown)
4C:65:A8:DF:C1:EA MJ_HT_V1
54:D5:44:28:9E:C1 (unknown)
4A:0C:C9:92:76:41 (unknown)
54:39:E4:22:C1:E8 (unknown)
54:D5:44:28:9E:C1 (unknown)

[bug] Connection busy for other device, delaying data read

Hi,

I think one of my blinds is very low on power, and although the initial connection works, it doesn't actually respond. This app gets stuck waiting for a response that never arrives:

$ sudo /home/pi/aok_mqtt/node_modules/.bin/am43ctrl 02:5A:5E:B7:AA:B5 02:18:89:A0:F8:4A -l 3001 -d --url mqtt://192.168.1.5 -u mqtt -p 

  am43* scanning for 2 device(s) [ '025a5eb7aab5', '021889a0f84a' ] +0ms
  am43 listening on port 3001 +0ms
  am43 Found f333192b7832 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +49ms
  am43 Found e1a170935be3 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +15ms
  am43 Found a4307a81d77d but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +8ms
  am43 Found d629f4cdb522 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +17ms
  am43 Found dff9288667b1 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +7ms
  am43 Found e615fc138814 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +12ms
  am43 Found 3902c1e3c19b but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +39ms
  am43 Found 1a77baca0051 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +14ms
  am43 Found 29247018b645 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +9ms
  am43 Found 7c23939cc305 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +27ms
  am43 Found f33386ad232b but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +8ms
  am43 Found f33335248411 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +16ms
  am43 Found 33cb747b9b61 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +56ms
  am43 Found 4a523534aa24 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +67ms
  am43* discovered 025a5eb7aab5 +1s
  am43 Found 8c79f51901c7 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +389ms
  am43 Found 67701951a2f4 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +266ms
  am43 Found 09704f1bdd5f but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +56ms
  am43 Found 2ea9439c9e11 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5', '021889a0f84a' ] +73ms
  am43* discovered 021889a0f84a +594ms
  am43* all expected devices connected, stopping scan +0ms
  am43:025a5eb7aab5 mqtt topic homeassistant/cover/025a5eb7aab5 +0ms
  am43:025a5eb7aab5 interval: 1140000 +1ms
  am43:021889a0f84a mqtt topic homeassistant/cover/021889a0f84a +0ms
  am43:021889a0f84a interval: 1020000 +1ms
  am43:025a5eb7aab5 mqtt connected +23ms
  am43:021889a0f84a mqtt connected +27ms
  am43:021889a0f84a Connection busy for other device, delaying data read... +5s
  am43:025a5eb7aab5 AM43 connected for data reading +6s
  am43:025a5eb7aab5 discovered data char +115ms
  am43:025a5eb7aab5 received characteristic update +74ms
  am43:025a5eb7aab5 Notification data: 9aa205000000006459 +0ms
  am43:025a5eb7aab5 Notification identifier: a2 +1ms
  am43:025a5eb7aab5 Bat %: 100 +0ms
  am43:025a5eb7aab5 received characteristic update +40ms
  am43:025a5eb7aab5 Notification data: 9a00015a31 +1ms
  am43:025a5eb7aab5 Notification identifier: 00 +0ms
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s
  am43:021889a0f84a Connection busy for other device, delaying data read... +1s

If I remove the trouble device (i.e. 02:18:89:A0:F8:4A) from the startup command, so that only the other blind is specified, it works no problems!

@pi1:~/aok_mqtt $ sudo /home/pi/aok_mqtt/node_modules/.bin/am43ctrl 02:5A:5E:B7:AA:B5 -l 3001 -d --url mqtt://192.168.1.5 -u mqtt -p 
  am43* scanning for 1 device(s) [ '025a5eb7aab5' ] +0ms
  am43 listening on port 3001 +0ms
  am43 Found dff9288667b1 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5' ] +33ms
  am43 Found d629f4cdb522 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5' ] +2ms
  am43 Found e1a170935be3 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5' ] +3ms
  am43 Found 4a523534aa24 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5' ] +11ms
  am43 Found 278afc0a9a0a but will not connect as it was not specified in the list of devices [ '025a5eb7aab5' ] +8ms
  am43 Found 33cb747b9b61 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5' ] +17ms
  am43 Found 021889a0f84a but will not connect as it was not specified in the list of devices [ '025a5eb7aab5' ] +4ms
  am43 Found f333192b7832 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5' ] +33ms
  am43 Found e615fc138814 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5' ] +70ms
  am43 Found 1a77baca0051 but will not connect as it was not specified in the list of devices [ '025a5eb7aab5' ] +15ms
  am43* discovered 025a5eb7aab5 +721ms
  am43* all expected devices connected, stopping scan +0ms
  am43:025a5eb7aab5 mqtt topic homeassistant/cover/025a5eb7aab5 +0ms
  am43:025a5eb7aab5 interval: 1140000 +1ms
  am43:025a5eb7aab5 mqtt connected +25ms
  am43:025a5eb7aab5 AM43 connected for data reading +6s
  am43:025a5eb7aab5 discovered data char +159ms
  am43:025a5eb7aab5 received characteristic update +72ms
  am43:025a5eb7aab5 Notification data: 9aa205000000006459 +1ms
  am43:025a5eb7aab5 Notification identifier: a2 +1ms
  am43:025a5eb7aab5 Bat %: 100 +0ms
  am43:025a5eb7aab5 received characteristic update +41ms
  am43:025a5eb7aab5 Notification data: 9a00015a31 +0ms
  am43:025a5eb7aab5 Notification identifier: 00 +1ms

Doesn't respond occasionally - MaxListenersExceededWarning

(node:30862) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 handleWrite14 listeners added to [Peripheral]. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:389:17)
    at Peripheral.addListener (events.js:405:10)
    at Peripheral.once (events.js:436:8)
    at Peripheral.writeHandle (/home/pi/am43-ctrl/node_modules/@abandonware/noble/lib/peripheral.js:182:10)
    at Peripheral.handleDeviceConnected (/home/pi/am43-ctrl/src/am43.js:198:29)
    at Object.onceWrapper (events.js:421:26)
    at Peripheral.emit (events.js:314:20)
    at Noble.onConnect (/home/pi/am43-ctrl/node_modules/@abandonware/noble/lib/noble.js:209:16)
    at NobleBindings.emit (events.js:314:20)
    at NobleBindings.onLeConnComplete (/home/pi/am43-ctrl/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:224:8)

I have this running node v12.18 and v12.20, both on a rpi and with noble 1.9.2-10

Both of these devices work 75% of the time, but the above error occurs the times when it doesn't.

Failed to add/connect device

Hi,

I am getting error when trying to connect the device to MQTT broker.

reesion@rsha01:~$ sudo am43ctrl 02:0d:bf:12:8c:53 --url mqtt://192.168.1.142

am43* scanning for 1 device(s) [ '020dbf128c53' ] +0ms
am43* discovered 020dbf128c53 +190ms
am43* all expected devices connected, stopping scan +1ms
processLeAdvertisingReport: Caught illegal packet (buffer overflow): TypeError: this.log is not a function

Constant scanning - doesn't find device

Double checked the MAC over and over and its definitely correct - but when I run am43ctrl it sits at the first line saying scanning. Even put the Pi right next to the blinds but still not working - any ideas?

Thanks.

Failed to start service

Aug 04 16:15:59 homebridge systemd[3382]: am43ctrl.service: Failed to locate executable /AM43DIRECTORY/node_modules/.bin/am43ctrl: No such file or directory
Aug 04 16:15:59 homebridge systemd[3382]: am43ctrl.service: Failed at step EXEC spawning /AM43DIRECTORY/node_modules/.bin/am43ctrl: No such file or directory
Aug 04 16:15:59 homebridge systemd[1]: Started AM43-ctrl.
Aug 04 16:15:59 homebridge systemd[1]: am43ctrl.service: Main process exited, code=exited, status=203/EXEC
Aug 04 16:15:59 homebridge systemd[1]: am43ctrl.service: Failed with result 'exit-code'.
Aug 04 16:15:59 homebridge systemd[1]: am43ctrl.service: Scheduled restart job, restart counter is at 1.
Aug 04 16:15:59 homebridge systemd[1]: Stopped AM43-ctrl.
Aug 04 16:15:59 homebridge systemd[1]: Started AM43-ctrl.
Aug 04 16:15:59 homebridge systemd[3383]: am43ctrl.service: Failed to locate executable /AM43DIRECTORY/node_modules/.bin/am43ctrl: No such file or directory
Aug 04 16:15:59 homebridge systemd[3383]: am43ctrl.service: Failed at step EXEC spawning /AM43DIRECTORY/node_modules/.bin/am43ctrl: No such file or directory
Aug 04 16:16:00 homebridge systemd[1]: am43ctrl.service: Main process exited, code=exited, status=203/EXEC
Aug 04 16:16:00 homebridge systemd[1]: am43ctrl.service: Failed with result 'exit-code'.
Aug 04 16:16:00 homebridge systemd[1]: am43ctrl.service: Scheduled restart job, restart counter is at 2.
Aug 04 16:16:00 homebridge systemd[1]: Stopped AM43-ctrl.
Aug 04 16:16:00 homebridge systemd[1]: Started AM43-ctrl.
Aug 04 16:16:00 homebridge systemd[3384]: am43ctrl.service: Failed to locate executable /AM43DIRECTORY/node_modules/.bin/am43ctrl: No such file or directory
Aug 04 16:16:00 homebridge systemd[3384]: am43ctrl.service: Failed at step EXEC spawning /AM43DIRECTORY/node_modules/.bin/am43ctrl: No such file or directory
Aug 04 16:16:00 homebridge systemd[1]: am43ctrl.service: Main process exited, code=exited, status=203/EXEC
Aug 04 16:16:00 homebridge systemd[1]: am43ctrl.service: Failed with result 'exit-code'.
Aug 04 16:16:00 homebridge systemd[1]: am43ctrl.service: Scheduled restart job, restart counter is at 3.
Aug 04 16:16:00 homebridge systemd[1]: Stopped AM43-ctrl.
Aug 04 16:16:00 homebridge systemd[1]: Started AM43-ctrl.
Aug 04 16:16:00 homebridge systemd[3385]: am43ctrl.service: Failed to locate executable /AM43DIRECTORY/node_modules/.bin/am43ctrl: No such file or directory
Aug 04 16:16:00 homebridge systemd[3385]: am43ctrl.service: Failed at step EXEC spawning /AM43DIRECTORY/node_modules/.bin/am43ctrl: No such file or directory
Aug 04 16:16:00 homebridge systemd[1]: am43ctrl.service: Main process exited, code=exited, status=203/EXEC
Aug 04 16:16:00 homebridge systemd[1]: am43ctrl.service: Failed with result 'exit-code'.
Aug 04 16:16:00 homebridge systemd[1]: am43ctrl.service: Scheduled restart job, restart counter is at 4.
Aug 04 16:16:00 homebridge systemd[1]: Stopped AM43-ctrl.
Aug 04 16:16:00 homebridge systemd[3387]: am43ctrl.service: Failed to locate executable /AM43DIRECTORY/node_modules/.bin/am43ctrl: No such file or directory
Aug 04 16:16:00 homebridge systemd[3387]: am43ctrl.service: Failed at step EXEC spawning /AM43DIRECTORY/node_modules/.bin/am43ctrl: No such file or directory
Aug 04 16:16:00 homebridge systemd[1]: Started AM43-ctrl.
Aug 04 16:16:00 homebridge systemd[1]: am43ctrl.service: Main process exited, code=exited, status=203/EXEC
Aug 04 16:16:00 homebridge systemd[1]: am43ctrl.service: Failed with result 'exit-code'.
Aug 04 16:16:01 homebridge systemd[1]: am43ctrl.service: Scheduled restart job, restart counter is at 5.
Aug 04 16:16:01 homebridge systemd[1]: Stopped AM43-ctrl.
Aug 04 16:16:01 homebridge systemd[1]: am43ctrl.service: Start request repeated too quickly.
Aug 04 16:16:01 homebridge systemd[1]: am43ctrl.service: Failed with result 'exit-code'.
Aug 04 16:16:01 homebridge systemd[1]: Failed to start AM43-ctrl.

Reset upper and bottom limit

Is it possible to add the possibility to change the current upper and botton limit?

Might require three successively commands

  • change (upper or bottom) limit
  • move the blind (does already exist)
  • stop changing

My blinds chain is broken and sometimes slips through the gear, leading to wrong upper/bottom limits.
It would be easy to correct the limits automatically, if the commands exist.

Issue with Installation

Hi,

I am running Hass.io on Ubuntu v18.04. I have tried to install this and getting a mixture of issues with nodejs and npm. I finally get it installed with no issue but having issue running it.

Any idea what is happening?

root@rsha01:~# am43ctrl
internal/modules/cjs/loader.js:807
return process.dlopen(module, path.toNamespacedPath(filename));
^

Error: The module '/usr/local/lib/node_modules/am43-ctrl/node_modules/@abandonware/bluetooth-hci-socket/lib/binding/binding.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
at Object.Module._extensions..node (internal/modules/cjs/loader.js:807:18)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/usr/local/lib/node_modules/am43-ctrl/node_modules/@abandonware/bluetooth-hci-socket/lib/native.js:6:15)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
root@rsha01:# nodejs -v
v10.19.0
root@rsha01:
# npm -v
6.13.4
root@rsha01:~#

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.