-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Esp8266 (Arduino) support #30
Comments
For this kind of project, perhaps Openhab would be a good option?
There is a binding for gree air conditioners
On 21 Jun 2020, at 19:15, Gabeki17 <[email protected]> wrote:
Hello All,
I am having a bunch of esp8266 room thermostats in my flat.
I wuld also like to make them controlling my airconditionig system.
I did a quick try on this already, but to be honest, I am not experienced enough on encrypting.
Are you able to help me doing this?
Thank you very much in advance!
All the best,
Gábor
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#30>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AIAM45OYS4SJWQCZE7ZTPGTRXY54TANCNFSM4OD6IGVQ>.
|
Thx! I think I have found your suggestion: https://github.com/jllcunha/openhab-greeair-binding I feal still quite far away, but this might helps a little! :) All the best,
|
Hi Gabor, If you want to control the AC directly from the ESP, I suggest using this library for the AES encryption: https://github.com/kakopappa/arduino-esp8266-aes-lib Unfortunately, at the moment I don't have a lightweight C++ protocol library that can run on the ESP (the current implementation uses Qt which is too heavy for this controller). Since the protocol doesn't need anything other than an encryption library and a JSON library (I prefer https://github.com/nlohmann/json which is header-only and lightweight), maybe you can try to write a simple program that communicates with the AC. I have plans to simplify the current C++ implementation to be able to compile it on the ESP, but I don't have any ETA. |
I know there is a newer version of this binding. Since i no longer have a gree air conditioner i was unable to continue working on this and i passed the code on
On 21 Jun 2020, at 19:58, Gabeki17 <[email protected]> wrote:
Thx!
I think I have found your suggestion:
https://github.com/jllcunha/openhab-greeair-binding<url>
I feal still quite far away, but this might helps a little! :)
All the best,
Gábor
For this kind of project, perhaps Openhab would be a good option? There is a binding for gree air conditioners On 21 Jun 2020, at 19:15, Gabeki17 [email protected]<mailto:[email protected]> wrote: Hello All, I am having a bunch of esp8266 room thermostats in my flat. I wuld also like to make them controlling my airconditionig system. I did a quick try on this already, but to be honest, I am not experienced enough on encrypting. Are you able to help me doing this? Thank you very much in advance! All the best, Gábor — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub<#30<#30>>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIAM45OYS4SJWQCZE7ZTPGTRXY54TANCNFSM4OD6IGVQ.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#30 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AIAM45O26LGX5E4ONLHHT4TRXZC5RANCNFSM4OD6IGVQ>.
|
Thank you! I will give it a try soon! So for example I just encryt the scan text: { and sending it as udp broadcast on port 7000? |
The scan packet must not be encrypted, but must be sent in plain text. The answer from the device(s) will contain the encrypted response which can be decoded and decrypted with the generic encryption key. If you want to send an encrypted packet to the device, the encryption should be done in this way:
For an easy to read implementation, you can check the python CLI: https://github.com/tomikaa87/gree-remote/blob/master/PythonCLI/gree.py PKCS-7 padding: https://en.wikipedia.org/wiki/Padding_(cryptography)#PKCS#5_and_PKCS#7 Padding example from the C++ library: void addPKCS7Padding(QByteArray& packBase64)
{
auto length = 16 - (packBase64.length() % 16);
packBase64.append(QByteArray(length, length));
} |
Thank you, UDP and json part was easy. My airconditioner responds nice. AES is a pain for me. I have tried the suggested lib. (Dont understand how it works exactly. I think taht is the main issue.) I am not getting the same resoult as I should. Referrence tool I have used: https://www.devglan.com/online-tools/aes-encryption-decryption Test code: AESLib aesLib; void setup() { String AES_Key = "a3K8Bx%2r8Y7#xDh"; // put your setup code here, to run once: Serial.println("AES Key: "); for (i = 0; i < sizeof(key); i++) String msg = "i hate dogs"; unsigned long ms = micros (); ///aesLib.decrypt(encMsg, key, my_iv); void loop() { }` |
I think I will not be able to fix this myself within reasonable time and without learning for days. I might hand over the encryption part to my RPI as a workaround for now (simply throwing over the messages and receiving back the encripted or decripted text) and when done I can still do the brainstorming on this. I really apprisiate all your help on this! Thank you all! :) |
The Raspberry PI as encrypter and decrypter server is funcioning already. Works perfect! The rest should not be hard. :) |
All is working now! Thank you very much! All the best, |
Hi Gábor, Thanks for the info. At the moment I have some time to test the encryption on the ESP and implement a minimal working program based on your code. Regards, |
I've began implementing the ESP8266 version, you can find the sources here: https://github.com/tomikaa87/gree-remote/tree/master/GreeESP8266 Unfortunately it can't bind to a device, yet. I'm working on it. The project uses Platform.io and it's not a regular Arduino sketch. You can easily open it via Visual Studio Code. Install the Platform.io extension. After that you must install the ESP8266 framework by following these steps:
|
Cool Thx! Unfortunately my thermostates are written in Arduino (Thousands of lines.) Also I was thinking, as I already use my RPI why not try to make use of your Python script. Also was to mention that I am really enjoying your responsiveness! All the best, |
Hi, Long time since. As I did not find any working AES ECB 128 PKCS capable library, I have started to make my own. Also the Base64 libs I have found, on github/internet, failed on the Gree generated responses some times. Because of this bad experience, I have also coded Base64. Let me know if you are interested. Afer all this, the road is cleared for an Arduinio ide based ESP8266 controler. All the best, |
That's great news! If you happen to have a repository with the working code, I can link it to the main documentation, or if you want, you can create a PR and I'll merge your solution into this repository (in that case, you should add your author info to the header of the source files). |
Hello All,
I am having a bunch of esp8266 room thermostats in my flat.
I wuld also like to make them controlling my airconditionig system.
I did a quick try on this already, but to be honest, I am not experienced enough on encrypting.
Are you able to help me doing this?
Thank you very much in advance!
All the best,
Gábor
The text was updated successfully, but these errors were encountered: