apazga / smappee-domoticz-bash

Bash script to get values from Smappee hub (locally) and upload them to Domoticz
5 stars 1 forks source link

smappe problem #5

Open matteos1 opened 6 years ago

matteos1 commented 6 years ago

i've a problem a message error that not comunica with server "The server encountered an unexpected condition which prevented it from fulfilling the request

matteos1 commented 6 years ago

./smappee_plug_control.sh 0 8 {"success":"Logon successful!","header":"Logon to the monitor portal successful..."}{"errorMessage":"The server encountered an unexpected condition which prevented it from fulfilling the request"}

apazga commented 6 years ago

List your devices with ./smappee_plug_control.sh list first to see if you are using the right one.

matteos1 commented 6 years ago

I’ve seen the list with the above command, but I don’t manage to switch it on and off at the different switches. And when I give the command to switch on or off, the error message I receive is: “The server encountered an unexpected condition which prevented it from fulfilling the request.”

apazga commented 6 years ago

Can you show the list to see if is anything wrong?

Did you change the IP inside the script? By default is set to: SMAPPEE_IP="192.168.1.111"

matteos1 commented 6 years ago

Until today everything functioned well, and I installed Smappee a year ago. From today I cannot command it to switch on or off through Domoticz.

apazga commented 6 years ago

Ok, that's different. Let me check if mine is working. Maybe they updated or changed something EDIT: Mine is working, nothing has changed, yet. Did you try with another plug? Or just have one? To test if the plug is working

matteos1 commented 6 years ago

all the plug not work i have 6 plug

matteos1 commented 6 years ago

Listing available plugs Login... {"success":"Logon successful!","header":"Logon to the monitor portal successful..."}

Available plugs: [{"serialNumber":"N/A","type":"2","value":"Raspberry dietpikodi ","key":"4"},{"serialNumber":"N/A","type":"2","value":"Decoro corridoio ","key":"5"},{"serialNumber":"N/A","type":"2","value":"Raspberry plex ","key":"6"},{"serialNumber":"N/A","type":"2","value":"raspberry osmc ","key":"7"},{"serialNumber":"N/A","type":"2","value":"Pianta sotto caldaia ","key":"8"},{"serialNumber":"N/A","type":"2","value":"Luce piante ","key":"9"},{"serialNumber":"N/A","type":"2","value":"Raspberry pi3 ","key":"13"},{"serialNumber":"N/A","type":"2","value":"Box musica ","key":"14"},{"serialNumber":"N/A","type":"2","value":"Amplificazione videoproiettore ","key":"15"},{"serialNumber":"N/A","type":"2","value":"Luce sateki ","key":"16"},{"serialNumber":"N/A","type":"2","value":"Videoproiettore cameretta ","key":"17"}]

matteos1 commented 6 years ago

i meke an update to raspberry yesterday and udate this libssl-dev libssl-doc libssl1.0.2 libssl1.1 openssl

apazga commented 6 years ago

Ok, that makes sense. Update curl & libcurl too.

matteos1 commented 6 years ago

Curl is already update. Unable to locate libcurl

apazga commented 6 years ago

It may appear as libcurl3 (dpkg -l | grep curl)

matteos1 commented 6 years ago

What is the command to update libcurl in raspberry ?

matteos1 commented 6 years ago

apt-get install libcurl3 Reading package lists... Done Building dependency tree
Reading state information... Done libcurl3 is already the newest version. libcurl3 set to manually installed.

matteos1 commented 6 years ago

But not work :(

apazga commented 6 years ago

Ok, I'll try to update my libs to see if I can reproduce the issue. Tell me your operating system & kernel version: uname -a cat /etc/debian_version

matteos1 commented 6 years ago

Linux DietPi 4.4.36-v7+ #933 SMP Fri Dec 2 22:03:01 GMT 2016 armv7l GNU/Linux 8.0

matteos1 commented 6 years ago

Some news?

matteos1 commented 6 years ago

:(

matteos1 commented 6 years ago

message error {"errorMessage":"The server encountered an unexpected condition which prevented it from fulfilling the request"}

apazga commented 6 years ago

I updated everything but I can't reproduce your issue. Tell me the specific version of that packages, please. dpkg -l | grep ssl

matteos1 commented 6 years ago

ii libcurl4-openssl-dev:armhf 7.38.0-4+deb8u10 armhf development files and documentation for libcurl (OpenSSL flavour) ii libflac8:armhf 1.3.0-3 armhf Free Lossless Audio Codec - runtime C library ii libgnutls-openssl27:armhf 3.3.8-6+deb8u7 armhf GNU TLS library - OpenSSL wrapper ii libssl-dev:armhf 1.0.1t-1+deb8u8 armhf Secure Sockets Layer toolkit - development files ii libssl-doc 1.0.1t-1+deb8u8 all Secure Sockets Layer toolkit - development documentation ii libssl1.0.0:armhf 1.0.1t-1+deb8u8 armhf Secure Sockets Layer toolkit - shared libraries ii libwavpack1:armhf 4.70.0-1 armhf audio codec (lossy and lossless) - library ii openssl 1.0.1t-1+deb8u8 armhf Secure Sockets Layer toolkit - cryptographic utility ii python-openssl 0.13.1-2 armhf Python 2 wrapper around the OpenSSL library ii ssl-cert 1.0.35 all simple debconf wrapper for OpenSSL

matteos1 commented 6 years ago

​not work only for the plug. i see the other information regarding watt consume etc etc​

apazga commented 6 years ago

I saw it's a common issue with new version of libssl, so you'll have to downgrade it:

wget http://ftp.nl.debian.org/debian/pool/main/o/openssl/libssl1.0.0_1.0.2l-1~bpo8+1_armhf.deb
sudo dpkg -i libssl1.0.0_1.0.2l-1~bpo8+1_armhf.deb
matteos1 commented 6 years ago

Ok when I return at home I make this downgrade

matteos1 commented 6 years ago

And I write here if is all ok thank you

matteos1 commented 6 years ago

i make this upgrade but not work,, there is always the same error {"errorMessage":"The server encountered an unexpected condition which prevented it from fulfilling the request"}

apazga commented 6 years ago

Then, it's because of DietPi... sorry. If you can use Raspian instead, the issue will be gone.

matteos1 commented 6 years ago

do you think that this is issue is for dietpi? before this update all work ok.. now when i try to update libss there is other error message.

apazga commented 6 years ago

I tried different versions of Raspian, fully updated and is working. Something is wrong with that update, may be is just a package version, but who knows...

matteos1 commented 6 years ago

today i try to recover a copy of backup of dietpi when smappee plug work with domoticz. where can i check the error and where are stored for this script?

apazga commented 6 years ago

There is no log info, comfort plugs are so simple. You can check in your backup the library version that you have for libssl and related packages or dependencies that were updated too.

matteos1 commented 6 years ago

I know that last update of dietpi has update libssl-dev libssl-doc libssl1.0.2 libssl1.1 openssl. do you think that the problem is here?

apazga commented 6 years ago

Yes, maybe, there were many changes around SSL last months, and nothing was updated in Smappee

matteos1 commented 6 years ago

i think that if a new ssl work in rasperry than it should work in dietpi cause have same library..

matteos1 commented 6 years ago

i've restored my backup but always the same error {"success":"Logon successful!","header":"Logon to the monitor portal successful..."}{"errorMessage":"The server encountered an unexpected condition which prevented it from fulfilling the request"}

matteos1 commented 6 years ago

also on another raspberry give same error list is this but when i plug on ./smappee_plug_control.sh 1 9 {"success":"Logon successful!","header":"Logon to the monitor portal successful..."}{"errorMessage":"The server encountered an unexpected condition which prevented it from fulfilling the request"}root@raspberrypi:/home/pi/_scripts#

matteos1 commented 6 years ago

do you have this version of software of smappee ?? cause till 29/03/2018 not work

Nr of features received from acquisition engine 66890
Last software update 29/03/2018 12:15:39
Application software version and build nr 1.0.0S buildNr #1185
matteos1 commented 6 years ago

this is in var/tmp lua: /usr/local/share/lua/5.2/JSON.lua:383: html passed to JSON:decode(): Unauthorized

401 Unauthorized

stack traceback: [C]: in function 'assert' /usr/local/share/lua/5.2/JSON.lua:383: in function 'onDecodeOfHTMLError' /usr/local/share/lua/5.2/JSON.lua:655: in function 'decode' /root/domoticz_smappee/smappee.lua:45: in function 'variable_list' /root/domoticz_smappee/smappee.lua:51: in function 'idx_from_variable_name' /root/domoticz_smappee/smappee.lua:108: in function 'retrieve_Domoticz_variable' /root/domoticz_smappee/smappee.lua:251: in main chunk [C]: in ?

matteos1 commented 6 years ago

responce of smappee support Dear,

It is indeed possible that the scripts will not work anymore. This is because the new firmware #1185 has changed the communication protocol used by the Smappee and the plugs.

The older firmware used websockets as communication protocol. The protocol was highly unstable though at weak network connectivity. Therefor we have changed to an overall more stable communcation protocol: MQTT.

You will have to change your scripts so that it will be compatible with this new MQTT protocol.

I will now change the status of this ticket to "solved".

If you need further assistance, please do not hesitate to reply to this mail within 4 days. Off course you can always create a new ticket as well.

With best regards,

apazga commented 6 years ago

Oops, this is a big change. I'll try to update my Smappee, or wait for the update to update the scripts too.

matteos1 commented 6 years ago

thank you

matteos1 commented 6 years ago

Smappe support: Dear,

Our development service has not yet uploaded the documentation which explains how to use the new MQTT protocol. Once this is uploaded, it will be uploaded to the same confluence page as the dev API. For now however this is not yet available. I have forwarded the scripts to my development team. They will look at the scripts and inform me how they need to be changed to use MQTT however this is not of their usual tasks. They have informed me it could possibly take some time.

Once i have more information, i will definitely let you know.

matteos1 commented 6 years ago

sorry, do you have some news?

apazga commented 6 years ago

Nope, no update for me yet. And Smappee will have to release their documentation to know how to use it. I'll give a look and develop a new version this summer.

matteos1 commented 6 years ago

here the new specific for MQTT protocol Smappee local MQTT topics - 20180209 (1) (1).pdf MQTT broker configuration on Smappee Plus Pro (1) (2).pdf