20250609在荣品的PRO-RK3566开发板的Android13下解决串口可以执行命令但是脚本执行命令异常的问题

20250609在荣品的PRO-RK3566开发板的Android13下解决串口可以执行命令但是脚本执行命令异常的问题
2025/6/9 20:54


缘起,为了跨网段推流,千辛万苦配置好了网络参数。
但是命令iptables -t filter -F tetherctrl_FORWARD可以在调试串口/DEBUG口正确执行。
一添加到自启动脚本中就出现各种异常!

/vendor/bin/autostart_test.sh


网络配置如下:
RK3566配置路由使D能PING通A
A:192.169.144.119
B:192.168.144.55
C:192.168.43.1
D:192.168.43.33

设备A和B是图传,在同一个网段,可以互相PING通。
【B和C】都接在RK3566【Android13】上。
C通过AP6256虚拟成为softAP。
D为笔记本电脑,通过softAP/以太网络共享接到C上。

现在,想让D来PING通A,改如何配置RK3566的路由表?

A的网关配置为B,D的网关配置为C。softAP通了。
但是以太网不通。
经过专家诊断:
需要执行:
iptables -t filter -F tetherctrl_FORWARD

至于执行:iptables -t filter -F tetherctrl_FORWARD的效果,

通过命令 iptables -t filter -L 可以查询到,
清除了网络规则:tetherctrl_FORWARD


经过艰难调试,后来怀疑是在shell脚本中需要使用完整的路径。
【偶然的原因,在init.rc中,发现别人都是使用完整的路径的^_】
搞定/办结问题!


【autostart_test.sh】
#!/vendor/bin/sh
echo "Forlinx::::::::::::::::::GNSS_CONFIG start!" > /dev/ttyFIQ0
echo "This is a test" > /dev/ttyFIQ0
echo $(date) > /data/date.txt
echo "Forlinx::::::::::::::::::GNSS_CONFIG end!" > /dev/ttyFIQ0
#/system/bin/rk3566_android_serial
sleep 180
/system/bin/iptables -t filter -F tetherctrl_FORWARD

/system/bin/uart2tcp


完整的LOG:

执行前:
Microsoft Windows [版本 10.0.19045.5737]
(c) Microsoft Corporation。保留所有权利。

C:\Users\QQ>adb shell
rk3566_t:/ $ su
rk3566_t:/ #
rk3566_t:/ # iptables -t filter -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
bw_INPUT   all  --  anywhere             anywhere
fw_INPUT   all  --  anywhere             anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
oem_fwd    all  --  anywhere             anywhere
fw_FORWARD  all  --  anywhere             anywhere
bw_FORWARD  all  --  anywhere             anywhere
tetherctrl_FORWARD  all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
oem_out    all  --  anywhere             anywhere
fw_OUTPUT  all  --  anywhere             anywhere
st_OUTPUT  all  --  anywhere             anywhere
bw_OUTPUT  all  --  anywhere             anywhere

Chain bw_FORWARD (1 references)
target     prot opt source               destination

Chain bw_INPUT (1 references)
target     prot opt source               destination
bw_global_alert  all  --  anywhere             anywhere
RETURN     esp  --  anywhere             anywhere
RETURN     all  --  anywhere             anywhere             mark match 0x100000/0x100000
MARK       all  --  anywhere             anywhere             MARK or 0x100000

Chain bw_OUTPUT (1 references)
target     prot opt source               destination
bw_global_alert  all  --  anywhere             anywhere

Chain bw_costly_shared (0 references)
target     prot opt source               destination
bw_penalty_box  all  --  anywhere             anywhere

Chain bw_data_saver (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

Chain bw_global_alert (2 references)
target     prot opt source               destination
           all  --  anywhere             anywhere             ! quota globalAlert: 2097152 bytes

Chain bw_happy_box (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere            match bpf pinned /sys/fs/bpf/netd_shared/prog_netd_skfilter_allowlist_xtbpf
bw_data_saver  all  --  anywhere             anywhere

Chain bw_penalty_box (1 references)
target     prot opt source               destination
REJECT     all  --  anywhere             anywhere            match bpf pinned /sys/fs/bpf/netd_shared/prog_netd_skfilter_denylist_xtbpf reject-with icmp-port-unreachable
bw_happy_box  all  --  anywhere             anywhere

Chain fw_FORWARD (1 references)
target     prot opt source               destination

Chain fw_INPUT (1 references)
target     prot opt source               destination

Chain fw_OUTPUT (1 references)
target     prot opt source               destination

Chain oem_fwd (1 references)
target     prot opt source               destination

Chain oem_out (1 references)
target     prot opt source               destination

Chain st_OUTPUT (1 references)
target     prot opt source               destination

Chain st_clear_caught (2 references)
target     prot opt source               destination

Chain st_clear_detect (0 references)
target     prot opt source               destination
REJECT     all  --  anywhere             anywhere             connmark match  0x2000000/0x2000000 reject-with icmp-port-unreachable
RETURN     all  --  anywhere             anywhere             connmark match  0x1000000/0x1000000
CONNMARK   tcp  --  anywhere             anywhere             u32 "0x0>>0x16&0x3c@0xc>>0x1a&0x3c@0x0&0xffff0000=0x16030000&&0x0>>0x16&0x3c@0xc>>0x1a&0x3c@0x4&0xff0000=0x10000" CONNMARK or 0x1000000
CONNMARK   udp  --  anywhere             anywhere             u32 "0x0>>0x16&0x3c@0x8&0xffff0000=0x16fe0000&&0x0>>0x16&0x3c@0x14&0xff0000=0x10000" CONNMARK or 0x1000000
RETURN     all  --  anywhere             anywhere             connmark match  0x1000000/0x1000000
st_clear_caught  tcp  --  anywhere             anywhere             state ESTABLISHED u32 "0x0>>0x16&0x3c@0xc>>0x1a&0x3c@0x0&0x0=0x0"
st_clear_caught  udp  --  anywhere             anywhere

Chain st_penalty_log (0 references)
target     prot opt source               destination
CONNMARK   all  --  anywhere             anywhere             CONNMARK or 0x1000000
NFLOG      all  --  anywhere             anywhere

Chain st_penalty_reject (0 references)
target     prot opt source               destination
CONNMARK   all  --  anywhere             anywhere             CONNMARK or 0x2000000
NFLOG      all  --  anywhere             anywhere
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable

Chain tetherctrl_FORWARD (1 references)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere

Chain tetherctrl_counters (0 references)
target     prot opt source               destination
rk3566_t:/ # iptables -t filter -L


执行后:
Microsoft Windows [版本 10.0.19045.5737]
(c) Microsoft Corporation。保留所有权利。

C:\Users\QQ>adb shell
rk3566_t:/ $ su
rk3566_t:/ #
rk3566_t:/ # iptables -t filter -F tetherctrl_FORWARD
rk3566_t:/ # iptables -t filter -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
bw_INPUT   all  --  anywhere             anywhere
fw_INPUT   all  --  anywhere             anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
oem_fwd    all  --  anywhere             anywhere
fw_FORWARD  all  --  anywhere             anywhere
bw_FORWARD  all  --  anywhere             anywhere
tetherctrl_FORWARD  all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
oem_out    all  --  anywhere             anywhere
fw_OUTPUT  all  --  anywhere             anywhere
st_OUTPUT  all  --  anywhere             anywhere
bw_OUTPUT  all  --  anywhere             anywhere

Chain bw_FORWARD (1 references)
target     prot opt source               destination

Chain bw_INPUT (1 references)
target     prot opt source               destination
bw_global_alert  all  --  anywhere             anywhere
RETURN     esp  --  anywhere             anywhere
RETURN     all  --  anywhere             anywhere             mark match 0x100000/0x100000
MARK       all  --  anywhere             anywhere             MARK or 0x100000

Chain bw_OUTPUT (1 references)
target     prot opt source               destination
bw_global_alert  all  --  anywhere             anywhere

Chain bw_costly_shared (0 references)
target     prot opt source               destination
bw_penalty_box  all  --  anywhere             anywhere

Chain bw_data_saver (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

Chain bw_global_alert (2 references)
target     prot opt source               destination
           all  --  anywhere             anywhere             ! quota globalAlert: 2097152 bytes

Chain bw_happy_box (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere            match bpf pinned /sys/fs/bpf/netd_shared/prog_netd_skfilter_allowlist_xtbpf
bw_data_saver  all  --  anywhere             anywhere

Chain bw_penalty_box (1 references)
target     prot opt source               destination
REJECT     all  --  anywhere             anywhere            match bpf pinned /sys/fs/bpf/netd_shared/prog_netd_skfilter_denylist_xtbpf reject-with icmp-port-unreachable
bw_happy_box  all  --  anywhere             anywhere

Chain fw_FORWARD (1 references)
target     prot opt source               destination

Chain fw_INPUT (1 references)
target     prot opt source               destination

Chain fw_OUTPUT (1 references)
target     prot opt source               destination

Chain oem_fwd (1 references)
target     prot opt source               destination

Chain oem_out (1 references)
target     prot opt source               destination

Chain st_OUTPUT (1 references)
target     prot opt source               destination

Chain st_clear_caught (2 references)
target     prot opt source               destination

Chain st_clear_detect (0 references)
target     prot opt source               destination
REJECT     all  --  anywhere             anywhere             connmark match  0x2000000/0x2000000 reject-with icmp-port-unreachable
RETURN     all  --  anywhere             anywhere             connmark match  0x1000000/0x1000000
CONNMARK   tcp  --  anywhere             anywhere             u32 "0x0>>0x16&0x3c@0xc>>0x1a&0x3c@0x0&0xffff0000=0x16030000&&0x0>>0x16&0x3c@0xc>>0x1a&0x3c@0x4&0xff0000=0x10000" CONNMARK or 0x1000000
CONNMARK   udp  --  anywhere             anywhere             u32 "0x0>>0x16&0x3c@0x8&0xffff0000=0x16fe0000&&0x0>>0x16&0x3c@0x14&0xff0000=0x10000" CONNMARK or 0x1000000
RETURN     all  --  anywhere             anywhere             connmark match  0x1000000/0x1000000
st_clear_caught  tcp  --  anywhere             anywhere             state ESTABLISHED u32 "0x0>>0x16&0x3c@0xc>>0x1a&0x3c@0x0&0x0=0x0"
st_clear_caught  udp  --  anywhere             anywhere

Chain st_penalty_log (0 references)
target     prot opt source               destination
CONNMARK   all  --  anywhere             anywhere             CONNMARK or 0x1000000
NFLOG      all  --  anywhere             anywhere

Chain st_penalty_reject (0 references)
target     prot opt source               destination
CONNMARK   all  --  anywhere             anywhere             CONNMARK or 0x2000000
NFLOG      all  --  anywhere             anywhere
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable

Chain tetherctrl_FORWARD (1 references)
target     prot opt source               destination

Chain tetherctrl_counters (0 references)
target     prot opt source               destination
rk3566_t:/ # iptables -t filter -L


 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.pswp.cn/pingmian/84211.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【C/C++】高效的位操作

位运算(Bitwise Operation)是直接对整数的二进制位进行操作的运算方式,在底层开发、性能优化、算法设计中广泛使用。 1 基本位运算符及含义 运算符名称示例(a5, b3)运算过程(二进制)结果&按…

后端下载限速(redis记录实时并发,bucket4j动态限速)

✅ 使用 Redis 记录 所有用户的实时并发下载数✅ 使用 Bucket4j 实现 全局下载速率限制(动态)✅ 支持 动态调整限速策略✅ 下载接口安全、稳定、可监控 🧩 整体架构概览 模块功能Redis存储全局并发数和带宽令牌桶状态Bucket4j Redis分布式限…

android app 一个 crash的解决过程!

一、日志: crash 2024-10-25 12:15:33.020 2113-2113 AndroidRuntime pid-2113 E FATAL EXCEPTION: main Process: com..workhome, PID: 2113 java.lang.RuntimeException: Unable to start activity ComponentInfo{com..w…

[Java 基础]Object 类

java.lang.Object 是 Java 所有类的直接或间接父类,Java 中每个类都默认继承 Object 类(即使你没写 extends Object)。 Object 中的常用方法: 方法名功能简介toString()返回对象的字符串表示equals(Object)判断两个对象是否“逻…

大数据学习(135)-Linux系统性指令

🍋🍋大数据学习🍋🍋 🔥系列专栏: 👑哲学语录: 用力所能及,改变世界。 💖如果觉得博主的文章还不错的话,请点赞👍收藏⭐️留言📝支持一…

【Fifty Project - D35】

今日完成记录 TimePlan完成情况7:00 - 7:40爬坡√8:30 - 11:30Rabbit MQ√17:30 - 18:30羽毛球√ RabbitMQ 消费者端如何保证可靠性? 消息投递过程出现网络故障消费者接收到消息但是突然宕机…

P3 QT项目----记事本(3.4)

3.4 文件选择对话框 QFileDialog 3.4.1 QFileDialog 开发流程 使用 QFileDialog 的基本步骤通常如下: 实例化 :首先,创建一个 QFileDialog 对象的实例。 QFileDialog qFileDialog;设置模式 :根据需要设置对话框的模式&…

学习笔记(26):线性代数-张量的降维求和,简单示例

学习笔记(26):线性代数-张量的降维求和,简单示例 1.先理解 “轴(Axis)” 的含义 张量的 “轴” 可以理解为 维度的方向索引 。对于形状为 (2, 3, 4) 的张量,3 个轴的含义是: 轴 0(axis0&…

健康档案实训室:构建全周期健康管理的数据基石

一、健康档案实训室建设背景 随着“健康中国2030”战略深入推进,健康档案作为居民健康数据的核心载体,在疾病预防、慢性病管理、医疗决策等领域的价值日益凸显。在此背景下,健康档案实训室建设成为职业院校对接政策要求、培养专业健康管理…

【MATLAB第119期】基于MATLAB的KRR多输入多输出全局敏感性分析模型运用(无目标函数,考虑代理模型)

【MATLAB第119期】基于MATLAB的KRR多输入多输出全局敏感性分析模型运用(无目标函数,考虑代理模型) 下一期研究SHAP的多输入多输出敏感性分析方法 一、SOBOL(无目标函数) (1)针对简单线性数据…

Linux常用文件目录命令

浏览目录命令: ls 、pwd目录操作命令:cd、mkdir、rmdir浏览文件命令:cat、more、less、head、tail文件操作命令:cp、rm、mv、find、grep、tar 浏览目录命令 ls ◼ 命令名称:ls ◼ 命令英文原意:list ◼ …

PIN码vs密码,电脑登录的快捷键你用对了吗?

你是否也遇到过这样的窘境:信心满满地输入电脑开机密码,屏幕却无情地提示“密码错误”。仔细一看,才发现登录界面悄悄地变成了要求输入“PIN码”。这种因为混淆了PIN码和账户密码而导致的开机失败,相信不少朋友都碰到过。 PIN码作…

【大模型科普】AIGC技术发展与应用实践(一文读懂AIGC)

【作者主页】Francek Chen 【专栏介绍】 ⌈ ⌈ ⌈人工智能与大模型应用 ⌋ ⌋ ⌋ 人工智能(AI)通过算法模拟人类智能,利用机器学习、深度学习等技术驱动医疗、金融等领域的智能化。大模型是千亿参数的深度神经网络(如ChatGPT&…

Spring是如何解决Bean的循环依赖:三级缓存机制

1、什么是 Bean 的循环依赖 在 Spring框架中,Bean 的循环依赖是指多个 Bean 之间‌互相持有对方引用‌,形成闭环依赖关系的现象。 多个 Bean 的依赖关系构成环形链路,例如: 双向依赖:Bean A 依赖 Bean B,同时 Bean B 也依赖 Bean A(A↔B)。链条循环: Bean A → Bean…

XXE漏洞知识

目录 1.XXE简介与危害 XML概念 XML与HTML的区别 1.pom.xml 主要作用 2.web.xml 3.mybatis 2.XXE概念与危害 案例:文件读取(需要Apache >5.4版本) 案例:内网探测(鸡肋) 案例:执行命…

02-性能方案设计

需求分析与测试设计 根据具体的性能测试需求,确定测试类型,以及压测的模块(web/mysql/redis/系统整体)前期要与相关人员充分沟通,初步确定压测方案及具体的性能指标QA完成性能测试设计后,需产出测试方案文档发送邮件到项目组&…

STL优先级队列的比较函数与大堆小堆的关系

STL中的priority_queue&#xff08;优先级队列&#xff09;通过比较函数来确定元素的优先级顺序&#xff0c;从而决定其内部是形成大堆还是小堆。以下是关键点总结&#xff1a; 默认行为与大堆&#xff1a; 默认情况下&#xff0c;priority_queue使用std::less<T>作为比较…

React---day11

14.4 react-redux第三方库 提供connect、thunk之类的函数 以获取一个banner数据为例子 store&#xff1a; 我们在使用异步的时候理应是要使用中间件的&#xff0c;但是configureStore 已经自动集成了 redux-thunk&#xff0c;注意action里面要返回函数 import { configureS…

OD 算法题 B卷【反转每对括号间的子串】

文章目录 反转每对括号间的子串 反转每对括号间的子串 给出一个字符串s&#xff0c; 仅含有小写英文字母和英文括号’(’ ‘)’&#xff1b;按照从括号内到外的顺序&#xff0c;逐层反转每对括号中的字符串&#xff0c;并返回最终的结果&#xff1b;结果中不能包含任何括号&am…

如何做好一份技术文档?从规划到实践的完整指南

如何做好一份技术文档&#xff1f;从规划到实践的完整指南 &#x1f31f; 嗨&#xff0c;我是IRpickstars&#xff01; &#x1f30c; 总有一行代码&#xff0c;能点亮万千星辰。 &#x1f50d; 在技术的宇宙中&#xff0c;我愿做永不停歇的探索者。 ✨ 用代码丈量世界&…