# 8 bit ascii to hex

**URL:** <https://discourse.nodered.org/t/8-bit-ascii-to-hex/42369>\
**Category:** General\
**Created:** [9 March 2021 22:26 UTC](https://discourse.nodered.org/t/8-bit-ascii-to-hex/42369 "2021-03-09T22:26:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PCRover](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pcrover/32/38567_2.png) [@PCRover](https://discourse.nodered.org/u/PCRover)\
**Post date:** [9 March 2021 22:26 UTC](https://discourse.nodered.org/t/8-bit-ascii-to-hex/42369/1 "2021-03-09T22:26:58Z")

</div>

Is there a way to take an 8bit ascii serial data string (11 bytes) from a serial port and and decode it to hex values?

This conversion doesn't work as I believe it only uses 7 bits. I get mostly bad data.

data = Buffer.from(msg.payload,"ascii");

Thanks, Gary

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 March 2021 22:35 UTC](https://discourse.nodered.org/t/8-bit-ascii-to-hex/42369/2 "2021-03-09T22:35:18Z")

</div>

The buffer-parser node will help.

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [9 March 2021 23:05 UTC](https://discourse.nodered.org/t/8-bit-ascii-to-hex/42369/3 "2021-03-09T23:05:11Z")

</div>

You might look at bitunloader too, not sure but it might do the job too

---

<div class="post-metadata">

**Author:** ![PCRover](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pcrover/32/38567_2.png) [@PCRover](https://discourse.nodered.org/u/PCRover)\
**Post date:** [9 March 2021 23:20 UTC](https://discourse.nodered.org/t/8-bit-ascii-to-hex/42369/4 "2021-03-09T23:20:10Z")

</div>

Thanks for the reply's. I have it working now. Turns out to have been a serial node configuration error. Once I switched the output type to 'buffer' all was good. It was set to 'string' originally.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [23 March 2021 23:20 UTC](https://discourse.nodered.org/t/8-bit-ascii-to-hex/42369/5 "2021-03-23T23:20:29Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
