首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Sim900找不到网络

Sim900找不到网络
EN

Stack Overflow用户
提问于 2018-01-13 07:35:39
回答 1查看 1.9K关注 0票数 0

我有一份来自圣斯马特的Sim900。我有一个工作的串行连接从我的覆盆子Pi到Sim900。我可以编写命令、接收响应,甚至可以从Sim卡查询诸如我的电话号码等数据。我的Sim卡是AT&T卡。我无法让Sim900找到一个网络并尝试连接。据说,它应该自己动手,但我也没见过。我唯一能想到的两件事是,要么固件出错,要么芯片没有足够的电源。固件(来自AT+CGMR)是Revision:1137B06SIM900M64_ST_ENHANCE。这似乎是您可以从Simcom站点获得的最新固件。至于电源,我很肯定,因为我买了一个充电器usb电缆和适配器,其中适配器随电缆承诺支持2安培。我剥掉了电缆,给了它3安培的电源。当我尝试连接芯片时,芯片也不会随机重置。我可以设置在断电时丢失的设置,但只有当我拔掉芯片以重置设置时,它们才会消失。

下面的输出来自我最近的测试,试图理解为什么我不能发送短信。

代码语言:javascript
复制
----------------------------------------------------------------------------------------
Command: "b'AT\r\n\r\n'" Response: "AT


OK
"
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'AT+CMEE=2\r\n'" Response: "AT+CMEE=2

OK
"
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'AT+CFUN?\r\n'" Response: "AT+CFUN?

+CFUN: 1

OK
"
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'AT+CREG=2\r\n'" Response: "AT+CREG=2

OK
"
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'AT+CREG?\r\n'" Response: "AT+CREG?

+CREG: 2,0

OK
"
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'AT+COPS?\r\n'" Response: "AT+COPS?

+COPS: 0

OK
"
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'AT+QBAND?\r\n'" Response: "AT+QBAND?

ERROR
"
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'AT+CSQ\r\n'" Response: "AT+CSQ

+CSQ: 20,0

OK
"
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'AT+QENG?\r\n'" Response: "AT+QENG?

ERROR
"
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'AT+CIMI\r\n'" Response: "AT+CIMI

310REDACTED

OK
"
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'AT+CNUM\r\n'" Response: "AT+CNUM

+CNUM: "","1678REDACTED",129,7,4

OK
"
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'AT+CMGF=1\r\n'" Response: "AT+CMGF=1

OK
"
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'AT+CSCS=?\r\n'" Response: "AT+CSCS=?

+CSCS: ("IRA","GSM","UCS2","HEX","PCCP","PCDN","8859-1")

OK
"
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'AT+CSCS="GSM"\r\n'" Response: "AT+CSCS="GSM"

OK
"
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'AT+CREG?\r\n'" Response: "AT+CREG?

+CREG: 2,0

OK
"
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'AT+CMGS="978REDACTED"\r'" Response: "AT+CMGS="978REDACTED"

> "
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Command: "b'Pi\x1a'" Response: "Pi
+CMS ERROR: operation not allowed
"
----------------------------------------------------------------------------------------

生成此输出的Python3脚本如下所示:

代码语言:javascript
复制
import serial
import time
import binascii

ser = serial.Serial(port='/dev/serial0',baudrate=9600,timeout=1)

command = bytes("AT" + '\r\n', 'utf-8') + binascii.a2b_hex('0D0A')
ser.write(command)
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(1)

command = bytes('AT+CMEE=2'+'\r\n', 'utf-8')
ser.write(command)
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(1)

#ser.write(bytes("ATE0" + '\r\n', 'utf-8')) # Reverse it with ATE
#rcv = ser.read(1000)
#print(rcv)
#time.sleep(1)

command = bytes('AT+CFUN?'+'\r\n', 'utf-8')
ser.write(command)
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(1)

command = bytes('AT+CREG=2'+'\r\n', 'utf-8') # What does 2 do?
ser.write(command)
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(1)

command = bytes('AT+CREG?'+'\r\n', 'utf-8')
ser.write(command)
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(1)

#command = bytes('AT+COPS=?'+'\r\n', 'utf-8')
#ser.write(command)
#rcv = ser.read(1000)
#print("----------------------------------------------------------------------------------------")
#print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
#print("----------------------------------------------------------------------------------------")
#time.sleep(10)

command = bytes('AT+COPS?'+'\r\n', 'utf-8')
ser.write(command)
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(1)

#ser.write(bytes('AT+COPS=0'+'\r\n', 'utf-8'))
#rcv = ser.read(1000)
#print("\"%s\"" % rcv.decode())
#time.sleep(1)

command = bytes('AT+QBAND?'+'\r\n', 'utf-8')
ser.write(command)
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(1)

command = bytes('AT+CSQ'+'\r\n', 'utf-8')
ser.write(command)
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(1)

command = bytes('AT+QENG?'+'\r\n', 'utf-8')
ser.write(command)
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(1)

command = bytes('AT+CIMI'+'\r\n', 'utf-8')
ser.write(command)
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(1)

command = bytes('AT+CNUM'+'\r\n', 'utf-8')
ser.write(command)
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(1)

#ser.write(bytes('AT+CNMI=2,1,0,0,0'+'\r\n', 'utf-8'))
#rcv = ser.read(1000)
#print(rcv)
#time.sleep(1)

# TEXTING

command = bytes('AT+CMGF=1'+'\r\n', 'utf-8') # Select Message format as Text mode 
ser.write(command) 
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(1)

command = bytes('AT+CSCS=?'+'\r\n', 'utf-8') # Possible Value: GSM
ser.write(command) 
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(1)

command = bytes('AT+CSCS="GSM"'+'\r\n', 'utf-8') # Possible Value: (8859-1/latin-1)
ser.write(command)
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(1)

command = bytes('AT+CREG?'+'\r\n', 'utf-8')
ser.write(command)
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(1)

command = bytes('AT+CMGS="978REDACTED"', 'utf-8') + binascii.a2b_hex('0D') # 0D is CR
ser.write(command)
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(5)

command = bytes("Pi",'utf-8') + binascii.a2b_hex('1A')
ser.write(command)
rcv = ser.read(1000)
print("----------------------------------------------------------------------------------------")
print("Command: \"%s\" Response: \"%s\"" % (command, rcv.decode()))
print("----------------------------------------------------------------------------------------")
time.sleep(5)

#ser.write(binascii.a2b_hex('0D0A')) # 0D is CR
#rcv = ser.read(1000)
#print("\"%s\"" % rcv.decode())

同样,在minicom中运行时也会出现同样的问题。这不是Python特有的问题。尽管显示AT命令"AT+COPS=?“中的数据存在问题?在Python里。然而,显示错误是另一天的问题,因为我仍然可以在minicom中阅读它。

编辑:澄清问题

基本上,我想知道为什么我不能发送短信,以及如何修复它!我确信这与没有在任何网络上注册有关,但是在运行"AT+COPS=?“时没有出现连接到的网络。列出任何潜在的原因将不胜感激。如果需要的话,我可以为我的设置拍照。

编辑:提供一些关于"AT+COPS=?“的见解。

使用Minicom,我可以得到"AT+COPS=?“的以下结果。我不能在Python 3中测试这个命令,因为它使来自自身的反馈和其他所有未来的命令都是空的,比如空引号(例如"")。即使启用了CMEE来提供详细的文本,也是一个问题。当我重置Python程序时,这会被重置。

代码语言:javascript
复制
AT+COPS=?
+COPS: (1,"Off Network","","310260"),,(0,1,4),(0,1,2)

OK

每次运行命令时都会得到上述结果,无论我将CREG设置为什么。

链接:我购买Sim900的亚马逊网页

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-01-14 04:47:26

事实证明,我的代码或硬件都没有问题。这是我的网络提供商AT&T的一个问题,现在,我知道他们已经摆脱了2G,但我没有意识到这也意味着电话和短信。因为我忘记了电话和短信不是单独的协议。因为,我在我的手机上输入这个,我只会用截图来显示我的意思。

这是一个网络子模式列表。我的手机通常是LTE数据的首选选项。我的GSM芯片使用的是第二种选择,显然是GSM。我可能能够破解一个较慢的LTE连接,因为我仍然支持的乐队,AT&T的LTE网络提供。我只需要看看破解固件是多么的可行。

这就是我的LTE网络列表在扫描时的样子(本质上是AT+COPS=?):

这是我的GSM芯片看到的相同的输出。这是GSM的选项。当选择关闭网络选项时,我不能打电话给任何人。

考虑到这一点,我要么需要找到一家支持GSM的运营商,要么将固件合并起来支持慢LTE,要么砍掉我的手臂,在黑市上卖给一个昂贵的LTE芯片。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48237875

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档