sincze / Domoticz-Growatt-Webserver-Plugin

16 stars 10 forks source link

502 error and no data #2

Closed khunterh closed 4 years ago

khunterh commented 4 years ago

Hi, I've installed your plugin on domoticz running on Synology713+ an get an 502 error. I've includes the log (I only removed username) Can you help me ?

Growattlog.txt

khunterh commented 4 years ago

Additional Domoticz version V4.10717 Python Version: 3.5.1

sincze commented 4 years ago

Mmm 502 means the authentication went wrong. By accident you posted your password. As this seemed to be related with your Issue I checked with that pwd and noticed the 502 indeed. Are you sure username & password are correct?

emieldejong commented 4 years ago

I have the same issue and found out the problem. The MD5 hash they use is not a standard one. If the first character of a pair is '0', it should be changed to 'c' (as described here as well: https://github.com/sincze/Domoticz/issues/2#issuecomment-505566334) .

I tested this with curl -d "password=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&userName=xxxxxx" -H "Content-Type: application/x-www-form-urlencoded" -X POST http://server-api.growatt.com/newTwoLoginAPI.do

When I have time I'll make a pull request with a fix.

sincze commented 4 years ago

Should be fixed now with received pull request.