问题
I wrote a python script that send and receives data from an NTRIP Server (RTK). But I don't know how to translate the machine code.
For example I get this:
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'
I've tried to decode it with 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()
来源:https://stackoverflow.com/questions/57622483/receiving-rtcm-data-via-ntrip-but-cant-translate-the-machincode