2

I have a raspberry pi 3 running a python script that eventually ends up with a string of characters.

How can I pipe them to minimodem so I can transmit them?

minimodem starts transmitting with: minimodem --TX 300

I have this code :

if key_pressed==0 and key!=0:
    message_string = ''.join(message)
    print(message_string)
    p1 = subprocess.Popen(["minimodem" , "--tx" , "300"], stdin=subprocess.PIPE)
    p1.stdin.write(message_string)

And I get this error :

File "./Documents/Examples/texting.py", line 145, in main p1.stdin.write(message_string) TypeError: 'str' does not support the buffer interface

Sometimes it works and some times doesn't.

Can anybody help me?

closed as off-topic by Piotr Kula, Jacobm001, joan, Milliways, goldilocks Mar 9 '16 at 15:09

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – Jacobm001, joan, Milliways, goldilocks
If this question can be reworded to fit the rules in the help center, please edit the question.

  • This seems to have nothing to do with the Raspberry Pi. What problem are you having? What error message are you getting? – joan Feb 23 '16 at 11:23
  • i don't get an error message, it is just that there are times that is works ! and times that it doesn't. if the sting has more that 10 characters inside i will not hear a single bip from my raspberry pi. and if it goes an plays. it freezes there when everything is finished. my python level is almost ground, and don't know from where to start trouble shooting, while everything could be wrong. how can someone pipe the content of a string to minimodem in python, and how can i now that that finished so i can continue with my code. – Thanasis Valto Kourpetis Feb 23 '16 at 11:31

Browse other questions tagged or ask your own question.