maxime1992 / linak-2-mqtt

41 stars 8 forks source link

Error while running the system #9

Open LuisDiazUgena opened 1 year ago

LuisDiazUgena commented 1 year ago

Hi!

First of all I want to thank you for the work in this repo. I was looking for something like this, and it always amaze me how already someone somewhere is already done whatever I need.

I'm running the linak docker container on a raspberry pi 3b+ and I'm facing some issues. The plan was to put the docker command on crontab so, at every reboot the docker will run itself. I have achieved that by running this command:

@reboot sleep 60 & /usr/bin/docker run -i --rm --privileged -v /var/run/dbus:/var/run/dbus -v /home/pi/linak-2-mqtt/linak-2-mqtt.env:/.env -v /home/pi/linak-2-mqtt/linak-config.yaml:/linak-config.yaml linak-2-mqtt > /home/pi/crontablog/linak-2-mqtt.log 2>&1

Disclose of the oneliner code :

sleep 60 is needed to let the system wake and make every part accesible to the script. If not added, it fails. needed to change the parameter -it to -i to fix "input device is not tty" Error. Also, added full path to docker and folder storing the docker container files to avoid any issues.

/home/pi/crontablog/linak-2-mqtt.log 2>&1 store the log fron the crontab in the chosen path.

That seems to run ok.

The issue is that some times the desk seems to not move at all, after receiving the correct message on the topic. Here is a log example:

[debug] Connected
starting idasen server...
Connecting
Connected DF:75:F4:7D:80:E3

triggering watch..
Server listening

Received command

Height:  794mm

returned 794
publishing updated height { absolute: 79, 'process.env.DESK_LOWEST_HEIGHT_CM': 70, relative: 9 }
client message. Topic "linak-2-mqtt/set-desk-height", value: 113
Attempt to move desk to 113cm
Received command

Height:  794mm

returned 794
publishing updated height { absolute: 79, 'process.env.DESK_LOWEST_HEIGHT_CM': 70, relative: 9 }
Moving to height: 1130

Height:  794mm Speed:  0mm/s

returned 794
publishing updated height { absolute: 79, 'process.env.DESK_LOWEST_HEIGHT_CM': 70, relative: 9 }
Final height:  794mm (Target: 1130mm)

As you can see, the desk is connected and the desk is recieved the correct height information. After that, the message shows a speed of 0 mm/s. Which I think is the root of problem.

If I move the desk using the attached controller, the new height is displayed properly:

Height:  928mm

returned 928

I have confirmed that it's working after connecting it to the app, as recalled on this issue: https://github.com/rhyst/idasen-controller/issues/32

maxime1992 commented 1 year ago

Hello,

thanks for the kind words. Glad it was helpful!

I'm not running this project anymore because for now my desk is too far from the bluetooth emitter so I'm not really into the project anymore. That said, what I've done is a small wrapper and if you've got connection/commands issues I'd suggest to probably look into https://github.com/rhyst/idasen-controller

Sorry I can't be of much help here. I built this project during a hackday and used it for a bit but then moved and as explained desk is too far from my bluetooth emitter to keep using it reliably...

nerijus commented 10 months ago

My bluetooth controller is far away from the desk too, but Home Assistant can use bluetooth proxy. For example, I have Shelly integration in HA and I can access Temperature/Humidity Sensors via it. Could it be possible to use bluetooth proxy in this case?

maxime1992 commented 9 months ago

I'm really unsure but please do let me know if you find out :)