文章目录
- H616_实现Ubuntu语音控制安卓设备刷短视频
- 小美效果展示
- H616 ubuntu系统 安装adb
- 智能公元 SU-03T 离线语音模组 固件制作
- 配合串口实现 小美_控制安卓刷抖音
 
 
 
H616_实现Ubuntu语音控制安卓设备刷短视频
注意:orangePi zero2 H616 安装系统为ubuntu
小美效果展示
语言小美
H616 ubuntu系统 安装adb
-  在 Ubuntu PC 上安装 adb 工具 
 test@test:~$ sudo apt update
 test@test:~$ sudo apt install -y adb
-  插入u口连接手机后,查看: 
 test@test:~$ adb devices
 List of devices attached
 8c00141167058911ccd device
-  然后在 Ubuntu PC 上连接网络 adb 
 // IP 地址需要修改为需控制的安卓手机IP 地址,并处于同一局域网段
 // 手机打开 开发者模式 开启adb调试
 test@test:~$ adb connect 192.168.1.xxx
- daemon not running; starting now at tcp:5037
- daemon started successfully
 connected to 192.168.1.xxx:5555
 test@test:~$ adb devices
 List of devices attached
 192.168.1.xxx:5555 device
-  拔掉u口数据线,断开与手机的有线连接; 
 如果不断开 这时u口有线连接+局域网ip连接,会有两个设备,故为方便操作,断开数据线,只保留一个设备即可;有线连接也能用,但是无线更帅一点嘛;
 test@test:~$ adb devices
 List of devices attached
 8b983433 device
 192.168.1.166:5555 device
-  然后在 Ubuntu PC 上通过 adb shell 就可以登录 android 系统 
 test@test:~$ adb shell
 huawei-p20:/ #
智能公元 SU-03T 离线语音模组 固件制作
在线官网 选择对应产品 纯离线方案制作固件并发布
 下载固件后 据工具官方文档及工具烧录固件即可
 具体制作示例(简易图形化操作即可完成固件定制):
 
 
 
配合串口实现 小美_控制安卓刷抖音
源码:
/* xiaomei shuaDouYin*/
#include <stdio.h>
#include <string.h>
#include <errno.h>
// #include <wiringPi.h>
// #include <wiringSerial.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include "uartTool.h" // 不使用wiringPi库,这里为自己封装的串口库;
// 详见往期:
//【全志H616 使用标准库 完成自制串口库(分文件实现) orangepi zero2(开源)】.md updata: 23/11/07:
// http://t.csdnimg.cn/IaKXW
int fd;
void* func1()
{
    char data[32] = {0};  
    while(1){
        memset(data,'\0',32);
        scanf("%s",data);
        //发送数据_串口
        mySerialsend (fd, data) ;     
    }
}
void* func2()
{
    char buf[32] = {0};
    while(1){
        while(mySerialread(fd,buf)){ 
        //接收数据_串口   
        printf("%s\n",buf);  
        //判断串口指令
        for(int i = 0; i < strlen(buf); i++){
            switch (buf[i]){                           
                case 'N':
                printf("next\n");
                system("adb shell input swipe 540 1300 540 500 100");
                break;
                case 'U':
                printf("up\n");
                system("adb shell input swipe 540 500 540 1300 100");
                break;
                case 'Z':
                printf("zan\n");
                system("adb shell input tap 350 1050");
                system("adb shell input tap 350 1050");
                break;
                case 'Q':
                printf("qu\n");
                system("adb shell input keyevent 26");
                break;
            }
        }
        }
    }
}
int main ()
{
    pthread_t t1,t2;
    if ((fd = mySerialOpen ("/dev/ttyS5", 115200)) < 0)
    {
        fprintf (stderr, "Unable to open serial device: %s\n", strerror (errno)) ;
        return 1 ;
    }    
    pthread_create(&t1,NULL,func1,NULL); 
    pthread_create(&t2,NULL,func2,NULL);     
    while(1){sleep(10);};    
    return 0 ;
}



















