我编写了一个python脚本,用于从 NTRIP服务器(RTK) 发送和接收数据。 但是我不知道如何翻译机器代码。
例如,我明白了:
b'3E \ r \ n \ xd3 \ x008?] \ x0c \ xe5 ^; \ x834I \ x0c \ xa0 \ x01Hy \ x00 \ nDh \ x00Q \ xf6 \ xc0 \ x19 \ x10&\ x00 \ xc8〜\ xb0%\ x83 \ xfd \ x00 \ x19 \ x1f \ xf8 \ x00 \ xc9 \ x00 @ \ x06H \ r \ x01,@ x \ tb \ x05 @ 2 \ x10 \ x17 \ x19 @ \ xbaU \ xca \ r \ n'
我尝试用ascii
,utf8
,latin1
对其进行解码。
pwd = base64.b64encode("{}:{}".format(username, password).encode('ascii'))
pwd = pwd.decode('ascii')
try:
print("Header sending... \n")
header = \
"GET /{} HTTP/1.1\r\n".format(mountpoint) + \
"Host \r\n".format(server) + \
"Ntrip-Version: Ntrip/2.0\r\n" + \
"User-Agent: ntrip.py/0.1\r\n" + \
"Connection: close\r\n" + \
"Authorization: Basic {}\r\n\r\n".format(pwd)
dummyHeader = \
"Ntrip-GGA: {}\r\n".format(dummyNMEA)
print(dummyHeader)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((server, int(port)))
s.send(header.encode('ascii'))
print("Waiting answer...\n")
data = s.recv(2048).decode('ascii')
print(data)
for i in range (0, 10):
s.send(dummyHeader.encode('ascii'))
data = s.recv(1024)
print(data)
s.close()