相关文章推荐
冲动的弓箭  ·  解决报错 ...·  4 天前    · 
坚韧的竹笋  ·  在visual studio linux ...·  4 天前    · 
追风的炒粉  ·  portError: ...·  21 小时前    · 
爱逃课的小狗  ·  error c2872: “byte”: ...·  4 月前    · 
开朗的山楂  ·  Android 自定义SeekBar ...·  1 年前    · 
彷徨的铁链  ·  swift或OC中NSURLConnecti ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I am currently trying to parse data from a Linux server via ssh to another device.

I'm trying to parse some AT+QCFG commands, but I am getting "Failed to parse message data".

My command looks like this.:

ssh user@host ubus call modem at_cmd '{"cmd":"AT+QCFG=\"nwscanmode\""}'|grep scan 

I hope that someone in here have experience with these types of commands.

I am very thankful for any help I can get.

Best regards

You want the python tool run on the distant host to receive the {"cmd":"AT+QCFG=\"nwscanmode\""} JSON data.

This means you want the distant host to run a command with the '{"cmd":"AT+QCFG=\"nwscanmode\""}' argument, where enclosing in single quotes avoid interpretation of the double-quotes or escape sequences.

This means you want to run your ssh command with "'{\"cmd\":\"AT+QCFG=\\\"nwscanmode\\\"\"}'" or \''{"cmd":"AT+QCFG=\"nwscanmode\""}'\' as argument, both of which will be interpreted by your local machine into the string you want the distant host to run.

You will probably want to search for another way to specify this configuration; maybe you can transmit the JSON data as a file first then refer to this file in the command you'll run through ssh?

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.