tizzen33 / domoticz-tuyacloud-plugin

Connects Domoticz to the Tuya Cloud
4 stars 2 forks source link

Current version possibly not working on Raspberry PI 4B #15

Closed heinohein closed 4 years ago

heinohein commented 4 years ago

Hello, I am trying to get tuyacloud working on a RPI4. Previously I have installed this sw on a RPI3B and with your help I got it working perfectly. On the RPI4 I have installed the os and all software from scratch. After that I copied domoticz.db from the RPI3. Just before the following errorlog I have deleted the map domoticz-tuyacloud-plugin from domoticz/plugins and after that downloaded a fresh copy. I deleted the "old" row of Tuya cloud in Setup/Hardware, created a new row, filled in my credentials and restarted domoticz. Resulting in the following Log from domoticz: 2020-08-20 14:20:31.282 (Tuya) onStop called 2020-08-20 14:20:31.279 Status: (Tuya) Stop directive received. 2020-08-20 14:20:31.279 Status: (Tuya) Exiting work loop. 2020-08-20 14:20:31.379 Status: (Tuya) Stopping threads. 2020-08-20 14:20:31.380 Status: (Tuya) Stopped. 2020-08-20 14:20:31.455 Status: Incoming connection from: 192.168.2.7 2020-08-20 14:20:43.630 Error: S0 hardware (5) thread seems to have ended unexpectedly 2020-08-20 14:20:57.632 Error: S0 hardware (5) thread seems to have ended unexpectedly 22020-08-20 14:24:01.645 Status: (tuya new) Started. 2020-08-20 14:24:02.009 Status: (tuya new) Entering work loop. 2020-08-20 14:24:02.009 Status: (tuya new) Initialized version 0.1, author 'tizzen33' 2020-08-20 14:24:02.148 Error: (tuya new) 'onStart' failed 'AttributeError':''NoneType' object has no attribute 'get''. 2020-08-20 14:24:02.148 Error: (tuya new) ----> Line 197 in '/home/pi/domoticz/plugins/domoticz-tuyacloud-plugin/plugin.py', function onStart 2020-08-20 14:24:02.148 Error: (tuya new) ----> Line 65 in '/home/pi/domoticz/plugins/domoticz-tuyacloud-plugin/plugin.py', function onStart 2020-08-20 14:24:02.148 Error: (tuya new) ----> Line 89 in '/home/pi/domoticz/plugins/domoticz-tuyacloud-plugin/plugin.py', function syncDevices 2020-08-20 14:24:12.016 Error: (tuya new) 'onHeartbeat' failed 'AttributeError':''NoneType' object has no attribute 'get''. 2020-08-20 14:24:12.016 Error: (tuya new) ----> Line 228 in '/home/pi/domoticz/plugins/domoticz-tuyacloud-plugin/plugin.py', function onHeartbeat 2020-08-20 14:24:12.016 Error: (tuya new) ----> Line 187 in '/home/pi/domoticz/plugins/domoticz-tuyacloud-plugin/plugin.py', function onHeartbeat 2020-08-20 14:24:12.016 Error: (tuya new) ----> Line 118 in '/home/pi/domoticz/plugins/domoticz-tuyacloud-plugin/plugin.py', function checkAccessToken Linux rp4 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux $PATH -bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games: Python 2.7.16 and Python 3.7.3 Domoticz : Version: 2020.2

I asume something is missing from the new installation or have you any idea what I am doing wrong? Thanks in advance Heinohein

heinohein commented 4 years ago

Sorry about the mess with the errorlog. Hope this is better new 2.txt

tizzen33 commented 4 years ago

Hi, I have the feelings you didn't fill out all parameters in the configuration. Did you select the right platform (Tuya or Smart Life)? Could you also set Debug to True? That should give me more details about where it goes wrong. Last question: do you use the same Domoticz version?

heinohein commented 4 years ago

Thank you for the quick reaction. From the attached scrprnts you can see that the paramaters in RPI3 and 4 look the same. I can not remember if I pesonally ticked on the selections of Platform and Debug in RPI4.

And NO the versions of Domoticz differ, version 4.10726(RPI3 working) versus 2020.2(RPI4 errormessages), see also attached log 2 file. Currently I leave the RPI4 as it is awaiting your investigations, therefore not introducing new variables. Can I do something else for example : Do you want me to copy the domotic map from the RPI3 to RPI4 to ensure 100%

RPI4 Domoticz log 2.txt prntscr domoticz rpi3b prntscr domoticz rpi4b

heinohein commented 4 years ago

I saw your amendment in README. I checked and "python3-dev is already the newest version (3.7.3-1)".

heinohein commented 4 years ago

I did further test. I copied the map domoticz from RPI3 to RPI4. The "old" plugin tuyacloud is working without problems, see log domoticz RPI3 version on RPI4.txt

I then removed from hardware tuyacloud and from the plugin map the total tuyacloud directory. I downloaded and installed the current plugin version (0.1) and restarted domoticz. The tuyacloud plugin now generates error messages, see log domoticz RPI3 version on RPI4 with newest tuyacloud.txt

My conclusion there seems to be a problem with the new version of tuyacloud.

tizzen33 commented 4 years ago

Hi,

I'm sorry for the late reply.

I was going to start re-working the plugin to use the full tuya API but it seems this has already been done by another developer. So I suggest you to use this plugin instead: https://github.com/guino/tuyaha

Kind regards Tizzen