# Serial Port Question

**URL:** <https://forum.inductiveautomation.com/t/serial-port-question/4813>\
**Category:** General Discussion\
**Created:** [July 13, 2012, 3:32pm UTC](https://forum.inductiveautomation.com/t/serial-port-question/4813 "2012-07-13T15:32:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikehill100](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@mikehill100](https://forum.inductiveautomation.com/u/mikehill100)\
**Post date:** [July 13, 2012, 3:32pm UTC](https://forum.inductiveautomation.com/t/serial-port-question/4813/1 "2012-07-13T15:32:59Z")

</div>

I am doing some testing with the new serial port module. It is a little function that just reads incoming data. When it is reading it translates what I am sending (a, b, hello, etc.) into the ascii characters when I use readUntil() eg. “b” would read as 98. Using the readBytes() function will read “Yg==”.

essentially:

textByte = readBytes(port2, 1)  
textUntil = readUntil(port2, “,” 0)  
system.tag.writeToTag(“Byte”, textByte) # YQ==  
system.tag.writeToTag(“Text”, textUntil) # 97

Python uses chr(“numbers”) to translate from ascii to text and there is another utility bas64.base64(“numbers”) to translate from base64. Neither of these seem to work for me, but I am new to Python and could very well be missing a step.

any suggestions?

Thanks!

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 13, 2012, 3:40pm UTC](https://forum.inductiveautomation.com/t/serial-port-question/4813/2 "2012-07-13T15:40:48Z")

</div>

I seem to have missed the question in here, I think. Are you trying to convert the byte you read into a string?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 13, 2012, 4:04pm UTC](https://forum.inductiveautomation.com/t/serial-port-question/4813/3 "2012-07-13T16:04:37Z")

</div>

Ok, actually I think I see the problem with readUntil(). I’ll have to fix this for the next release.
