Python Forum
Send raw string via socket with out any changes
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Send raw string via socket with out any changes
#12
Again, you need a bytes type, so if you hard-code the string, dont use
data = '\x01\x81\xaa\x76\x00\x5d\x44\x00\x00\x00\x00\x57\x47\x5f\...'
but use
data = b'\x01\x81\xaa\x76\x00\x5d\x44\x00\x00\x00\x00\x57\x47\x5f\...'
Now I don't know exactly what the question is. If the labeler doesn't work with your data, you could prehaps print the data before you send it to the labeler and see if it's the correct data. For example use
print('SENDING:', repr(labeler_datasend))
labeler_socket.send(labeler_datasend)
Reply


Messages In This Thread
RE: Send raw string via socket with out any changes - by Gribouillis - Jul-24-2019, 11:32 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Send data BMP180 between client and server trought module socket smalhao 0 2,884 Jul-30-2018, 12:56 PM
Last Post: smalhao
  Simple send and recive string Server/Client Epilepsy 1 2,821 May-01-2018, 08:17 PM
Last Post: ThiefOfTime

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020