User Tools

Site Tools


amc:ss2024:bird_feeder:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
amc:ss2024:bird_feeder:start [2024/07/30 22:20] – [4.6 Rewriting the Display Component code from C++ to ESP-Home yaml syntax.] 31284_students.hsrwamc:ss2024:bird_feeder:start [2024/07/31 00:09] (current) – [8. References] 31284_students.hsrw
Line 39: Line 39:
 ==== 2.2 Xiao Esp32S3 ==== ==== 2.2 Xiao Esp32S3 ====
  
-  * XIAO ESP32S3 is a tiny and cool device that combines the ESP32-S3R8 processor and support for both 2.4 GHz Wi-Fi and Bluetooth 5.0. The other ones have 8 MB PSRAM, 8 MB Flash, and an external SD card slot.+  * [[https://wiki.seeedstudio.com/xiao_esp32s3_getting_started/|XIAO ESP32S3]] is a tiny and cool device that combines the ESP32-S3R8 processor and support for both 2.4 GHz Wi-Fi and Bluetooth 5.0. The other ones have 8 MB PSRAM, 8 MB Flash, and an external SD card slot.
  
 <WRAP column 20%>   </WRAP> <WRAP column 20%>   </WRAP>
Line 47: Line 47:
 <WRAP clear/> <WRAP clear/>
  
-  * It is mainly used to control the e-paper display using the XIAO eInk Expansion Board+  * It is mainly used to control the e-paper display using the [[https://wiki.seeedstudio.com/XIAO-eInk-Expansion-Board/|XIAO eInk Expansion]] Board
  
 <WRAP column 20%>   </WRAP> <WRAP column 20%>   </WRAP>
Line 266: Line 266:
 ==== 4.6 Rewriting the Display Component code from C++ to ESP-Home yaml syntax. ==== ==== 4.6 Rewriting the Display Component code from C++ to ESP-Home yaml syntax. ====
   * The ESPHome documentation proven to be the best way to fulfil this step.   * The ESPHome documentation proven to be the best way to fulfil this step.
-  * [[https://esphome.io/components/esphome.html#on-boot|ESPHome Core Configuration +    * [[https://esphome.io/components/esphome.html#on-boot|ESPHome Core Configuration 
-]], [[https://esphome.io/components/spi|SPI]], [[https://esphome.io/components/mqtt.html|MQTT]], [[https://esphome.io/components/text_sensor/index.html#on-value|text_sensor]] and [[https://esphome.io/components/display/#drawing-static-text|Display]]+]], [[https://esphome.io/components/spi|SPI]], [[https://esphome.io/components/mqtt.html|MQTT]], [[https://esphome.io/components/text_sensor/index.html#on-value|text_sensor]] and [[https://esphome.io/components/display/#drawing-static-text|Display]] were the most used pages in the documentation to reach this code. 
 +  * ESPHome Configuration: specifies the name of ESPHome project and on-boot actions.  
 +  * Configuration of ESP32 Board and Framework: In this, the ESP32 board and framework used are specified.  
 +  * Logging and API: Switches on logging and the Home Assistant API—all encrypted.  
 +  * WiFi Configuration: Provide WiFi credentials and setup fallback hotspot.  
 +  * MQTT Integration: Provide details of the MQTT broker to connect for communication.  
 +  * Display Setup: Specify your e-ink display model, pins, and update intervals.  
 +  * Text Sensor: Subscribes to MQTT topics to show messages on the e-ink display.
 <file yaml display_code.yaml> <file yaml display_code.yaml>
 esphome: esphome:
Line 410: Line 417:
 === LocalTuya integration Installation === === LocalTuya integration Installation ===
 LocalTuya integration is what we need to control the pet feeder locally. This guide was written for LocalTuya version 5.2.1. LocalTuya integration is what we need to control the pet feeder locally. This guide was written for LocalTuya version 5.2.1.
-  - On the HACS tab, click on “Integrations”. <imgcaption image10|>{{ {{ 10hacs.png }} }}</imgcaption> +  - On the HACS tab, click on “Integrations”.  
-  - Click on "Explore & Download Repositories" on the bottom right, on the pop-up search, type "LocalTuya". Click on the result. <imgcaption image11|>{{ 10ltuya.png }}</imgcaption> +<WRAP column 10%>   </WRAP> 
-  - Click on “Download” on the bottom right. Click on “Download” again on the pop-up. <imgcaption image1|>{{ 11ltuyai.png }}</imgcaption>+<WRAP column 80%> 
 +<imgcaption image10|>{{ {{ 10hacs.png }} }}</imgcaption
 +</WRAP> 
 +<WRAP clear/
 +  - Click on "Explore & Download Repositories" on the bottom right, on the pop-up search, type "LocalTuya". Click on the result.  
 + 
 +<WRAP column 10%>   </WRAP> 
 +<WRAP column 80%> 
 +<imgcaption image11|>{{ 10ltuya.png }}</imgcaption
 +</WRAP> 
 +<WRAP clear/
 +  - Click on “Download” on the bottom right. Click on “Download” again on the pop-up.  
 +<WRAP column 10%>   </WRAP> 
 +<WRAP column 80%> 
 +<imgcaption image1|>{{ 11ltuyai.png }}</imgcaption
 +</WRAP> 
 +<WRAP clear/>
 === Adding Pet Feeder to Home Assistant === === Adding Pet Feeder to Home Assistant ===
   - Download the “Tuya Smart” app to your smartphone (version 5.13.0 was used for this guide).    - Download the “Tuya Smart” app to your smartphone (version 5.13.0 was used for this guide). 
Line 461: Line 484:
  
 ==== 4.9 Creating Automation function for pet feeder to trigger on MQTT Message. ==== ==== 4.9 Creating Automation function for pet feeder to trigger on MQTT Message. ====
- +  - This step was by far the easiest in the whole process.  
 +  - In the "When" section, choose MQTT and set the topic to the one we already established in the MQTT Broker. 
 +  - In the "Then Do" section, choose the device, in our case "Pet Feeder". Choose the action already established in the previous step "Manual Feed" then set the value to be between 1-10.
 <WRAP column 5%>   </WRAP> <WRAP column 5%>   </WRAP>
 <WRAP column 90%> <WRAP column 90%>
-^  {{:amc:ss2024:bird_feeder:tuya-automations.jpeg?800}}  ^+<imgcaption tuya-auto-trigger|Pet feeder automation configuration>{{:amc:ss2024:bird_feeder:tuya-automations.jpeg?800}}</imgcaption>
 </WRAP> </WRAP>
 <WRAP clear/> <WRAP clear/>
  
 ===== 5. Results and Discussion ===== ===== 5. Results and Discussion =====
-===== 6. Obstacles ===== +  * The concept has proven to be very much viable with all the requirements fulfilled in a prototype and ready to be moved to the next steps. 
-===== 7. Key Learnings ===== +  * Using MQTT for communication between the different devices has proven simple yet efficient.  
-===== 8. References =====+  * The e-ink display was a great choice for this project due to its high visibility in daylight and power efficiency. 
 +  * To display payer information, the payload of an MQTT message can be used. 
 + 
 +===== 6. Future Steps ===== 
 +  * Build a casing for the display component to keep it protected and portable without any fear of damaging connectors. 
 +  * Further develop the design of the text/images shown on the e-ink display. 
 +  * Figure out whether the Kalisto main website can be used to integrate this whole system or not. 
 +    * If not, further development of the web-application must proceed. 
 +  * Payment can be handled using [[https://docs.stripe.com/stripe-js/react|Stripe]], a comprehensive suite of tools for handling online financial transactions. 
 +  * Payer information should be stored in a queue like structure to give a chance for the display to show all donations. 
 +===== 7. Obstacles ===== 
 +  * It was also a difficult and challenging accomplishment of the particular system architecture to ensure high level expertise with precision. 
 +    * This can be shown from the different system architecture diagrams [[amc:ss2024:bird_feeder:kalisto:system_arch|here]]. 
 +  * Finds the correct pin configuration for between the XIAO ESP-32 and the e-ink display. 
 +  * The e-ink display cable broke at some point during the implementation and testing and another display was ordered to continue with the project. 
 +  * Just before the presentation, as there was another team using a RaPi and the same Nooie Pet Feeder connected on the same network, there was a conflict between both the 2 RaPis. This was solved by changing both the hostname and the port for one of them. 
 +===== 8. Key Learnings ===== 
 +  * The different communication protocols such as SPI and I2C. 
 +  * E-ink displays and how they function. 
 +  * Home Assistant and most of its features. 
 +  * Automation and triggers 
 +  * ESPHome and how its yaml syntax works. 
 +  * MQTT, Brokers, Topics, QoS, etc. 
 +  * Networking Basics. 
 + 
 +===== 9. References ===== 
 +  * https://wiki.seeedstudio.com/xiao_esp32s3_getting_started/ 
 +  * https://wiki.seeedstudio.com/XIAO-eInk-Expansion-Board/ 
 +  * https://www.home-assistant.io/docs/ 
 +  * https://esphome.io/ 
 +  * https://www.npmjs.com/package/precompiled-mqtt
amc/ss2024/bird_feeder/start.1722370838.txt.gz · Last modified: 2024/07/30 22:20 by 31284_students.hsrw