BeamCtrl / Airiana

SystemAir Modbus Ventilaton Controller VR400/VR700/VTR300/VSR300/SaveCair
Other
26 stars 7 forks source link

New install - Python install issue with Raspberry Pi image "Bullseye" #22

Closed overas closed 1 year ago

overas commented 2 years ago

Describe the bug Airiana Python requirements do not install with install.py. I also get RAM disk errors.

To Reproduce I have a raspberry pi 3 I downloaded Raspberry Pi Os from here: https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2021-11-08/2021-10-30-raspios-bullseye-armhf-lite.zip and write the pi-image to sd-card. After initial boot I enabled ssh-server with raspi-config and changed timezone.

Then I ran these commands: sudo apt-get update sudo apt-get upgrade sudo apt-get install git git clone https://github.com/BeamCtrl/Airiana cd Airiana sudo python ./install.py

Expected behavior Airiana webserver starts properly

Screenshots If applicable, add screenshots to help explain your problem.

Additional context

First try: pi@raspberrypi:~/Airiana $ sudo python ./install.py File "/home/pi/Airiana/./install.py", line 16 print "Installing the AirianaCores" ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Installing the AirianaCores")?

I found out the error message is because install.py use Python 3. I installed Python 2 pi@raspberrypi:~/Airiana $ sudo apt install python2 pi@airiana:~ $ python --version Python 2.7.18

Second try with Python 2: pi@raspberrypi:~/Airiana $ sudo python2 ./install.py Installing the AirianaCores Hit:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease Hit:2 http://archive.raspberrypi.org/debian bullseye InRelease Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done Package python-pip is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: python3-pip

E: Package 'python-pip' has no installation candidate Reading package lists... Done Building dependency tree... Done Reading state information... Done Note, selecting 'python-dev-is-python2' instead of 'python-dev' The following additional packages will be installed: libexpat1-dev libpython2-dev libpython2.7 libpython2.7-dev python-is-python2 python2-dev python2.7-dev The following packages will be REMOVED: python-is-python3 The following NEW packages will be installed: libexpat1-dev libpython2-dev libpython2.7 libpython2.7-dev python-dev-is-python2 python-is-python2 python2-dev python2.7-dev 0 upgraded, 8 newly installed, 1 to remove and 0 not upgraded. Need to get 3,272 kB of archives. After this operation, 12.8 MB of additional disk space will be used. Get:1 http://raspbian.trivini.no/raspbian bullseye/main armhf libexpat1-dev armhf 2.2.10-2 [121 kB] Get:2 http://raspbian.trivini.no/raspbian bullseye/main armhf libpython2.7 armhf 2.7.18-8 [865 kB] Get:3 http://raspbian.trivini.no/raspbian bullseye/main armhf libpython2.7-dev armhf 2.7.18-8 [1,967 kB] Get:4 http://raspbian.trivini.no/raspbian bullseye/main armhf libpython2-dev armhf 2.7.18-3 [21.3 kB] Get:5 http://raspbian.trivini.no/raspbian bullseye/main armhf python-is-python2 all 2.7.18-9 [2,940 B] Get:6 http://raspbian.trivini.no/raspbian bullseye/main armhf python2.7-dev armhf 2.7.18-8 [292 kB] Get:7 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf python2-dev armhf 2.7.18-3 [1,216 B] Get:8 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf python-dev-is-python2 all 2.7.18-9 [1,528 B] Fetched 3,272 kB in 1s (2,723 kB/s) (Reading database ... 42685 files and directories currently installed.) Removing python-is-python3 (3.9.2-1) ... Selecting previously unselected package libexpat1-dev:armhf. (Reading database ... 42680 files and directories currently installed.) Preparing to unpack .../0-libexpat1-dev_2.2.10-2_armhf.deb ... Unpacking libexpat1-dev:armhf (2.2.10-2) ... Selecting previously unselected package libpython2.7:armhf. Preparing to unpack .../1-libpython2.7_2.7.18-8_armhf.deb ... Unpacking libpython2.7:armhf (2.7.18-8) ... Selecting previously unselected package libpython2.7-dev:armhf. Preparing to unpack .../2-libpython2.7-dev_2.7.18-8_armhf.deb ... Unpacking libpython2.7-dev:armhf (2.7.18-8) ... Selecting previously unselected package libpython2-dev:armhf. Preparing to unpack .../3-libpython2-dev_2.7.18-3_armhf.deb ... Unpacking libpython2-dev:armhf (2.7.18-3) ... Selecting previously unselected package python-is-python2. Preparing to unpack .../4-python-is-python2_2.7.18-9_all.deb ... Unpacking python-is-python2 (2.7.18-9) ... Selecting previously unselected package python2.7-dev. Preparing to unpack .../5-python2.7-dev_2.7.18-8_armhf.deb ... Unpacking python2.7-dev (2.7.18-8) ... Selecting previously unselected package python2-dev. Preparing to unpack .../6-python2-dev_2.7.18-3_armhf.deb ... Unpacking python2-dev (2.7.18-3) ... Selecting previously unselected package python-dev-is-python2. Preparing to unpack .../7-python-dev-is-python2_2.7.18-9_all.deb ... Unpacking python-dev-is-python2 (2.7.18-9) ... Setting up libpython2.7:armhf (2.7.18-8) ... Setting up libexpat1-dev:armhf (2.2.10-2) ... Setting up python-is-python2 (2.7.18-9) ... Setting up libpython2.7-dev:armhf (2.7.18-8) ... Setting up libpython2-dev:armhf (2.7.18-3) ... Setting up python2.7-dev (2.7.18-8) ... Setting up python2-dev (2.7.18-3) ... Setting up python-dev-is-python2 (2.7.18-9) ... Processing triggers for man-db (2.9.4-2) ... Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u2) ... Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: javascript-common libjs-jquery libjs-sphinxdoc libjs-underscore libpython3-dev libpython3.9-dev python3-distutils python3-lib2to3 python3.9-dev Suggested packages: apache2 | lighttpd | httpd The following NEW packages will be installed: javascript-common libjs-jquery libjs-sphinxdoc libjs-underscore libpython3-dev libpython3.9-dev python3-dev python3-distutils python3-lib2to3 python3.9-dev 0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded. Need to get 4,372 kB of archives. After this operation, 17.0 MB of additional disk space will be used. Get:1 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf javascript-common all 11+nmu1 [6,260 B] Get:2 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libjs-jquery all 3.5.1+dfsg+~3.5.5-7 [315 kB] Get:3 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libjs-underscore all 1.9.1~dfsg-3 [100 kB] Get:4 http://raspbian.trivini.no/raspbian bullseye/main armhf libjs-sphinxdoc all 3.4.3-2 [127 kB] Get:5 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libpython3.9-dev armhf 3.9.2-1+rpi1 [3,055 kB] Get:6 http://raspbian.trivini.no/raspbian bullseye/main armhf libpython3-dev armhf 3.9.2-3 [21.7 kB] Get:7 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf python3.9-dev armhf 3.9.2-1+rpi1 [501 kB] Get:8 http://raspbian.trivini.no/raspbian bullseye/main armhf python3-lib2to3 all 3.9.2-1 [77.8 kB] Get:9 http://raspbian.trivini.no/raspbian bullseye/main armhf python3-distutils all 3.9.2-1 [143 kB] Get:10 http://raspbian.trivini.no/raspbian bullseye/main armhf python3-dev armhf 3.9.2-3 [24.8 kB] Fetched 4,372 kB in 2s (2,483 kB/s) Selecting previously unselected package javascript-common. (Reading database ... 42856 files and directories currently installed.) Preparing to unpack .../0-javascript-common_11+nmu1_all.deb ... Unpacking javascript-common (11+nmu1) ... Selecting previously unselected package libjs-jquery. Preparing to unpack .../1-libjs-jquery_3.5.1+dfsg+~3.5.5-7_all.deb ... Unpacking libjs-jquery (3.5.1+dfsg+~3.5.5-7) ... Selecting previously unselected package libjs-underscore. Preparing to unpack .../2-libjs-underscore_1.9.1~dfsg-3_all.deb ... Unpacking libjs-underscore (1.9.1~dfsg-3) ... Selecting previously unselected package libjs-sphinxdoc. Preparing to unpack .../3-libjs-sphinxdoc_3.4.3-2_all.deb ... Unpacking libjs-sphinxdoc (3.4.3-2) ... Selecting previously unselected package libpython3.9-dev:armhf. Preparing to unpack .../4-libpython3.9-dev_3.9.2-1+rpi1_armhf.deb ... Unpacking libpython3.9-dev:armhf (3.9.2-1+rpi1) ... Selecting previously unselected package libpython3-dev:armhf. Preparing to unpack .../5-libpython3-dev_3.9.2-3_armhf.deb ... Unpacking libpython3-dev:armhf (3.9.2-3) ... Selecting previously unselected package python3.9-dev. Preparing to unpack .../6-python3.9-dev_3.9.2-1+rpi1_armhf.deb ... Unpacking python3.9-dev (3.9.2-1+rpi1) ... Selecting previously unselected package python3-lib2to3. Preparing to unpack .../7-python3-lib2to3_3.9.2-1_all.deb ... Unpacking python3-lib2to3 (3.9.2-1) ... Selecting previously unselected package python3-distutils. Preparing to unpack .../8-python3-distutils_3.9.2-1_all.deb ... Unpacking python3-distutils (3.9.2-1) ... Selecting previously unselected package python3-dev. Preparing to unpack .../9-python3-dev_3.9.2-3_armhf.deb ... Unpacking python3-dev (3.9.2-3) ... Setting up javascript-common (11+nmu1) ... Setting up libpython3.9-dev:armhf (3.9.2-1+rpi1) ... Setting up python3.9-dev (3.9.2-1+rpi1) ... Setting up libjs-jquery (3.5.1+dfsg+~3.5.5-7) ... Setting up python3-lib2to3 (3.9.2-1) ... Setting up libjs-underscore (1.9.1~dfsg-3) ... Setting up python3-distutils (3.9.2-1) ... Setting up libpython3-dev:armhf (3.9.2-3) ... Setting up libjs-sphinxdoc (3.4.3-2) ... Setting up python3-dev (3.9.2-3) ... Processing triggers for man-db (2.9.4-2) ... Reading package lists... Done Building dependency tree... Done Reading state information... Done Package python-matplotlib is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'python-matplotlib' has no installation candidate sh: 1: pip: not found sh: 1: pip: not found sh: 1: pip: not found sh: 1: pip: not found sh: 1: pip: not found sh: 1: pip: not found Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libevent-core-2.1-7 libevent-pthreads-2.1-7 libopts25 sntp Suggested packages: ntp-doc The following packages will be REMOVED: systemd-timesyncd The following NEW packages will be installed: libevent-core-2.1-7 libevent-pthreads-2.1-7 libopts25 ntp sntp 0 upgraded, 5 newly installed, 1 to remove and 0 not upgraded. Need to get 1,131 kB of archives. After this operation, 2,569 kB of additional disk space will be used. Get:1 http://raspbian.trivini.no/raspbian bullseye/main armhf libopts25 armhf 1:5.18.16-4 [60.8 kB] Get:2 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf ntp armhf 1:4.2.8p15+dfsg-1 [722 kB] Get:3 http://raspbian.trivini.no/raspbian bullseye/main armhf libevent-core-2.1-7 armhf 2.1.12-stable-1 [126 kB] Get:4 http://raspbian.trivini.no/raspbian bullseye/main armhf libevent-pthreads-2.1-7 armhf 2.1.12-stable-1 [56.8 kB] Get:5 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf sntp armhf 1:4.2.8p15+dfsg-1 [166 kB] Fetched 1,131 kB in 1s (1,223 kB/s) Selecting previously unselected package libopts25:armhf. (Reading database ... 43263 files and directories currently installed.) Preparing to unpack .../libopts25_1%3a5.18.16-4_armhf.deb ... Unpacking libopts25:armhf (1:5.18.16-4) ... dpkg: systemd-timesyncd: dependency problems, but removing anyway as you requested: systemd depends on systemd-timesyncd | time-daemon; however: Package systemd-timesyncd is to be removed. Package time-daemon is not installed. Package systemd-timesyncd which provides time-daemon is to be removed. systemd depends on systemd-timesyncd | time-daemon; however: Package systemd-timesyncd is to be removed. Package time-daemon is not installed. Package systemd-timesyncd which provides time-daemon is to be removed.

(Reading database ... 43268 files and directories currently installed.) Removing systemd-timesyncd (247.3-6+rpi1) ... Selecting previously unselected package ntp. (Reading database ... 43255 files and directories currently installed.) Preparing to unpack .../ntp_1%3a4.2.8p15+dfsg-1_armhf.deb ... Unpacking ntp (1:4.2.8p15+dfsg-1) ... Selecting previously unselected package libevent-core-2.1-7:armhf. Preparing to unpack .../libevent-core-2.1-7_2.1.12-stable-1_armhf.deb ... Unpacking libevent-core-2.1-7:armhf (2.1.12-stable-1) ... Selecting previously unselected package libevent-pthreads-2.1-7:armhf. Preparing to unpack .../libevent-pthreads-2.1-7_2.1.12-stable-1_armhf.deb ... Unpacking libevent-pthreads-2.1-7:armhf (2.1.12-stable-1) ... Selecting previously unselected package sntp. Preparing to unpack .../sntp_1%3a4.2.8p15+dfsg-1_armhf.deb ... Unpacking sntp (1:4.2.8p15+dfsg-1) ... Setting up libopts25:armhf (1:5.18.16-4) ... Setting up ntp (1:4.2.8p15+dfsg-1) ... Created symlink /etc/systemd/system/multi-user.target.wants/ntp.service → /lib/systemd/system/ntp.service. Setting up libevent-core-2.1-7:armhf (2.1.12-stable-1) ... Setting up libevent-pthreads-2.1-7:armhf (2.1.12-stable-1) ... Setting up sntp (1:4.2.8p15+dfsg-1) ... Processing triggers for man-db (2.9.4-2) ... Processing triggers for dbus (1.12.20-2) ... Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u2) ... Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Enabling uart Setting up Ram drive setup autostart for airiana.service Created symlink /etc/systemd/system/multi-user.target.wants/airiana.service → /etc/systemd/system/airiana.service. setup autostart for controller.service Created symlink /etc/systemd/system/multi-user.target.wants/controller.service → /etc/systemd/system/controller.service. adding boot cmdline config Copy hosts file Touch data.log setup symlinkts between RAM and ./public ln: failed to create symbolic link 'out.txt': File exists ln: failed to create symbolic link 'history.png': File exists chown: cannot access '../RAM/': No such file or directory chown: cannot access '../RAM/*': No such file or directory setup auto update from airiana repo. no crontab for pi Installation completed, reboot in 15 sec

overas commented 2 years ago

Here are the data.log after running ./backup.py and the err file. I get a lot of:

`unable to ping, network error Fri Apr 29 11:11:08 2022

in the err file. Can this explain the missing relative humidity? ` Airiana-data.log RAM-data.log err.txt

overas commented 2 years ago

From the HA history graph it looks like the relative humidity is above 100 % two times.

image

BeamCtrl commented 2 years ago

Yes this happens when your unit starts to report zero values on extract temperature, very unclear why it shifts sometimes.

overas commented 2 years ago

After a restart of the airiana service the values is back again to normal.

image

overas commented 2 years ago

I am trying to do a fresh install of Airiana following your advice here: https://github.com/BeamCtrl/Airiana/issues/22#issuecomment-1064521629

I know get an error with install.py

pi@airiana:~/Airiana $ sudo python3 install.py clean
Traceback (most recent call last):
  File "/home/pi/Airiana/install.py", line 19, in <module>
    user_id = pwd.pwuid()
AttributeError: module 'pwd' has no attribute 'pwuid'
pi@airiana:~/Airiana $
BeamCtrl commented 2 years ago

fix to pwuid is up, just to explain some of your questions above, unable to ping means that the unit is not able to contact the internet and do a DNS lookup, "no internet connection".

The reason that the RH is above 100 is due to the fact that when it is receiving 0C as indoor temp, it calculates what the outside max possible RH level is expressed as a relation to the indoor temp. If the outdoor is higher than 0C this will result in a above 100% RH as the 0C would generate condensation if outside air were to move inside.

overas commented 2 years ago

fix to pwuid is up,

The fix do not work for me.

pi@airiana:~/Airiana $ whoami
pi
pi@airiana:~/Airiana $ sudo python3 install.py clean
Traceback (most recent call last):
  File "/home/pi/Airiana/install.py", line 19, in <module>
    user_id = pwd.getpwuid()
TypeError: pwd.getpwuid() takes exactly one argument (0 given)
BeamCtrl commented 2 years ago

tnx for reporting now fixed properly, was a mistake on my part.

overas commented 2 years ago

The reason that the RH is above 100 is due to the fact that when it is receiving 0C as indoor temp, it calculates what the outside max possible RH level is expressed as a relation to the indoor temp. If the outdoor is higher than 0C this will result in a above 100% RH as the 0C would generate condensation if outside air were to move inside.

Is this something you can fix in Airiana? Or is it something wrong with my fan or IAM? Today my wife and I have showered twice. Airiana do not sense the high moisture in the bathroom and the fan does not change to high to lower the humidity.

image

overas commented 2 years ago

I think Airiana configured my VTR500 fan to have airflow "Low" and "Temperature" 24 degree now. I want to have airflow Normal. How can I configure Airiana to use Normal as default? I have tried Fanspeed Normal but it change back to Low.

BeamCtrl commented 2 years ago

quite the challange, I'm reluctant to blame hardware, I have however been unable to find a reasonable cause within the airiana code to explain the Zero temp issue. While reading above, did it clear the issue both by resetting the VTR unit or restarting airiana. if both are valid it must be something within the comms layer but I have no possibility to test this.

The shower issue is happening due to the zero temp causing the exchanger setting to turn on and off repetedly, It will detect that it is cold inside(0.0C) and then see that it is already at set temp for the supply line which will turn off the exchanger, this will set a hold off timer for all sensing for 10 min. this hold off timer causes airiana to not activate the shower mode.

To get to normal vent lvl you will need to toggle system auto to off and press the norm fanspeed button. this will however turn off all automated features. When all is working as intended Airiana will use the norm setting when it reaches a high differential of the humidity, It will change the low flow settings dynamically to get a steady state for current humidity load of the indoor climate. So default for airiana is low if all metrics match up while dynamically changing this level when needed.

BeamCtrl commented 2 years ago

Noted that since we are getting the proper RH values I may be able to work around the shower issue but it will take a little time to figure out the actual implications of changing the logic. It may impact other things.

overas commented 2 years ago

Sorry for late reply. I have been testing Home Assistant modbus sensor integration for trying to find out why the unit starts to report zero values from the extract temperature. This do not happen as a sensor in HA.

But I had problems with IAM reporting in the HA log it was busy. I have tried changing the ethernet cabel and not using a switch and using av delay in the config, but it did not help. After a while with troubleshooting I found out from the systemair documentation https://shop.systemair.com/upload/assets/SAVE_MODBUS_VARIABLE_LIST_20190116__REV__29_.PDF, I must have in the config the signal type used.

image

From the HA modbus doc https://www.home-assistant.io/integrations/modbus/, the Unsigned integers use data_type: uint16 and Signed integers use data_type: int16.

  - name: "VTR500 Extract Air Temperature"
    unit_of_measurement: °C
    device_class: temperature
    slave: 1
    address: 12543
    scale: 0.1
    precision: 1
    data_type: uint16

I tried to find in the airiana-core.py if unsigned integers is specified for address: 12543, but my knowledge in Python is not so good. The pymodbustcp libary have this documentation about this https://pymodbustcp.readthedocs.io/en/latest/quickstart/index.html#utils-module-modbus-data-mangling

So here comes the question. Could it be that pymodbustcp is reading wrong from address: 12543 and give zero or something else which airiana thinks is temperature 0 degree? Look here: https://github.com/sourceperl/pyModbusTCP/issues/22

BeamCtrl commented 2 years ago

Hi, data type is correct as it works most of the time, any issues with sign bit will be seen if extract temp would be lower than 0 and then as a twos complement. However I had some ideas reading thru the modbusTCP documentation on what would happen if there is a loss of connection mid the communication cycle. Did not howver become any smarter but added Auto close festure on the connection to reconnect after each request along with some more error prints. New commit up…

overas commented 2 years ago

It is something wrong with my IAM I think. I thought I had solved the SlaveBusy error, but it comes back again.

image

Do you use a IAM to communicate?

BeamCtrl commented 2 years ago

No I have a rpi rs485 shield. lets see if we can identify the cause and maybe get a work around going

BeamCtrl commented 2 years ago

i just found an edge case where this might apply, where if the IAM will supply 2 consecutive zero values it may lock further extract temp updates, as this is what we are seeing try the latest commit. Note that i found an error in the shutdown fnction aswell so recomended is a ”kill” on the process to properly get it to restart.

overas commented 2 years ago

I have a lot of "TCP read error on adresse" displayed in the webpage. This I have seen before. But know it verifies the communication problem with the IAM and the vtr500 when its logged.

image

The vtr500 modbus communication setting I use is: Slave address: 1 Baud rate: 115200 Parity: None Stop bits: 1

I do not know what baud rate the IAM use. It should be the same as the vtr500. Maybe it is wrong baud rate which gives communication problems?

pi@airiana:~/Airiana $ cat ./RAM/err

Using /dev/serial0 System started Sat May 21 11:27:22 2022 Traceback (most recent call last): File "/home/pi/Airiana/airiana-core.py", line 1938, in device = Systemair() File "/home/pi/Airiana/airiana-core.py", line 470, in init self.set_system_name() File "/home/pi/Airiana/airiana-core.py", line 586, in set_system_name self.system_name = self.system_types[req.response] KeyError: 252

Using /dev/serial0 System started Sat May 21 11:27:23 2022 Savecair unit set /usr/lib/python3/dist-packages/numpy/core/fromnumeric.py:3372: RuntimeWarning: Mean of empty slice. return _methods._mean(a, axis=axis, dtype=dtype, /usr/lib/python3/dist-packages/numpy/core/_methods.py:170: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) cycle exchanger to: 0 Sat May 21 11:27:33 2022 Exchange set to 0 inlet>10C and extr above target Sat May 21 11:27:33 2022 json-writer error [] temp read error at: 3180C Sat May 21 11:28:37 2022 cycle exchanger to: 0 Sat May 21 11:28:38 2022 Pressure difference set to: 0% Sat May 21 11:28:38 2022 Cooling activated Sat May 21 11:28:40 2022 temp read error at: 3180C Sat May 21 11:29:32 2022 temp read error at: 3180C Sat May 21 11:29:37 2022 temp read error at: 3180C Sat May 21 11:29:42 2022 temp read error at: 3120C Sat May 21 11:29:52 2022 temp read error at: 3120C Sat May 21 11:29:52 2022 temp read error at: 3120C Sat May 21 11:30:02 2022 temp read error at: 3180C Sat May 21 11:30:07 2022 temp read error at: 3180C Sat May 21 11:30:07 2022 Traceback (most recent call last): File "/home/pi/Airiana/airiana-core.py", line 2168, in log = "echo \"" + str(time.ctime()) + ":" + str(sender) + ":" + str(data) + "\" >> netlog.log &" NameError: name 'sender' is not defined Traceback (most recent call last): File "/home/pi/Airiana/./grapher.py", line 143, in ax.set_xlim(min(time[-day:-1]), max(time[-day:-1])) ValueError: min() arg is an empty sequence temp read error at: 25.1C Sat May 21 11:33:28 2022 temp read error at: 3120C Sat May 21 11:34:17 2022 temp read error at: 3060C Sat May 21 11:34:52 2022 temp read error at: 3120C Sat May 21 11:35:27 2022 Changing fanspeed to:1 Sat May 21 11:37:24 2022 Cooling will wait, will try to recycle cold air by low fanspeed Sat May 21 11:37:25 2022 temp read error at: 1440C Sat May 21 11:38:17 2022 /home/pi/Airiana/./grapher.py:143: UserWarning: Attempting to set identical left == right == 470.3079504966736 results in singular transformations; automatically expanding. ax.set_xlim(min(time[-day:-1]), max(time[-day:-1])) /home/pi/Airiana/./grapher.py:165: UserWarning: Attempting to set identical left == right == 470.3079504966736 results in singular transformations; automatically expanding. ax.set_xlim(min(time[-day:-1]), max(time[-day:-1])) temp read error at: 1440C Sat May 21 11:39:22 2022 temp read error at: 1500C Sat May 21 11:39:32 2022 temp read error at: 1320C Sat May 21 11:40:42 2022 temp read error at: 1440C Sat May 21 11:41:57 2022 temp read error at: 1440C Sat May 21 11:42:37 2022 temp read error at: 24.8C Sat May 21 11:43:53 2022 temp read error at: 24.7C Sat May 21 11:44:48 2022 temp read error at: 1440C Sat May 21 11:45:17 2022 temp read error at: 1440C Sat May 21 11:45:22 2022 temp read error at: 1440C Sat May 21 11:45:32 2022 temp read error at: 1380C Sat May 21 11:45:37 2022 temp read error at: 1380C Sat May 21 11:45:47 2022 pi@airiana:~/Airiana $

BeamCtrl commented 2 years ago

You may absolutly lower the baud rate, I run 19200, and as the IAM uses TCP onetime connections no high speed comm is needed, I’d estimate around 10request/s, slower is always more robust. I did anpther commit with a larger tolerance for bad temp data may save the correct samples that got reported as errors. Lets break this bug, try to lower the baudrate and lets see if we get less bad values.

overas commented 2 years ago

I found the fault. It is not a problem with IAM, Airiana server or pymodbustcp. It was the Deco M9 Plus wireless router I use as a ethernet switch to connect IAM through the wlan router ethernet port --> Deco Internet router. When I connect the IAM direct to the RJ-45 port in the wall without the Deco I do not get TCP read errors at all.

Without Deco as a switch (IAM direct to the RJ-45), here is a summery of things I have tried,

I think you can revert some of the debug code. Thank for your support and feedback .

pi@airiana:~/Airiana $ cat ./RAM/err
Using /dev/serial0
System started  Sat May 21 13:08:39 2022
Savecair unit set
/usr/lib/python3/dist-packages/numpy/core/fromnumeric.py:3372: RuntimeWarning: Mean of empty slice.
  return _methods._mean(a, axis=axis, dtype=dtype,
/usr/lib/python3/dist-packages/numpy/core/_methods.py:170: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
Traceback (most recent call last):
  File "/home/pi/Airiana/./grapher.py", line 143, in <module>
    ax.set_xlim(min(time[-day:-1]), max(time[-day:-1]))
ValueError: min() arg is an empty sequence
json-writer error []
pi@airiana:~/Airiana $

image

overas commented 2 years ago

I have a feature request. My vtr500 has Eco mode which I use from 23:00 to 06:00 to lower the temperature 3 degrees to save energy. Could this be implented in Airiana?

image

BeamCtrl commented 2 years ago

Good to hear you found the culprit. Lets keep it running a few days to be sure before I remove to much debug code. I’ll read up on eco mode to see what it does.

overas commented 2 years ago

I have one more feature request if possible. Airiana report the power W.

image

It has been nice if we could also have the unit of measurement in watt hours or kilowatt hours. I know I can use the Rieman sum integration to sum up to kWh, but if this is possible in Airiana it has been nice. https://www.home-assistant.io/integrations/integration/

BeamCtrl commented 2 years ago

done, the power consumed calc avail as printout and in json data as "electricPowerTotal" give it a spin. I will look into the other request as time is available.

overas commented 2 years ago

I think the calculation of kwh is wrong. In HA the kwh is really small.

  - platform: mqtt
    name: "Electric power total"
    state_topic: "airiana"
    unit_of_measurement: "kWh"
    state_class: "total_increasing"
    device_class: "energy"
    value_template: "{{ value_json.electricPowerTotal }}"

image

kwh from air.out "electricPowerTotal": 0.00033652760590360315}

I used a Fibaro powerplug to measure and calculate the kwh from 00:00 to 10:00. The kwh is more correct with the powerplug. image

BeamCtrl commented 2 years ago

Corrected the caculation it was wrong and note that the power unit is in Wh

overas commented 2 years ago

It is better to report the value as kWh instead of Wh and only have one decimal behind the comma.

"electricPowerTotal": 1899.71067318765 image

BeamCtrl commented 1 year ago

Completed transition to py3 for master branch, also includes user installation removing the need for root at install