This shows you the differences between two versions of the page.
iothings:proiecte:2022:smart-remote [2023/01/19 19:54] cristina.iordache98 [SinricPro utilization] |
iothings:proiecte:2022:smart-remote [2023/01/20 02:47] (current) cristina.iordache98 [Demo] |
||
---|---|---|---|
Line 16: | Line 16: | ||
The project has the following functionalities: | The project has the following functionalities: | ||
- | - when a command is issued through any google device (like //"Hey Google, turn on the air conditioning"//), the system will the system will execute the command on the AC device. | + | - when a command is issued through any google device (like //"Hey Google, turn on the air conditioning"//), the system will execute the command on the AC device. |
- the system will also intercept commands from the regular IR remote control and update the status in the Cloud. | - the system will also intercept commands from the regular IR remote control and update the status in the Cloud. | ||
- the mode of the AC device will be set automatically depending on the target temperature and the current temperature and humidity in the room. | - the mode of the AC device will be set automatically depending on the target temperature and the current temperature and humidity in the room. | ||
Line 65: | Line 65: | ||
- | The execution flow in diagram is presented in the diagram below. | + | The execution flow is presented in the diagram below. |
{{:iothings:proiecte:2022:software-flow-smart-remote.drawio.png?600|}} | {{:iothings:proiecte:2022:software-flow-smart-remote.drawio.png?600|}} | ||
Line 71: | Line 71: | ||
==== SinricPro utilization ==== | ==== SinricPro utilization ==== | ||
- | Sinric Pro is a web platform that enables developers to integrate IoT development boards with devices like Google Home. The API can be used to retrieve device logs, find devices, and update devices. | + | Sinric Pro is a web platform that enables developers to integrate IoT development boards with devices like Google Home. The API can be used to retrieve device logs, find devices, and update devices. For this project, SinricPro was used in order to receive commands from Google devices and send them to the ESP32 Microcontroller. |
+ | |||
+ | {{:iothings:proiecte:2022:sinricpro-web.png?700|}} | ||
+ | |||
+ | First, an account on this platform must be made. After the account is created, log in and create an device on the platform, from //Devices// tab in the left page. | ||
+ | |||
+ | {{:iothings:proiecte:2022:sinric-device-creation.png?700|}} | ||
+ | |||
+ | Here you must complete the //Device Name//, //Description// and to choose the device that is going to be controlled. There are many options, including an AC. | ||
+ | |||
+ | {{:iothings:proiecte:2022:sinric-choose-device.png?700|}} | ||
+ | |||
+ | After completing all the tabs, the device will be created and visible in the platform and a key will be generated. A key that will be used from the program to update the data in the cloud. Also after the account was create an //APP_KEY// and //APP_SECRET// are created in order to connect to the platform from the program. | ||
+ | |||
+ | #define APP_KEY "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx" | ||
+ | #define APP_SECRET "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx" | ||
+ | #define DEVICE_ID "63bafbf161ff9a367127b578" '' | ||
+ | |||
+ | |||
+ | ==== Google Home app ==== | ||
+ | |||
+ | In order to connect a Google device with SinricPro platform, download the //Google Home// application. After that, select the "+" button from the left corner and choose //Set up a device//. | ||
+ | |||
+ | {{:iothings:proiecte:2022:google-home-app1.jpeg?200|}} | ||
+ | |||
+ | |||
+ | Next choose //Works with Google// and there search for the platform //SinricPro//, in this case. | ||
+ | |||
+ | {{:iothings:proiecte:2022:google-home-app2.jpeg?200|}} | ||
+ | |||
+ | After this the connection is established. | ||
+ | |||
==== ISSUES ==== | ==== ISSUES ==== | ||
* **Working with tasks:** In initial implementation, I tried to make use of both cores available on the ESP32 Microcontroller. The flow was designed to have one core that is always listening for commands sent by Google via SInricPro and the other core was designed to receive the IR signal from the remote controller and to send the commands to the AC. Searching for a solution, implementing tasks seemed to be a good approach. For this, two task were created, each one running on different a core. Each task had a specific function, in my case //ListenToGoogle// and //RemoteController//. The core that was running //ListenToGoogle// was working correctly, but the other task had an issue. Every time a command was sent to AC, the command was not received correctly and I could not identify why. But in my opinion the problem could be because the timers that were shared by the two cores. The solution was to move all the functionality to a single core. | * **Working with tasks:** In initial implementation, I tried to make use of both cores available on the ESP32 Microcontroller. The flow was designed to have one core that is always listening for commands sent by Google via SInricPro and the other core was designed to receive the IR signal from the remote controller and to send the commands to the AC. Searching for a solution, implementing tasks seemed to be a good approach. For this, two task were created, each one running on different a core. Each task had a specific function, in my case //ListenToGoogle// and //RemoteController//. The core that was running //ListenToGoogle// was working correctly, but the other task had an issue. Every time a command was sent to AC, the command was not received correctly and I could not identify why. But in my opinion the problem could be because the timers that were shared by the two cores. The solution was to move all the functionality to a single core. | ||
Line 77: | Line 109: | ||
===== Demo ===== | ===== Demo ===== | ||
+ | [[https://drive.google.com/file/d/1P1UXjPX3kqVBHlYKMDNSrSa3bfyw2fs4/view?usp=share_link|Video File]] | ||
+ | |||
+ | ===== Conclusions ===== | ||
+ | The development of this project was interesting. Because my air conditioner is not smart, now I can control it using Google Home app and for the hot summer days this will be useful. | ||
+ | |||
+ | There are a lot of useful libraries developed that can be used in projects like these. The library that deals with the signal received and sent to the AC is up to date and has a wide coverage when it comes to air conditioner manufacturers. This project works for only one type of air conditioner but can be easily changed depending of the air conditioner type. | ||
===== Resources ===== | ===== Resources ===== | ||
Line 88: | Line 126: | ||
* https://www.electronicwings.com/arduino/ir-communication-using-arduino-uno | * https://www.electronicwings.com/arduino/ir-communication-using-arduino-uno | ||
* https://www.instructables.com/Arduino-Smart-Home-With-Alexa-Google-Assistant-Usi/ | * https://www.instructables.com/Arduino-Smart-Home-With-Alexa-Google-Assistant-Usi/ | ||
+ | * https://sinric.pro/ | ||
+ | |||
+ |