Broadlink service

Yes, I did that right!

Ok this time I believe you :smiley:

1 Like

Hello !!

I would like to take part in the tests !! And from what I see, it’s a very interesting product (I didn’t know it ^^). I have therefore just ordered the RM4 Pro without thinking to ask beforehand whether it is compatible …^^ ??

RM range, so that should do it.

1 Like

Hi @AlexTrovato,

So I received my RM4 yesterday. Installation on the Broadlink app to activate the Wi‑Fi OK.
I launched your image before the installation. After installing in the app, no detection on Gladys (maybe normal? RM4‑Pro not recognized?).
To be sure I disabled the service because I had no logs. But on reactivation, it was in error. In the logs:

2022-05-07T08:54:16+0200 \u003cinfo\u003e index.js:16 (Object.start) starting Broadlink service
2022-05-07T08:54:16+0200 \u003cwarn\u003e service.start.js:44 (Service.start) Unable to start service broadlink Error [ERR_SOCKET_DGRAM_NOT_RUNNING]: Not running
    at new NodeError (internal/errors.js:322:7)
    at healthCheck (dgram.js:909:11)
    at Socket.close (dgram.js:741:3)
    at /src/server/services/broadlink/node_modules/broadlink-js/src/broadlink.js:137:20
    at Array.forEach (\u003canonymous\u003e)
    at Broadlink.discover (/src/server/services/broadlink/node_modules/broadlink-js/src/broadlink.js:136:22)
    at BroadlinkHandler.init (/src/server/services/broadlink/lib/commands/broadlink.init.js:14:18)
    at Object.start (/src/server/services/broadlink/index.js:17:22)
    at Service.start (/src/server/lib/service/service.start.js:33:21)
    at async start (/src/server/api/controllers/service.controller.js:22:21) {
  code: 'ERR_SOCKET_DGRAM_NOT_RUNNING'
}

I stopped the container and restarted it. On reboot:

2022-05-07T08:55:25+0200 \u003cinfo\u003e index.js:16 (Object.start) starting Broadlink service
2022-05-07T08:55:25+0200 \u003cerror\u003e index.js:20 (process.\u003canonymous\u003e) uncaughtException catched: uncaughtException
2022-05-07T08:55:25+0200 \u003cerror\u003e index.js:21 (process.\u003canonymous\u003e) TypeError: Cannot read property 'name' of undefined
    at Broadlink._onMessage (/src/server/services/broadlink/node_modules/broadlink-js/src/broadlink.js:255:24)
    at Socket.emit (events.js:400:28)
    at UDP.onMessage [as onmessage] (dgram.js:931:8)

Same as before when I try to restart the service. But after 2 minutes, I find it restarted without any further action, but still without « Available Broadlink devices ».

Tell me if you need more info ^^

I see there’s UDP, how did you start your container?
Host network?

It’s true that I’ve been launching all the containers like this for over a year… I shouldn’t have?

docker run -d \
--log-opt max-size=10m \
--restart=always \
--privileged \
--network=host \
--name gladys-atrovato-broadlink \
-e NODE_ENV=production \
-e SERVER_PORT=84 \
-e TZ=Europe/Paris \
-e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production-Broadlink.db \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/gladysassistant:/var/lib/gladysassistant \
-v /dev:/dev \
atrovato/gladys:broadlink

Edit : For info (I don’t know if it’s important), my Pi is on the LAN 10.5.0.x, the Broadlink is on 10.1.0.x, on my Pro and Netatmo images which are on the same Pi, the Philips Hue Bridges were previously found (a long time ago), but I see that no longer:


but they are still functional:

But on the Broadlink image they are not visible (new DB). Could there be a link? Yet I’ve always used the same command to start the images.

Parentheses

I haven’t tried the Broadlink service yet, but as for me, I haven’t been able to find the Hue bridge for a while either. Since 4.8.0 or 4.8.1.

I have the impression that the RM4 is not supported.
I’m working on adding support.
I’ll let you know as soon as a new image is available.

EDIT: new image available :slight_smile:

1 Like

Hi @AlexTrovato, and thanks for looking.

Sorry I hadn’t seen the edit to your message (no notification). I just tested: I don’t know if you can show logs or maybe do you want me to go through your GitHub PR to look at the relevant info?
Error when I go to the « Available devices » page:

2022-05-08T20:20:30+0200 \u003cerror\u003e broadlink.addPeripheral.js:18 (BroadlinkHandler.addPeripheral) Broadlink fails to connect to RM4 pro (83da3dae0bec) device

So, what I understand is that the « auth » method is failing on an RM4.
Do you have the ability to modify it on the fly? And delete or comment out the return; on line 19 of the file server/services/broadlink/lib/commands/broadlink.addPeripheral.js.

@Terdious

EDIT: a new image will be available in 1h30 :slight_smile:

Thx @AlexTrovato,

I should be able to remember how to do it, yes — I took notes about that for modifying inside a container ^^

FYI I tried to pull your GitHub atrovato/Gladys branch broadlink but on the page I have no logs. Not sure I can see it via WSL… so I’ll stick with the Docker image for testing if needed!!

No — indeed, via WSL it doesn’t work, the network isn’t the same.
You have to do something like docker exec -it sh to connect to the container… but the image is still downloading.

Well, he tells me the image is already ready… I’m having a hard time believing it…

You doubt my cache? :smirking_face:

1 Like

Well, uh… not anymore :smiley:

1 Like

That’s excellent!! What a job!! From both of you ^^

1 Like

Ah!! Although… server started but no front-end!!

Edit: I’m redoing a test to be sure!!
Commands run:

pi@gladysProWiFi:~ $ docker stop gladys-atrovato-broadlink
^[[Agladys-atrovato-broadlink
pi@gladysProWiFi:~ $ docker rm gladys-atrovato-broadlink
gladys-atrovato-broadlink
pi@gladysProWiFi:~ $ docker pull atrovato/gladys:broadlink
broadlink: Pulling from atrovato/gladys
57fb4b5f1a47: Already exists
2869060963db: Already exists
17cdedf2bad6: Already exists
1c2460bc2098: Already exists
3bf6be24a7d0: Already exists
5a00f0ed812d: Already exists
052ef630634f: Already exists
69fa31e628c3: Already exists
48be44b15657: Already exists
4f4fb700ef54: Already exists
a8cf63bf6330: Already exists
1a4f845f38a6: Already exists
0de229cfd802: Pull complete
Digest: sha256:180d9776fb7d8332ab4131c0bb079e230dd54c65555c4046f6660c48ca7357ec
Status: Downloaded newer image for atrovato/gladys:broadlink
docker.io/atrovato/gladys:broadlink
pi@gladysProWiFi:~ $ docker run -d --log-opt max-size=10m --restart=always --privileged --name gladys-atrovato-broadlink -e NODE_ENV=production -e SERVER_PORT=84 -e TZ=Europe/Paris -e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production-Broadlink.db -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/gladysassistant:/var/lib/gladysassistant -v /dev:/dev atrovato/gladys:broadlink
76e43d1cb4f34d6336a1323a7eaf5897c891b27e4331930f7a3ea9e279012b02
pi@gladysProWiFi:~ $ docker ps
CONTAINER ID        IMAGE                                 COMMAND                  CREATED             STATUS                 PORTS               NAMES
76e43d1cb4f3        atrovato/gladys:broadlink             \"docker-entrypoint.s…\"   37 seconds ago      Up 35 seconds          80/tcp              gladys-atrovato-broadlink
ead633c82a7a        terdious/gladys:netatmo-prod-030522   \"docker-entrypoint.s…\"   4 days ago          Up 4 days                                  gladys-netatmo
0f3e9b06b69e        nodered/node-red                      \"npm --no-update-not…\"   6 weeks ago         Up 3 weeks (healthy)                       node_red
3ec601776fe1        containrrr/watchtower:armhf-latest    \"/watchtower --clean…\"   3 months ago        Up 3 weeks             8080/tcp            watchtower
86f4cbb2416c        terdious/gladys:Pro-v4.2.3            \"docker-entrypoint.s…\"   12 months ago       Up 3 weeks                                 gladys-pro
pi@gladysProWiFi:~ $ docker logs gladys-atrovato-broadlink --follow

You didn’t pull the latest image; you’re missing docker rmi atrovato/gladys:broadlink after the rm.

1 Like

It works ^^


Initial feedback, there are several errors (maybe normal?):

2022-05-08T21:36:19+0200 \u003cinfo\u003e broadlink.addPeripheral.js:27 (BroadlinkHandler.addPeripheral) Broadlink discovers new peripheral: 83da3dae0bec
2022-05-08T21:36:31+0200 \u003cwarn\u003e broadlink.addPeripheral.js:18 (BroadlinkHandler.addPeripheral) Broadlink fails to connect to RM4 pro (83da3dae0bec) device Error: 65535
    at Socket.\u003canonymous\u003e (/src/server/services/broadlink/node_modules/node-broadlink/dist/device.js:118:28)
    at Object.onceWrapper (events.js:520:26)
    at Socket.emit (events.js:400:28)
    at UDP.onMessage [as onmessage] (dgram.js:931:8)
2022-05-08T21:36:31+0200 \u003cinfo\u003e broadlink.addPeripheral.js:27 (BroadlinkHandler.addPeripheral) Broadlink discovers new peripheral: 83da3dae0bec
2022-05-08T21:36:54+0200 \u003cerror\u003e device.poll.js:23 (DeviceManager.poll) There was an error while polling device broadlink-83da3dae0bec
2022-05-08T21:36:54+0200 \u003cerror\u003e device.poll.js:24 (DeviceManager.poll) Error: 65529
    at Socket.\u003canonymous\u003e (/src/server/services/broadlink/node_modules/node-broadlink/dist/device.js:118:28)
    at Object.onceWrapper (events.js:520:26)
    at Socket.emit (events.js:400:28)
    at UDP.onMessage [as onmessage] (dgram.js:931:8)

==> So no retrieval of Temp and Humid data as a result.
After adding the device, the button correctly switches to « Already created » but after refresh it asks to register it again even though it appears correctly on the devices page:


The « Save » button works fine when changing room.
The edit button causes the page to freeze (requires refresh) and the following front-end error:

RemoteCreation.jsx:402 Uncaught (in promise) TypeError: Cannot convert undefined or null to object
    at Function.keys (\u003canonymous\u003e)
    at l.render (RemoteCreation.jsx:402:31)
    at E (index.js:181:12)
    at f (children.js:137:3)
    at E (index.js:198:4)
    at f (children.js:137:3)
    at E (index.js:198:4)
    at f (children.js:137:3)
    at O (index.js:404:4)
    at E (index.js:232:20)

I’ll get back to you as soon as possible with feedback on creating the remote control (no light/outlet or siren)

1 Like