Convert received data bytes in serial to hex textReading from serial port in the simplest way?Reading serial...

Why return a static pointer instead of an out parameter?

Switching interface VLAN ID Mid-Production

Would a non-attacking Barbarian's rage end the same turn he started it?

Some interesting calculation puzzle that I made

How can I effectively communicate to recruiters that a phone call is not possible?

Why do people keep referring to Leia as Princess Leia, even after the destruction of Alderaan?

Is anyone advocating the promotion of homosexuality in UK schools?

Extracting points from 3D plot that lie along an arbitrarily oriented line

Are there any medieval light sources without fire?

Is a request to book a business flight ticket for a graduate student an unreasonable one?

Managing and organizing the massively increased number of classes after switching to SOLID?

Fast validation of time windows in a routing problem

How can I get a player to accept that they should stop trying to pull stunts without thinking them through first?

The tensor product of two monoidal categories

How were Martello towers supposed to work?

If your plane is out-of-control, why does military training instruct releasing the joystick to neutralize controls?

This one's for Matthew:

Would dual wielding daggers be a viable choice for a covert bodyguard?

Does Multiverse exist in MCU?

Salt, pepper, herbs and spices

Which star / galaxy is moving away from us the fastest?

Confirming the Identity of a (Friendly) Reviewer After the Reviews

How to befriend private nested class

Sharing shapefile collection



Convert received data bytes in serial to hex text


Reading from serial port in the simplest way?Reading serial port using cat gets me nothing, but screen works?Monitoring serial port data between virtual portsRead serial data continuously and store it in a file or bufferIs cat the only reliable command that can read data from serial?Listening on the data between a process and a serial portInsert Newlines into serial stream before writing to text fileForcing a clean uninterrupted baud when receiving data via serial portsniffing serial port - jpnevulator sniffs only some bytesInterpreting serial data via bash






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















Hi now I write bytes data (for eg, x00x11x22) from my PC to serial port of my device running unix at the ttyS1 port. I am able to print the data using either



cat /dev/ttyS1
od -x < /dev/ttyS1


both works,
but with cat I get "▒▒" printed.
With od, i see some data bytes:



0000000     00fe
0000001


Which is not what i sent (001122Hex).



How can I get the correct hex display?



EDIT:
tty permission set:



stty -F /dev/ttyS1 speed 115200 cs8 -cstopb -parenb -echo time 3 min 0









share|improve this question































    0















    Hi now I write bytes data (for eg, x00x11x22) from my PC to serial port of my device running unix at the ttyS1 port. I am able to print the data using either



    cat /dev/ttyS1
    od -x < /dev/ttyS1


    both works,
    but with cat I get "▒▒" printed.
    With od, i see some data bytes:



    0000000     00fe
    0000001


    Which is not what i sent (001122Hex).



    How can I get the correct hex display?



    EDIT:
    tty permission set:



    stty -F /dev/ttyS1 speed 115200 cs8 -cstopb -parenb -echo time 3 min 0









    share|improve this question



























      0












      0








      0








      Hi now I write bytes data (for eg, x00x11x22) from my PC to serial port of my device running unix at the ttyS1 port. I am able to print the data using either



      cat /dev/ttyS1
      od -x < /dev/ttyS1


      both works,
      but with cat I get "▒▒" printed.
      With od, i see some data bytes:



      0000000     00fe
      0000001


      Which is not what i sent (001122Hex).



      How can I get the correct hex display?



      EDIT:
      tty permission set:



      stty -F /dev/ttyS1 speed 115200 cs8 -cstopb -parenb -echo time 3 min 0









      share|improve this question
















      Hi now I write bytes data (for eg, x00x11x22) from my PC to serial port of my device running unix at the ttyS1 port. I am able to print the data using either



      cat /dev/ttyS1
      od -x < /dev/ttyS1


      both works,
      but with cat I get "▒▒" printed.
      With od, i see some data bytes:



      0000000     00fe
      0000001


      Which is not what i sent (001122Hex).



      How can I get the correct hex display?



      EDIT:
      tty permission set:



      stty -F /dev/ttyS1 speed 115200 cs8 -cstopb -parenb -echo time 3 min 0






      tty serial-port busybox hex od






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 5 mins ago







      GeneCode

















      asked 42 mins ago









      GeneCodeGeneCode

      7010 bronze badges




      7010 bronze badges






















          1 Answer
          1






          active

          oldest

          votes


















          1














          od shows that you are just receiving 254 Decimal here, the left par is the "line number".



          I think the problem here is how you send the data, or your /dev/ttyS1 permissions, could you develop more on that part ?



          Also what do you see if you use xxd -r ?






          share|improve this answer
























          • Hi. I am aware that left part is "index" or "line number". what I don't get is why I get 00fe, when I am sending a "Hexadecimal packet" of value x00x11x22 from my Windows PC. Also i updated the stty that i used in my question.

            – GeneCode
            4 mins ago













          • Also, if I am sending "x00", nothing is printed by od.

            – GeneCode
            2 mins ago














          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f529315%2fconvert-received-data-bytes-in-serial-to-hex-text%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          od shows that you are just receiving 254 Decimal here, the left par is the "line number".



          I think the problem here is how you send the data, or your /dev/ttyS1 permissions, could you develop more on that part ?



          Also what do you see if you use xxd -r ?






          share|improve this answer
























          • Hi. I am aware that left part is "index" or "line number". what I don't get is why I get 00fe, when I am sending a "Hexadecimal packet" of value x00x11x22 from my Windows PC. Also i updated the stty that i used in my question.

            – GeneCode
            4 mins ago













          • Also, if I am sending "x00", nothing is printed by od.

            – GeneCode
            2 mins ago
















          1














          od shows that you are just receiving 254 Decimal here, the left par is the "line number".



          I think the problem here is how you send the data, or your /dev/ttyS1 permissions, could you develop more on that part ?



          Also what do you see if you use xxd -r ?






          share|improve this answer
























          • Hi. I am aware that left part is "index" or "line number". what I don't get is why I get 00fe, when I am sending a "Hexadecimal packet" of value x00x11x22 from my Windows PC. Also i updated the stty that i used in my question.

            – GeneCode
            4 mins ago













          • Also, if I am sending "x00", nothing is printed by od.

            – GeneCode
            2 mins ago














          1












          1








          1







          od shows that you are just receiving 254 Decimal here, the left par is the "line number".



          I think the problem here is how you send the data, or your /dev/ttyS1 permissions, could you develop more on that part ?



          Also what do you see if you use xxd -r ?






          share|improve this answer













          od shows that you are just receiving 254 Decimal here, the left par is the "line number".



          I think the problem here is how you send the data, or your /dev/ttyS1 permissions, could you develop more on that part ?



          Also what do you see if you use xxd -r ?







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 20 mins ago









          Ayato_kAyato_k

          561 bronze badge




          561 bronze badge













          • Hi. I am aware that left part is "index" or "line number". what I don't get is why I get 00fe, when I am sending a "Hexadecimal packet" of value x00x11x22 from my Windows PC. Also i updated the stty that i used in my question.

            – GeneCode
            4 mins ago













          • Also, if I am sending "x00", nothing is printed by od.

            – GeneCode
            2 mins ago



















          • Hi. I am aware that left part is "index" or "line number". what I don't get is why I get 00fe, when I am sending a "Hexadecimal packet" of value x00x11x22 from my Windows PC. Also i updated the stty that i used in my question.

            – GeneCode
            4 mins ago













          • Also, if I am sending "x00", nothing is printed by od.

            – GeneCode
            2 mins ago

















          Hi. I am aware that left part is "index" or "line number". what I don't get is why I get 00fe, when I am sending a "Hexadecimal packet" of value x00x11x22 from my Windows PC. Also i updated the stty that i used in my question.

          – GeneCode
          4 mins ago







          Hi. I am aware that left part is "index" or "line number". what I don't get is why I get 00fe, when I am sending a "Hexadecimal packet" of value x00x11x22 from my Windows PC. Also i updated the stty that i used in my question.

          – GeneCode
          4 mins ago















          Also, if I am sending "x00", nothing is printed by od.

          – GeneCode
          2 mins ago





          Also, if I am sending "x00", nothing is printed by od.

          – GeneCode
          2 mins ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • 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.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f529315%2fconvert-received-data-bytes-in-serial-to-hex-text%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Ciclooctatetraenă Vezi și | Bibliografie | Meniu de navigare637866text4148569-500570979m