After continuous learning, the early generation of simple smart home central control system has been completed, and the functions filled in when applying for the project have been completed, but some functions are not implemented with Wio Terminal (on the one hand, because the code volume is too large, it will give the "pressure" of Wio Terminal, on the other hand, my technology is not enough, and I need to continue to learn and find solutions).
Let me introduce my initial ideas to you
Project introduction
Wio Terminal is a highly integrated development board, which comes with an LCD display, three buttons, a five-way switch, as well as microphones, speakers, accelerometers, infrared transmitters, etc., it can even be combined with the Raspberry Pi, Jetson nano! As the "brain" of a home, these hardware are extremely practical, therefore, in the smart home control system, I choose Wio Terminal as the core of this system.
Wio Terminal is a highly integrated development board. It has a LCD, three buttons, a five-way switch, microphone, speaker, acceleration sensor, infrared transmitter, etc. it can even be combined with raspberry pie and Jetson nano. As the "brain" of a home, these hardware are very practical. Therefore, in the intelligent home central control system, I choose the Wio Terminal as the core of this system.
In the future, there should be a smart housekeeper in the house, and this smart housekeeper is a simple version of what I am doing now. With it, you will be able to get accurate and real-time data of temperature, humidity, light intensity and so on. Not only that, it's also like a "universal" remote control which can help you control your home's appliances. Of course, it should be like a smart speaker can understand our instructions, and give us a response!
. With it, you can get accurate and real-time temperature, humidity, light intensity and other data at home. Not only that, it's also like a "universal" remote control, which can help you control your home appliances. Of course, it should be able to understand the instructions we give it and respond to them like a smart speaker!
system function
- Temperature and humidity, light intensity, atmospheric pressure, combustible gas content and other data are displayed on the LCD. In order to save power, the system will display these data when the user picks it up.
- The button on the left can control the switch of the light, and the button in the middle and right can be turned on and off respectively.
- When talking to the system, he will send the user an email containing the data of temperature and humidity, light intensity, atmospheric pressure, combustible gas content, etc.
- The system will give voice feedback when the user controls the light or sends email by voice.
preparation in advance
In the process of this project, I used the development board of Wio Terminal for the first time:
Getting started guide for developers using Wio Terminal for the first time
I don't know why. I can't receive data when I use Grove - Temperature Humidity Pressure Gas Sensor on Wio Terminal, so I have to go around the corner to realize it:
Using Django to build a simple data middle platform (based on Grove - Temperature Humidity Pressure Gas Sensor)
Return to the right track and realize the main functions of data display:
Using Wio Terminal to obtain and display sensor real-time data through HTTP request
The next step is to improve the other three functions, which I mainly implement in Python
Improve system functions
I briefly mentioned the reasons why some functions are not implemented on the Wio Terminal. The specific reasons are just explained. After all, I just started to do it, so I plan to implement the functions first. As for the implementation method, I want to improve it in the second generation system
Output status through Wio Terminal
The state I want to express is to read the state of the Configurable Buttons (press the button or not) and the data of the micro phone (the data can also represent the state)
For Wio Terminal, simply outputting these data is relatively simple
Supplement the pin definition in setup():
pinMode(WIO_MIC, INPUT); pinMode(WIO_KEY_A, INPUT_PULLUP); pinMode(WIO_KEY_B, INPUT_PULLUP); pinMode(WIO_KEY_C, INPUT_PULLUP);
Add if condition statement in loop():
int val_first = analogRead(WIO_MIC); int val_next = analogRead(WIO_MIC); if (abs(val_first - val_next) >= 100){ Serial.println("send message!"); } if (digitalRead(WIO_KEY_A) == LOW) { Serial.println("A Key pressed"); } if (digitalRead(WIO_KEY_B) == LOW) { Serial.println("B Key pressed"); } if (digitalRead(WIO_KEY_C) == LOW) { Serial.println("C Key pressed"); }
When the Wio Terminal is connected to the PC, the PC will read the data of the serial port, and make corresponding actions when reading the corresponding output
So far, all the codes about Arduino are finished. Let's sort out the codes and share them with you. For the codes not mentioned in this article, please go to preparation in advance Check inside
#include <WiFiClientSecure.h> #include <ArduinoJson.h> #include"LIS3DHTR.h" #include"Free_Fonts.h" #include"TFT_eSPI.h" TFT_eSPI tft; LIS3DHTR<TwoWire> lis; WiFiClient client; const char* ssid = "Your WiFi account"; const char* password = "Your WiFi password"; const char* server = "192.168.1.102"; // Server URL String data; float accelerator_readings[3]; void setup() { //Initialize serial and wait for port to open: Serial.begin(115200); delay(100); pinMode(WIO_MIC, INPUT); pinMode(WIO_KEY_A, INPUT_PULLUP); pinMode(WIO_KEY_B, INPUT_PULLUP); pinMode(WIO_KEY_C, INPUT_PULLUP); lis.begin(Wire1); lis.setOutputDataRate(LIS3DHTR_DATARATE_25HZ); lis.setFullScaleRange(LIS3DHTR_RANGE_2G); float x_raw = lis.getAccelerationX(); float y_raw = lis.getAccelerationY(); float z_raw = lis.getAccelerationZ(); accelerator_readings[0] = x_raw; //store x-axis readings accelerator_readings[1] = y_raw; //store y-axis readings accelerator_readings[2] = z_raw; //store z-axis readings // Serial.print("Attempting to connect to SSID: "); // Serial.println(ssid); WiFi.begin(ssid, password); tft.begin(); tft.setRotation(3); tft.fillScreen(TFT_BLACK); tft.setFreeFont(FMB12); tft.setCursor((320 - tft.textWidth("Connecting to Wi-Fi.."))/2, 120); tft.print("Connecting to Wi-Fi.."); // attempt to connect to Wifi network: while (WiFi.status() != WL_CONNECTED) { // Serial.print("."); // wait 1 second for re-trying delay(1000); } // Serial.print("Connected to "); // Serial.println(ssid); tft.fillScreen(TFT_BLACK); tft.setCursor((320 - tft.textWidth("Connected!"))/2, 120); tft.print("Connected!"); getFirstData(); } void loop() { int val_first = analogRead(WIO_MIC); float x_raw = lis.getAccelerationX(); float y_raw = lis.getAccelerationY(); float z_raw = lis.getAccelerationZ(); int val_next = analogRead(WIO_MIC); if (abs(val_first - val_next) >= 100){ Serial.println("send message!"); } if (digitalRead(WIO_KEY_A) == LOW) { Serial.println("A Key pressed"); } if (digitalRead(WIO_KEY_B) == LOW) { Serial.println("B Key pressed"); } if (digitalRead(WIO_KEY_C) == LOW) { Serial.println("C Key pressed"); } if (abs(accelerator_readings[0] - x_raw) >= 0.1 && abs(accelerator_readings[1] - y_raw) >= 0.1 && abs(accelerator_readings[2] - z_raw) >= 0.1){ // Turning on the LCD backlight digitalWrite(LCD_BACKLIGHT, HIGH); getFirstData(); delay(3000); getLastData(); delay(3000); } else { // Turning off the LCD backlight digitalWrite(LCD_BACKLIGHT, LOW); delay(500); } for (uint8_t i = 0; i<3; i++){ accelerator_readings[i] = 0.0; //this is used to remove the first read variable } accelerator_readings[0] = x_raw; //store x-axis readings accelerator_readings[1] = y_raw; //store y-axis readings accelerator_readings[2] = z_raw; //store z-axis readings } void getFirstData() { // Serial.println("\nStarting connection to server..."); if (!client.connect(server, 9000)) { // Serial.println("Connection failed!"); tft.fillScreen(TFT_BLACK); tft.setCursor((320 - tft.textWidth("Connection failed!"))/2, 120); tft.print("Connection failed!"); } else { // Serial.println("Connected to server!"); // Make a HTTP request: String postRequest =(String)("GET ") + "/ HTTP/1.1\r\n" + "Connection: close\r\n\r\n"; // Serial.println(postRequest); client.print(postRequest); while (client.connected()) { String line = client.readStringUntil('\n'); if (line == "\r") { // Serial.println("headers received"); break; } } while(client.available()) { String line = client.readStringUntil('\r'); data = line; } // Serial.println(data); client.stop(); // Serial.println("closing connection"); } //ArduinoJson to parse data, plesae check ArduinoJson for more info const size_t capacity = JSON_OBJECT_SIZE(5) + 100; DynamicJsonDocument doc(capacity); deserializeJson(doc, data); float temperature = doc["temperature"]; float pressure = doc["pressure"]; float humidity = doc["humidity"]; // -----------------LCD--------------------- tft.setFreeFont(FF17); tft.setTextColor(tft.color565(224,225,232)); tft.drawString("Current Data At Home",20,10); tft.fillRoundRect(10, 45, 300, 55, 5, tft.color565(40,40,86)); tft.fillRoundRect(10, 105, 300, 55, 5, tft.color565(40,40,86)); tft.fillRoundRect(10, 165, 300, 55, 5, tft.color565(40,40,86)); tft.setFreeFont(FM9); tft.drawString("temperature:", 75, 50); tft.drawString("pressure:",75, 110); tft.drawString("humidity:",75, 170); tft.setFreeFont(FMB12); tft.setTextColor(TFT_RED); tft.drawFloat(temperature,2 , 140, 75); tft.setTextColor(tft.color565(224,225,232)); tft.drawFloat(pressure,2 , 140, 135); tft.setTextColor(TFT_GREEN); tft.drawFloat(humidity,2 , 140, 195); tft.drawString("℃", 210, 75); tft.drawString("KPa",210, 135); tft.drawString("%",210, 195); } void getLastData() { // Serial.println("\nStarting connection to server..."); if (!client.connect(server, 9000)) { // Serial.println("Connection failed!"); tft.fillScreen(TFT_BLACK); tft.setCursor((320 - tft.textWidth("Connection failed!"))/2, 120); tft.print("Connection failed!"); } else { // Serial.println("Connected to server!"); // Make a HTTP request: String postRequest =(String)("GET ") + "/ HTTP/1.1\r\n" + "Connection: close\r\n\r\n"; // Serial.println(postRequest); client.print(postRequest); while (client.connected()) { String line = client.readStringUntil('\n'); if (line == "\r") { // Serial.println("headers received"); break; } } while(client.available()) { String line = client.readStringUntil('\r'); data = line; } // Serial.println(data); client.stop(); // Serial.println("closing connection"); } //ArduinoJson to parse data, plesae check ArduinoJson for more info const size_t capacity = JSON_OBJECT_SIZE(5) + 100; DynamicJsonDocument doc(capacity); deserializeJson(doc, data); float humidity = doc["humidity"]; float gas = doc["gas"]; String updataTime = doc["updataTime"]; // -----------------LCD--------------------- tft.setFreeFont(FF17); tft.setTextColor(tft.color565(224,225,232)); tft.drawString("Current Data At Home",20,10); tft.fillRoundRect(10, 45, 300, 55, 5, tft.color565(40,40,86)); tft.fillRoundRect(10, 105, 300, 55, 5, tft.color565(40,40,86)); tft.fillRoundRect(10, 165, 300, 55, 5, tft.color565(40,40,86)); tft.setFreeFont(FM9); tft.drawString("humidity:", 75, 50); tft.drawString("gas:",75, 110); tft.drawString("updataTime:",75, 170); tft.setFreeFont(FMB12); tft.setTextColor(TFT_RED); tft.drawFloat(humidity,2 , 140, 75); tft.setTextColor(tft.color565(224,225,232)); tft.drawFloat(gas,2 , 140, 135); tft.setTextColor(TFT_GREEN); tft.drawString(updataTime , 30, 195); tft.drawString("%", 210, 75); tft.drawString("Kohms",210, 135); }
After successful upload, open the serial port monitor:
Next, let's take a look at the specific implementation of Python
Using Python to read serial data and make corresponding decisions
Add the function of saving data on the WEB side
Because I need to send e-mail, I first store the data received by the sensor in a txt text file. When I send e-mail, I can send this text file directly
stay views.py Li:
def index(request): datas = getDatas() content = { 'temperature':datas[0], 'pressure':datas[1], 'humidity':datas[2], 'gas':datas[3], 'updataTime':datas[4], } jsonData = json.dumps(content) with open("D:\TemperatureHumidityPressureGasData.txt", "w") as fp: fp.write(jsonData) return HttpResponse(jsonData)
The main changes are:
with open("D:\TemperatureHumidityPressureGasData.txt", "w") as fp: fp.write(jsonData)
The path of file storage can be modified to its own path
Open the text file to see if it can be saved successfully:
Control night light through infrared module
The small night light is bought in a treasure. It can be controlled by the remote control:
Because there is no infrared decoding function in Wio Terminal, I bought another infrared module, which is the combination of encoding and decoding. Of course, I need a USB-TTL serial converter:
In fact, the idea is very simple. Read the data sent by the corresponding key on the remote control, and then send it out with the infrared module
Decoding can use serial port debugging assistant, which is more convenient:
The serial port sends whatever it receives. When receiving, it's better to find a darker place and try several times more
Here is the data (hexadecimal) that should be sent by each key I collected:
turn on the lightLighten upsend_data = 'FD FD 30 03 53 4B 00 34 17 01 3B 02 65 00 26 00 1E 00 27 00 D9 09 26 00 8A 00 40 02 C3 17 26 00 00 00 21 00 FF FF FF FF 01 22 22 22 22 11 11 11 11 12 11 22 22 21 22 11 13 45 46 F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 76 00 22 DF DF'
Dimmingsend_data = 'FD FD 30 03 52 47 00 34 16 01 3A 02 66 00 27 00 20 00 27 00 D9 09 25 00 8A 00 41 02 00 00 21 00 FF FF FF FF FF FF FF FF 01 22 22 22 22 11 11 11 12 21 11 22 21 12 22 11 13 45 F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 76 3F 6D DF DF '
send_data = 'FD FD 30 03 53 4B 00 34 16 01 3C 02 63 00 27 00 1F 00 27 00 DA 09 25 00 8B 00 3D 02 C4 17 24 00 00 00 20 00 FF FF FF FF 01 22 22 22 22 11 11 11 12 11 11 22 21 22 22 11 13 45 46 F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 76 3F 2E DF DF '
Only two more lines are needed to send infrared:
send_data = bytes.fromhex(send_data) #Code before sending infrared_ser.write(send_data)
Send email through voice control PC
Speech is not a real speech recognition. When Wio Terminal recognizes that the environment audio signal has ups and downs, it will send "send message!" to the serial port, and the PC will send an email after reading it
When speaking, the audio signal will have obvious ups and downs:
It's not difficult to send e-mail. I encapsulated it as a method, which can be called directly at that time:
import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.header import Header def send(): # Third party SMTP service mail_host="smtp.qq.com" #Set up server mail_user="" #user name mail_pass="" #Password sender = '' receivers = [''] # Receive email, which can be set as your QQ email or other email #Create an instance with attachments message = MIMEMultipart() message['From'] = Header("Wio Terimal", 'utf-8') message['To'] = Header("Temperature and humidity, atmospheric pressure, combustible gas detection data", 'utf-8') subject = 'Current temperature and humidity, atmospheric pressure, combustible gas detection data' message['Subject'] = Header(subject, 'utf-8') #Message body content message.attach(MIMEText('Temperature and humidity, atmospheric pressure, combustible gas detection data', 'plain', 'utf-8')) # Construct the attachment and transfer the test.txt file att = MIMEText(open('D:\TemperatureHumidityPressureGasData.txt', 'rb').read(), 'base64', 'utf-8') att["Content-Type"] = 'application/octet-stream' # The filename here can be written as you like, with any name and the name displayed in the email att["Content-Disposition"] = 'attachment; filename="TemperatureHumidityPressureGasData.txt"' message.attach(att) server = smtplib.SMTP_SSL(mail_host, 465) # SMTP protocol default port is 25 server.set_debuglevel(1) server.login(mail_user, mail_pass) try: server.sendmail(sender, receivers, message.as_string()) print ("Mail sent successfully") except smtplib.SMTPException: print ("Error: Unable to send message")
Here, both the sender and the receiver can write their own email. Try sending an email to test:
Preview this txt file:
Reply to users through voice synthesis
Under Windows system, you can call the system's voice package directly:
import win32com.client speaker = win32com.client.Dispatch("SAPI.SpVoice") text = "Enter what you want to speech synthesize" speaker.Speak(text)
Let's take a look at the complete program
Complete procedure
The serial port in the code needs to be changed to its own:
- COM14 is the Wio Terminal development board
- COM15 is an infrared module
- COM19 is Seeeduino V4.2 development board
After each plug, the serial port may change. Because the USB port on the computer is not enough, I bought a USB docking station
import serial import re import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.header import Header import win32com.client speaker = win32com.client.Dispatch("SAPI.SpVoice") def send(): # Third party SMTP service mail_host="smtp.qq.com" #Set up server mail_user="2733821739@qq.com" #user name mail_pass="" #Password sender = '2733821739@qq.com' receivers = ['2733821739@qq.com'] # Receive email, which can be set as your QQ email or other email #Create an instance with attachments message = MIMEMultipart() message['From'] = Header("Wio Terimal", 'utf-8') message['To'] = Header("Temperature and humidity, atmospheric pressure, combustible gas detection data", 'utf-8') subject = 'Current temperature and humidity, atmospheric pressure, combustible gas detection data' message['Subject'] = Header(subject, 'utf-8') #Message body content message.attach(MIMEText('Temperature and humidity, atmospheric pressure, combustible gas detection data', 'plain', 'utf-8')) # Construct the attachment and transfer the test.txt file att = MIMEText(open('D:\TemperatureHumidityPressureGasData.txt', 'rb').read(), 'base64', 'utf-8') att["Content-Type"] = 'application/octet-stream' # The filename here can be written as you like, with any name and the name displayed in the email att["Content-Disposition"] = 'attachment; filename="TemperatureHumidityPressureGasData.txt"' message.attach(att) server = smtplib.SMTP_SSL(mail_host, 465) # SMTP protocol default port is 25 server.set_debuglevel(1) server.login(mail_user, mail_pass) try: server.sendmail(sender, receivers, message.as_string()) print ("Mail sent successfully") speaker = win32com.client.Dispatch("SAPI.SpVoice") text = "Message sent successfully" speaker.Speak(text) except smtplib.SMTPException: print ("Error: Unable to send message") infrared_ser = serial.Serial('COM10', 9600, timeout=0.2) Wio_terminal = serial.Serial('COM14', 115200, timeout=0.2) # Receive returned information while True: strs = Wio_terminal.readline().decode('utf-8') if strs.strip()!='': print(strs) if (re.match(r"C",strs)): send_data = 'FD FD 30 03 53 4B 00 34 17 01 3B 02 65 00 26 00 1E 00 27 00 D9 09 26 00 8A 00 40 02 C3 17 26 00 00 00 21 00 FF FF FF FF 01 22 22 22 22 11 11 11 11 12 11 22 22 21 22 11 13 45 46 F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 76 00 22 DF DF' send_data = bytes.fromhex(send_data) infrared_ser.write(send_data) text = "OK executed" speaker.Speak(text) elif (re.match(r"B",strs)): send_data = 'FD FD 30 03 52 47 00 34 16 01 3A 02 66 00 27 00 20 00 27 00 D9 09 25 00 8A 00 41 02 00 00 21 00 FF FF FF FF FF FF FF FF 01 22 22 22 22 11 11 11 12 21 11 22 21 12 22 11 13 45 F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 76 3F 6D DF DF ' send_data = bytes.fromhex(send_data) infrared_ser.write(send_data) text = "Brightness up" speaker.Speak(text) elif (re.match(r"A",strs)): send_data = 'FD FD 30 03 53 4B 00 34 16 01 3C 02 63 00 27 00 1F 00 27 00 DA 09 25 00 8B 00 3D 02 C4 17 24 00 00 00 20 00 FF FF FF FF 01 22 22 22 22 11 11 11 12 11 11 22 21 22 22 11 13 45 46 F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 76 3F 2E DF DF ' send_data = bytes.fromhex(send_data) infrared_ser.write(send_data) text = "Brightness down" speaker.Speak(text) elif (re.match(r"send",strs)): try: send() except: text = "Failed to send mail. Please try again later" speaker.Speak(text) infrared_ser.close() Wio_terminal.close()
Project presentation
Simple intelligent home central control system based on Wio Terminal
Later ideas
.