How can i send 8-bit data or binary data with pyserial?

Discussion in 'Python' started by ouz as, Dec 14, 2004.

  1. ouz as

    ouz as Guest

    i have an electronic module which only understand binary data.
    i use python pyserial.
    for example the module starts when 001000000 8-bit binary data sent.but
    pyserial sent only string data.
    Can i send this binary data with pyserial or another way with python.

    Thanks,

    _________________________________________________________________
    Depolama alani sikintisindan kurtulun - hemen Hotmail'e üye olun!
    http://odeme.hotmail.com.tr
    ouz as, Dec 14, 2004
    #1
    1. Advertising

  2. > i have an electronic module which only understand binary data.
    > i use python pyserial.
    > for example the module starts when 001000000 8-bit binary data sent.but
    > pyserial sent only string data.
    > Can i send this binary data with pyserial or another way with python.


    Strings _are_ binary data. Use the module struct to convert data from more
    convenient representations (numbers) to strings, or use chr() to convert
    them yourself.

    --
    Regards,

    Diez B. Roggisch
    Diez B. Roggisch, Dec 14, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fangs
    Replies:
    3
    Views:
    9,761
    darshana
    Oct 26, 2008
  2. alastair

    pyserial with binary data

    alastair, Nov 26, 2004, in forum: Python
    Replies:
    3
    Views:
    1,426
    Grant Edwards
    Nov 30, 2004
  3. ouz as
    Replies:
    3
    Views:
    659
    Diez B. Roggisch
    Dec 13, 2004
  4. Fredrik Lundh
    Replies:
    1
    Views:
    4,026
    Scott David Daniels
    Dec 15, 2004
  5. Replies:
    12
    Views:
    564
    Richard Heathfield
    Apr 8, 2007
Loading...

Share This Page