1
USB Infrared Toy / FAI2 error after firmware update, IR Toy is brand new
I finally flashed the latest firmware on my toy, I had to wait to get my hands on a windows machine because the bootloader would not compile on my laptop. the toy had been lying around for about two months
now, when I run the test, I get FAI2 (even when pointing the toy at a white paper, glass or whatever else I could find around)
sending IR codes does not work as expected (TV channel doesn't change). maybe a dead IR LED?
I also tried to make the LED blink, and it doesn't work. I know the LED works, because it blinks on powerup. I suppose I'm missing something obvious here
firmware is USBIRToy.v1.05.hex.
Code: [Select]
#!/usr/bin/python
import serial,time
# to enable the print() function
#from __future__ import print_function
IsUsbIrToyUsed=True
COMPort='/dev/ttyUSB0' # Change this if needed :)
mySer=serial.Serial(COMPort, 9600, timeout=2)
channelUp = 'x00x29x00x29x00x29x00x28x00x52x00x29x00x2ax00x52x00x2ax00x29x00x29x00x28x00x53x00x29x00x29x00x52x00x52x00x29x00x29x00x28x00x29xffxff'
channelDown='x00x27x00x29x00x29x00x2bx00x51x00x2ax00x28x00x54x00x28x00x29x00x28x00x2bx00x51x00x2ax00x28x00x54x00x52x00x29x00x29x00x53x00x27x10x5ex00x27x00x2bx00x28x00x29x00x51x00x2bx00x27x00x54x00x29x00x29x00x28x00x2ax00x51x00x2ax00x28x00x54x00x50x00x2bx00x28x00x54x00x29xffxff'
# run this on the given string to make it appropriate for emission - maybe we
# can get good output directly? that whole function is probably ugly anyway
# s/0x0 /0x00 /g
# s/0x/\x/g
# s/ //g
def readCode():
global mySer
print "reading code"
data = mySer.readline()
for char in data:
print hex(ord(char)),
def sendCode(request):
global mySer
print "sending code"
mySer.write('x03')
mySer.write(request)
def blinkLED():
mySer.write('x12')
time.sleep(.2)
mySer.write('x13')
try:
if(IsUsbIrToyUsed):
# enter sampling mode
mySer.write('s')
if 1:
blinkLED()
sendCode(channelUp)
else:
while 1:
readCode()
mySer.flushInput()
finally:
mySer.close()
to conclude, does one of you have a smart suggestion to use read() instead of readline(), so as to avoid the 2 second delay?