fhempy stuck in loop trying to update

Begonnen von malc_b, 27 Januar 2024, 13:00:07

Vorheriges Thema - Nächstes Thema

malc_b

Hi,

I'm trying to get fhempy working for eq3bt.

I did Fhem Update and that reports
BindingsIo (fhempy_local): ==> FHEMPY UPDATE STARTED...CHECK FHEMPY STATE FOR STATUS <==

Click on fhempy and I have
fhempyserver_15733
fhempy_local
should I have both of these?

fhempy Log is only found on fhempyserver_15733 (not fhempy_local)and this says
2024-01-27 09:16:00,486 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy 0.1.670...
2024-01-27 09:16:00,520 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2024-01-27 09:16:01,652 - INFO     - websockets.server: server listening on 0.0.0.0:15733

fhempy_local says
state Installing fhempy (15min). 2024-01-27 10:17:38

It just stays in this state no matter how long I leave it.

How do I fix this?  Or how do I totally remove fhempy if it is easier to start again and reinstall latest?

Thanks


malc_b

So I tried to reverse the install of fhempy.  I did delete Eq3bt1, delete fhempy_local, delete fhempyserver_15733 and delete fhempy, then a reboot.  In linux I did a reboot too, then a complete cpan upgrade.  I also did update delete http..../controls_pythonbinding.txt but not sure that was necessary.  Then I did the fhempy install steps again.

I now have a fhempy_local and a fhempyserver_15733.  Both say running but fhempy_local says it is running 0.1.670 and I can start the 0.1.716 update so I do this.  fhempy_local says doing upgrade, then restarting, then running but still running 0.1.670 and still with a 0.1.716 upgrade available.

The fhempyserver logfile has:

Activating virtual environment...OK
2024-01-27 17:02:46,650 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy 0.1.670...
2024-01-27 17:02:46,665 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2024-01-27 17:02:47,130 - INFO     - websockets.server: server listening on 0.0.0.0:15733
2024-01-27 17:02:50,784 - INFO     - websockets.server: connection open
2024-01-27 17:02:50,791 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
Activating virtual environment...OK
2024-01-27 17:06:39,042 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy 0.1.670...
2024-01-27 17:06:39,071 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2024-01-27 17:06:40,049 - INFO     - websockets.server: server listening on 0.0.0.0:15733
2024-01-27 17:06:46,612 - INFO     - websockets.server: connection open
2024-01-27 17:06:46,618 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2024-01-27 17:15:09,113 - INFO     - fhempy.lib.fhem_pythonbinding: Start update...
2024-01-27 17:15:09,154 - INFO     - fhempy.lib.pkg_installer: Attempting install of fhempy
2024-01-27 17:17:05,291 - INFO     - fhempy.lib.pkg_installer: Successfully installed fhempy update!
2024-01-27 17:17:05,347 - INFO     - fhempy.lib.fhem_pythonbinding: Restart initiated...
2024-01-27 17:17:05,357 - INFO     - websockets.server: server closing
2024-01-27 17:17:15,429 - INFO     - websockets.server: connection closed
2024-01-27 17:17:15,433 - INFO     - websockets.server: server closed
2024-01-27 17:17:15,464 - INFO     - fhempy.lib.fhem_pythonbinding: Exit 1
Activating virtual environment...OK
2024-01-27 17:17:34,321 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy 0.1.670...
2024-01-27 17:17:34,336 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2024-01-27 17:17:34,905 - INFO     - websockets.server: server listening on 0.0.0.0:15733
2024-01-27 17:17:40,464 - INFO     - websockets.server: connection open
2024-01-27 17:17:40,471 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1

The log file says update has been installed ok but the version number has not changed.  I wonder if the update has neglected to change the version number?


malc_b

#2
I think my problem could be due to the fact that the python3 which apt gets is 3.7 and fhempy says it needs >=3.9.  I'm struggling to get a 3.9 version on my PI which is running Buster.  I think it might be better to build a new sd card with the latest raspbian.  Fhem wiki tells me how to install fhem but I can't find anything on copying a fhem installation.  Do I just need to copy the fhem config file(s)?

UPDATE

DOH!  Fhem has a backup command!  Restore backup is the way to copy an installation.

malc_b

So I've updated the Raspberry PI to  Buster (11).  I've made a new sd card so it's a fresh install.  No python2 only python3 (3.9.2).  Got fhem working and installed all the spi/i2c/gpio stuff.  I'm now trying to get fhempy to work and it still not behaving.  I've add an eq3bt and that just says "fhempy server offline"

log file has
2024.02.04 10:06:43 1: fhempy_local: Can't connect to ws:127.0.0.1:15733: Illegal seek
2024.02.04 10:06:43 1: fhempy_local: Can't connect to ws:127.0.0.1:15733: 127.0.0.1: Connection refused (111)
2024.02.04 10:06:43 1: BindingsIo (fhempy_local): ERROR during connection setup: 127.0.0.1: Connection refused (111)

and fhempy log has
2024-02-04 10:06:55,852 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy 0.1.717...
2024-02-04 10:06:55,888 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2024-02-04 10:06:56,615 - INFO     - websockets.server: server listening on 0.0.0.0:15733

What do I try?




passibe

Zitat von: malc_b am 04 Februar 2024, 11:13:182024-02-04 10:06:56,615 - INFO    - websockets.server: server listening on 0.0.0.0:15733

This line indicates that at least the fhempy server is running. So in principle you should be fine, but for some reason fhempy_local is unable to connect.

1. Can you provide a list of the fhempy_local device, please? (Simply execute list fhempy_local)

2. In addition, can you please check via SSH on the machine where fhem is running whether the fhempy server is actually listening:
netstat -tulpn | grep LISTEN
3. Can you check whether the port is reachable by the fhem process? Execute in FHEM (the quotation marks are important):
"nc -vz 127.0.0.1 15733"Then check your fhem logfile, what you should see is:
Connection to 127.0.0.1 15733 port [tcp/*] succeeded!And in the fhempy log you should see:
2024-02-04 13:41:48,846 - INFO     - websockets.server: connection rejected (400 Bad Request)
2024-02-04 13:41:48,847 - INFO     - websockets.server: connection closed

malc_b

I found this post https://forum.fhem.de/index.php?topic=126887.0

and I tried changing

define fhempy_local BindingsIo fhempy

to

define fhempy_local BindingsIo 127.0.0.1:15733 fhempy

and a restart.  Now I get eq3bt saying installing update so this looks more hopeful.

malc_b

Hi passibe,

Thanks for the reply.  I think this might be out of date since it seems to have moved on as is connected now I've changed the define for BindingsIo and restarted.  Currently htop shows the update is still in progress.  CPU is at 100%, mem=105M/477M, Swap=10M/100M and it has been running a while.  I had the same problem with getting fhempy to upgrade, not so much 15 minutes, more like 15hrs.

UPDATE, htop says it has finished.  Eq3bt shows readings so looks like it is working.

malc_b

Still not 100% yet.  I do not have any of the schedules nor all the readings as shown in the screenshot at

 https://github.com/fhempy/fhempy/blob/master/FHEM/bindings/python/fhempy/lib/eq3bt/screenshot.png

As well as no schedules, consumptions are all zero as is valve position.

I've set verbose to 5 and in the log I get a load of " - DEBUG    - Eq3bt1: Querying schedule.." so it would seem to be trying to do something, just not succeeding.

passibe

Sorry, I can't help you with that, I haven't used that integration.
Maybe open an issue on GitHub for this problem? I think you'd be more likely to get help there.

(Is this the first time you're using this integration on your current machine? In my experience, bluetooth hardware can sometimes be a bit finicky, it might be good to verify if the problem persists when using a different bluetooth adapter (e.g. an usb dongle).)