Receiving RTCM Data via NTRIP but can't translate the machincode

一笑奈何 提交于 2021-02-10 18:44:46

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!