2014-09-18, 21:19
I have a python script to turn my tv on and off using samsungs eslink serial control.
It works but not overly reliably. Sometimes I have to run the command multiple times to get it to respond. Then the response is not exactly reliable ether. Theres suppose to be 3 bytes returned but I get 4 to 12. If it works I get the three bytes but sometimes mixed into some other data.
Can someone tell me how I can get the command to repeate until it finds those three bytes? 030cf1 is the three bytes.
It works but not overly reliably. Sometimes I have to run the command multiple times to get it to respond. Then the response is not exactly reliable ether. Theres suppose to be 3 bytes returned but I get 4 to 12. If it works I get the three bytes but sometimes mixed into some other data.
Code:
root@livingroom:~# python tvontest.py
ada103010001a6030cf100
root@livingroom:~# python tvontest.py
00030cf100
root@livingroom:~# nano tvontest.py
root@livingroom:~# python tvontest.py
ada103010001a6030cf100
root@livingroom:~# python tvontest.py
030cf10000
root@livingroom:~# python tvontest.py
root@livingroom:~# python tvontest.py
root@livingroom:~# python tvontest.py
030cf100
root@livingroom:~# python tvontest.py
030cf100ada103010001a6ada103010001a6ada103010001
root@livingroom:~# python tvontest.py
030cf100
root@livingroom:~# python tvontest.py
00
root@livingroom:~# python tvontest.py
root@livingroom:~# python tvontest.py
030cf100
root@livingroom:~# ^C
root@livingroom:~# python tvontest.py
ada103010001a6030cf100
root@livingroom:~# python tvontest.py
00030cf100
root@livingroom:~# python tvontest.py
ada103010001a6030cf100
root@livingroom:~# python tvontest.py
00030cf100
root@livingroom:~# python tvon.py
030cff00030cf100
Can someone tell me how I can get the command to repeate until it finds those three bytes? 030cf1 is the three bytes.