Sim900 找不到网络

Sim900 Won't Find Networks

我有一个来自 Sainsmart. I have a working serial connection from my Raspberry Pi to Sim900. I can write commands, receive responses, and even query data such as my phone number from the Sim Card. My Sim Card is an AT&T card. I cannot make Sim900 find a network and attempt to connect. Supposedly, it is supposed to do it on its own, but I have not seen that either. The only two things I can think of are that either the firmware is wrong, or the chip is not getting enough power. The firmware (from AT+CGMR) is Revision:1137B06SIM900M64_ST_ENHANCE. This appears to be the latest firmware that you can get from Simcom's Site 的 Sim900。至于电源,我很确定电源是足够的,因为我买了一个充电器 usb 电缆和适配器,电缆附带的适配器承诺支持 2 安培。我剥下电缆并给它提供 3 安培的电源。当我尝试连接时,芯片也不会随机重置。我可以设置在断电时丢失的设置,但它们只会在我拔下芯片以重置设置时消失。

以下输出来自我最近的测试,试图了解为什么我无法发送短信。

----------------------------------------------------------------------------------------
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 脚本如下:

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 中 运行ning 时也会出现同样的问题。这不是 Python 特定问题。尽管在 Python 中显示来自 AT 命令 "AT+COPS=?" 的数据存在问题。然而,显示错误是另一天的问题,因为我仍然可以在 minicom 中阅读它。

编辑:澄清问题

基本上,我想知道为什么我无法发送短信以及如何解决!我确信这与未在任何网络上注册有关,但是当 运行ning "AT+COPS=?" 时没有网络显示可连接。列出任何可能的原因表示赞赏。如果需要,我可以做一些事情,比如给我的设置拍照。

编辑:为 "AT+COPS=?"

提供一些见解

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

AT+COPS=?
+COPS: (1,"Off Network","","310260"),,(0,1,4),(0,1,2)

OK

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

链接: Amazon Page Where I Bought Sim900

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

这是网络子模式列表。我的 phone 通常在 LTE 数据的顶部选项。我的 GSM 芯片使用第二个选项,显然是 GSM。我也许可以破解一个较慢的 LTE 连接,因为我仍然支持 AT&T's LTE network provides 的频段。我只需要看看破解固件的可行性。

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

这与我的 GSM 芯片看到的输出相同。这是 GSM 选项。选择关闭网络选项时,我无法呼叫任何人。

鉴于此,我要么需要找到一个支持 GSM 的运营商,破解固件以支持慢速 LTE,要么砍下我的手臂并在黑市上出售以换取昂贵的 LTE 芯片。