Hello, long time no see! It’s been about seven or eight days since my last update. Last time, I set up a Blynk server using a Xiaomi Meitu customized phone. This time, I want to explore how to enable automatic charging for a phone, and I happen to have a Xiaomi 6X at home, so I decided to put it to good use. The phone’s screen is already peeling, so I have to use a rubber band to hold it together. This time, the phone’s system version is 12.0.2, and the Aidlux version is 2.0 (the 1.4.0 version installed from the app store was incompatible). I searched online for methods to enable automatic charging on the phone and found an article.
https://blog.csdn.net/lionwerson/article/details/104494161
Coincidentally, I previously wrote a tutorial on setting up a Domoticz server on my website.
https://www.masiyu.top/index.php/2023/04/23/domoticz/
Everyone can also check out the Chinese site to learn about Domoticz IoT.
https://www.domoticz.cn/
Without further ado, SSH into Aidlux and install Domoticz with one command.
sudo curl -L install.domoticz.cn | bash
I don’t know if it’s due to the Android version or the phone being too old, but it got stuck here.Reluctantly, I had to try the Meitu customized version!
Before one-click installation, remember to upgrade the software.
sudo apt update
sudo apt upgrade
Then continue to install Domoticz.
sudo curl -L install.domoticz.cn | bash
If you see the screen below, it means you are halfway successful. At this point, press the Enter key on the keyboard.
The default HTTP port is 8080, it’s best to change it; I changed it to 7788.
Also change the HTTPS port.
The server file path can be left as default, just press Enter.
Continue pressing Enter.
Finally, if you see this screen, it means Domoticz has been successfully installed.
Due to the Aidlux system, the automatic startup of Domoticz does not work. So, how do we solve this?We can use a similar method, refer to my article on implementing Blynk IoT service automation startup: Detailed explanation of configuring systemd services and scripts on Linux.I forgot to mention a step last time; we need to install vim first.
sudo apt install vim
It is important to note that the HTTP and HTTPS ports we set during installation are also ineffective, so when executing the script, directly add the following command:
#!/bin/bash
cd /home/aidlux/domoticz
nohup ./domoticz -www 7788 -sslwww 5566 > /home/aidlux/domoticz/domo.log 2>&1 &
The other steps remain unchanged.
Finally, restart the Aidlux software and enter the phone’s IP:7788 in the computer browser.
At this point, we have successfully installed the Domoticz server on the phone.Next time, we will implement how to automatically charge the phone when the battery is low and disconnect it after charging is complete.I am Xiao Ma, an electronics enthusiast who loves tinkering. The process of tinkering allows us to temporarily forget the troubles of life. If you share the same hobby and find my article useful, please give me a like and follow! 🌹