0

I read snmp from a printer with node-red, and pass it via mqtt to an mqtt-app which uses jsonPath to parse the json.

The json is

[{"oid":"1.3.6.1.2.1.43.18.1.1.8.1.1",
 "value":
    {"type":"Buffer",
     "data":[48,49,48,45,52,50,49,58,82,101,112,108,97, 
             99,101,32,70,117,115,101,114,32,115,111,111,110,46]}}
,{"oid":.....    

By using the this expression

$[0].value.data

I get displayed

[48,49,48,45,52,50,49,58,82,101,112,108,97, 

This data is ascii, how do I get this displayed as characters?

2
  • So you would like to transform the array [48,49,48,45,52,50,49... to a corresponding string just by using a single jsonPath expression, that you'd enter in a mqtt app? Commented Dec 16, 2017 at 23:41
  • Yes, that's right. Commented Dec 17, 2017 at 0:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.