Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - petaflot

4
USB Infrared Toy / FAI2 error after firmware update, IR Toy is brand new
hello!

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)),
print

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?
5
Web platform / need info on uIP implementation
hey!

no need to say my eyes lit up when I found the web platform on your website (from a friend who had a buspirate, which I also got from seeed)

I would like to have a WP with the following features:
- dhcp (static DHCP with config in the server)
- hard-coded mac not a problem
- IP client and server ability (more on this below)
- ideally, use USB either for debug and/or access to the same functions provided thtough the IP interface

The aim is to include the WP as "network GPIO" within the project found here: http://david.lutolf.net/dt/locmon. to make it short, locmon aims to design a protocol to allow for auto-detection of device capability (inputs and outputs), create a layer of abstraction for these IOs and allow for auto-adaptive interfaces and easy scripting based on those IOs on a more powerful platform (typically a unix box). here, the WP would be a HAL ; GPIO refers also to sensors and devices on busses such as I²C. please not that at the time of this writing, the documentation and code available thgough the link above is not exactly up to date. things in the works are a simplification of the code and protocol, and a new client to make the IOs available on a filesystem through the FUSE python library.

for now, the locmon project uses the python tcp socket library. I would rather refrain from using telnet as I find it a little heavy and too restrictive for the planned use.

I've had a good experience with your uIP implementation yet, but have not been able to see yet the relation between the original code and your port.

I am working on this with a friend, who is quite familiar with PIC MCUs, but he's a windows guy not familiar with networking stuff. my TCP knowledge is unfortunately not "low level" enough for me to feel at home with the required code.

We would be very glad to get some clues on the steps required to work from scratch with the uIP stack (or another way to achieve what we want). in particular, can uIP's "hello world" example be used to communicate with python? of course, if somebody found it nice to work on locmon with us it would be sweet ; I am sure many hobbyists could find this very useful once the project has been taken a little further. general comments on it are welcome as well.
6
Project development, ideas, and suggestions / Re: Web Platform v2?
hey

just dropping in to link to another useful hardware, alix boards available at http://pcengines.ch. these feature:
  • CF card
  • USB 2-0 host
  • I²C on header
  • mini PCI
  • multiple ethernet ports for some of the boards
  • serial ports
  • vga, sound
  • LPT for some boards
  • fairly low power (in the 10W range)

The CPU is x86, it's easy to install linux on it. I used them for a very
simple project (reading barcode from USB, matching against a list and setting
GPIO). for the curious, info can be found here:
http://david.lutolf.net/dt/golf_imperial. If the coding was fairly
easy, I personnaly find the hardware much too overkill for it's purpose
(except maybe when wifi+WPA is needed)

my opinion on the thread? keep the WP small and light, with GPIOs, I²C, SPI,
PWM and all these things that makes µCs sweet things. this thread clearly
shows there are plenty of light-weight linux boxes out there.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01422334720session_write_close ( )...(null):0
20.01452466320ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01452467096Database_MySQL->query( ).../DatabaseHandler.php:119
40.05952605832Database_MySQL->error( ).../Db-mysql.class.php:273