Comments (7)
似乎是一直连不上网络,看log能收到短信,但是http请求发不出去
但是把sim卡插到手机里一切正常,这可能是什么原因呢
from air780e-forwarder.
是最新的代码吗?有没有打开低功耗模式
貌似一段时间没有网络请求的话,会出现能收到短信,但是需要重发10分钟左右才能发出去的情况。
之前更新了一下代码,每30分钟发一次请求同步时间,然后每重发5次会开关飞行模式。
from air780e-forwarder.
@0wQ 是最新版代码,没有启用低功耗,把 ipv6也 false 了,现在是无限重发失败,然后满五次之后自动重开飞行模式,继续无限重发失败
板子应该是没问题,我换了其他卡是能发出http 的
我现在怀疑是sim 卡和板子兼容性的问题,这张 sim卡插上之后一直卡 dns,似乎是直接没有连上互联网,但是收短信是没问题的,打电话也能听到炫铃
from air780e-forwarder.
刚开始我以为是 dns 解析的问题,我尝试了 1. 修改 dns 服务器,无果 2.自建了一个 api 接口,接收 post 请求,这个接口没有使用域名,直接通过 http+ip 的方式访问,还是无果
这时候意识到可能是没有连上网络。
我搜了一下相关 issue,发现这个人和我情况类似 #38
from air780e-forwarder.
他的原因是当地网络问题,访问不了cloudflare。
日志貌似看不出来什么原因,只知道没网。可以将main.lua替换成下面代码,看一下能不能请求成功
PROJECT = "test"
VERSION = "1.0.0"
log.info("main", PROJECT, VERSION)
sys = require("sys")
require "sysplus"
-- 测试 http 请求
local function test_http()
local url = "https://myip.ipip.net"
local res_code, res_headers, res_body = http.request("GET", url, nil, nil, { timeout = 20000 }).wait()
log.info("main", "http.request", "code:", res_code, "headers:", json.encode(res_headers), "body:", res_body)
return res_code
end
-- 检查网络状态
local network_codes = {
[0] = "网络未注册",
[1] = "网络已注册",
[2] = "网络搜索中",
[3] = "网络注册被拒绝",
[4] = "网络状态未知",
[5] = "网络已注册,漫游",
[6] = "网络已注册,仅SMS",
[7] = "网络已注册,漫游,仅SMS",
[8] = "网络已注册,紧急服务",
[9] = "网络已注册,非主要服务",
[10] = "网络已注册,非主要服务,漫游",
}
local function check_network()
local code = mobile.status()
log.info("main", "mobile.status", code, network_codes[code or 0] or "未知网络状态")
end
sys.taskInit(function()
-- 等待网络连接成功
sys.waitUntil("IP_READY")
for i = 1, 20, 1 do
log.info("main", string.rep("=", 30) .. i .. string.rep("=", 30))
test_http()
check_network()
sys.wait(5000)
end
end)
sys.run()
from air780e-forwarder.
[2024-04-28 23:38:03.601][000000001.263] D/mobile bearer act 0, result 0
[2024-04-28 23:38:03.604][000000001.263] D/mobile NETIF_LINK_ON -> IP_READY
[2024-04-28 23:38:03.611][000000001.265] I/user.main ==============================1==============================
[2024-04-28 23:38:04.574][000000002.273] I/DNS dns all done ,now stop
[2024-04-28 23:38:23.574][000000021.276] I/user.main http.request code: -8 headers: body: nil
[2024-04-28 23:38:23.625][000000021.279] I/user.main mobile.status 1 网络已注册
[2024-04-28 23:38:28.575][000000026.280] I/user.main ==============================2==============================
[2024-04-28 23:38:29.586][000000027.282] I/DNS dns all done ,now stop
[2024-04-28 23:38:48.590][000000046.284] I/user.main http.request code: -8 headers: body: nil
[2024-04-28 23:38:48.625][000000046.288] I/user.main mobile.status 1 网络已注册
[2024-04-28 23:38:53.591][000000051.289] I/user.main ==============================3==============================
[2024-04-28 23:38:54.592][000000052.291] I/DNS dns all done ,now stop
[2024-04-28 23:39:13.592][000000071.293] I/user.main http.request code: -8 headers: body: nil
[2024-04-28 23:39:13.627][000000071.297] I/user.main mobile.status 1 网络已注册
[2024-04-28 23:39:18.589][000000076.298] I/user.main ==============================4==============================
测试了一下似乎不太行,还是发不出去
from air780e-forwarder.
搞了一晚上实在搞不定,算了人麻了
暂时拿了一块esp32,把config改成serial + SLAVE 模式,然后通过esp32接收串口信息再发送通知了。。。先这么曲线救国吧,确实不太了解硬件开发
from air780e-forwarder.
Related Issues (20)
- 重刷rom提示缺少lbsLoc.lua文件 HOT 18
- 是否可以考虑增加pin码支持 HOT 2
- 你好,缺少lbsLoc.lua 怎么处理 HOT 2
- 你好,Air780E是支持电信卡的啊 HOT 2
- 大佬,得空是否可以考虑下国外同学的场景 HOT 2
- 消息中没有定位
- air780E 遇到待机一晚,然后接收第一条短信要等待一分钟的情况。 HOT 25
- air780epv无法获取号码 HOT 1
- push通道能否添加chanify支持? HOT 2
- 开机后没有主动同步系统时间导致钉钉加签验证失败 HOT 2
- 是否可以考虑780epv增加拨打语音电话tts朗读短信功能? HOT 3
- 使用 fskv 存储发送失败的通知 HOT 1
- IP_LOSE 引起重发 HOT 5
- 能否增加使用Telegram或其他接口实现发短信功能? HOT 1
- 彩信没有办法转发,加一个彩信转发到的功能吗? HOT 1
- 请问支持电信卡转发短信吗? HOT 2
- 建议将项目中的 Server酱 链接换成推荐链接
- 请问主从模式,一主对多从,从机通过串口转发消息,主机接受消息后转发到通知服务如何具体实现? HOT 2
- 是否支持ipv6 http服务器 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from air780e-forwarder.