Skip to main content

Show Posts

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

Messages - yaywoop

1
USB Infrared Toy / Re: Record and playback under Linux
Thanks Rct, that definitely sheds some light.
and I was thinking the same thing, we should find another way to get user input for ending the program. the canonical mode is much neater to deal with
so we want to read the input buffer, and continue if there is nothing. i just did a search but didnt find much. any ideas?
2
USB Infrared Toy / Re: Record and playback under Linux
so how does it work currently?
is this what your working with? from what i can follow it appears like it should behave like kbhit..
Code: [Select]
int kbhit()
{

  char ch;
  int nread;

  if(peek != -1) return 1;
  new.c_cc[VMIN]=0;
  tcsetattr(0, TCSANOW, &new);
  nread = read(0,&ch,1);
  new.c_cc[VMIN]=1;
  tcsetattr(0, TCSANOW, &new);

  if(nread == 1) {
   peek = ch;
   return 1;
  }

  return 0;
}
3
USB Infrared Toy / Re: Record and playback under Linux
oh yeah. he said them meaning linux users. ok

Anyway some progress on the freezing terminal issue.
I was following the program through with no options, it pretty much runs print_usage and quits, but this one bit of code runs before that
Code: [Select]
	#ifndef _WIN32
//just to get the display need required on linux
  tcgetattr(0, &orig);
  new = orig;
  new.c_lflag &= ~ICANON;
  new.c_lflag &= ~ECHO;
  new.c_lflag &= ~ISIG;
  new.c_cc[VMIN] = 1;
  new.c_cc[VTIME] = 0;
  tcsetattr(0, TCSANOW, &new);

#endif
commenting out the line "tcsetattr(0, TCSANOW, &new);" stops the unresponsive terminal behaviour..
so.. what does that section of code do? and why does it make the terminal freeze?

I dont have a great understanding of classes and objects, so keep that in mind when explaining :)

edit: reading through the termios man page now. im guessing it was implemented to detect keypresses? ie, in place of kbhit

edit2, the problem is not freezing as I thought it was originally. the terminal simply seems to have been reconfigured by the terminos mumbojumbo. in fact what happens is any keypresses are not printed on screen, but still get executed if return is pressed.. and the line-end from pressing return is not printed either.
interesting.  from the man page there is an ECHO value in the local mode flag. if i set this to true everything seems to run as normal :) it was set to false in the above code fragment
I suppose if we dont want keypresses echoed while the program is running we should set it to false, then set it to true as the program exits..
so now it sorta works.. the "kbhit" behaviour is still not quite right, seems to take a long time to recognise a key hit. I'll play around with it a bit. also found this, which seems to be basically whats implemented in the irtoy code http://cboard.cprogramming.com/faq-boar ... -unix.html
4
USB Infrared Toy / Re: Record and playback under Linux
yes, please post what your working on. I'd love to help. and have hardware to test it with
in fact I plan to put a irtoy into my linux mythtv system to tun on the TV and amp and receive IR commands.

I got v0.5 compiled under code:base 10.05 as mentioned before, but had the strange freezes, have you encountered this?
you mentioned sleep and kbhit, are these windows system functions?
Where are you at so far? got it compiling and running properly? as I said, changing a few lines got v0.5 compiled and it does work with the hardware before freezing up the terminal

Quote
I must admit,  i am not a linux user so I must relay on them to make better bug free apps for linux.
who is "them" btw?
5
USB Infrared Toy / Re: Record and playback under Linux
actually it was 0.5 i was playing with, not 0.4.
has it been compiled under linux before? if so, what compiler? im using g++
it looks like the code has two parts which are selected by ifdef's, one for windows and one for linux, which probably hasnt been compiled. are the main differences just to do with the serial device? i guess i should be asking Jamz

there is a line in main.c that looks like its to sort the capital BOOL thing for linux
  #ifndef _WIN32

  typedef bool BOOL;
  #endif
but its not in bin.c or txt.c. also putting an #include "stdint.h" in ols.c clears up the uint16_t thing
7
USB Infrared Toy / Record and playback under Linux
I used Code:Blocks to built the IR TOY Recorder/Player utility v0.3 under Ubuntu. ([s:]v0.4[/s:] v0.5 has a lot of compile errors which appear to be mistakes in code!? see the end of my post)
I installed codeblocks, libncurses and build-essential packages to get it compiling.
When I run the binary it seems to freeze my bash prompt with or without options after the command (happens in a gnome terminal as well as virtual terminals ie: ctrl+alt+f1)
apart from this it appears to work

For example:
Code: [Select]
jarrod@study:~/programs/irtoy03$ ./irtoy  -d /dev/ttyACM0 -f outputfile1  -r-------------------------------------------------------------------------

 IR TOY Recorder/Player utility v0.3 (CC-0)
 http://dangerousprototypes.com

-------------------------------------------------------------------------
 Opening IR Toy on /dev/ttyACM0 at 115200bps...
 Entering IR sample mode ....
 IR Toy Protocol version:   
                               S  0  1    �    %                        &        %    B    &                                                                                    -                                                            &    -    &                            -    &                    -    &     
                                               �    �    %                        &        %    B    &                                                                                    -                                                            &    -    &                            -    &      
 Recording started.....
 Press a button on the remote.

 Waiting..any key to exit..
 Creating file: outputfile1_000.bin
 IR Toy said:
 11  00  18  00  11  00  2D  00  26  00  18  FF  FF 
writing outputfile1_000.bin

 Waiting..any key to exit..

 Recording ends..


 Thank you for playing with the IRToy.
jarrod@study:~/programs/irtoy03$
in the above command output the last prompt is unresponsive..
the file "outputfile1_000.bin" is actually created and contains data

as for [s:]v0.4[/s:] V0.5 not compiling, all occurrences of BOOL should be bool and "uint16_t" should be "unsigned int". the differences may be a windows thing?
after fixing these the code compiled successfully but has the same runtime problems as above

It appears that you guys lack linux testers? can I be of help?

edit: i meant v0.5, not 0.4
8
USB Infrared Toy / Re: New firmware features (now v09)
Thanks Ian.  yeh im using a 2455 with custom board. i was just going to solder on an LED and resistor to the appropriate pin, would it be the same pin as on the IRtoy?
9
USB Infrared Toy / Re: Use IR Control Jack on av receiver
The situation as I understand it is that Uome wants to control his receiver from his PC using an IRtoy from another room (as he said "I would like to control it via eventghost") so he would be sending IR from the irtoy, which would have a carrier as its intended to drive the LED

Actually just had an idea, you could actually use the on board ir decoder instead of a LPF to demodulate the signal (just make sure the IR led's light is making it to the IR receiver soldered next to it) then you would have the raw signal on one of the pins that can be fed into the control socket on the receiver (over a long cable if needed)
10
USB Infrared Toy / Re: Use IR Control Jack on av receiver
you could use only the IRtoy, get rid of the carrier signal with an appropriate low pass filter. this would leave you with only demodulated signal.
althouh a LPF may deform the data waveform a bit too much. could work though. you could also just put the IR led on a long cable to get it to the other room, telephone wire or something

fyi "accept and transmit an unmodulated IR signal" - unmodulated is not the right term, this would imply you only have a 40khz carrier, with no actual signal.. just nitpicking
11
USB Infrared Toy / Re: New firmware features (now v09)
The 2455 compile seems to work. I burned the firmware to the chip with no bootloader (as i couldn't find a binary for the 2455 and couldn't compile it either) i tested it with winLIRC and could receive IR. haven't tried sending yet
is there a tutorial on setting it up as a IR blaster under linux?
12
USB Infrared Toy / Re: trouble compiling
Thanks Ian. that fixed it.
now i just need to work out how to compile for the 2455. I noticed in hardwareprofile.h you have some modifications to work with HAD_USBIRC to change interrupts.. so i suppose you are working on it.
simply changing the chip type in the compiler wont work i see (complains about chip type being different in source files, yet i don't know where this is defined). maybe I'll leave it to you :P im not much good with "low-level" pic stuff.
13
USB Infrared Toy / Re: trouble compiling
so comment out that line in usb_config.h?
These new files you mention are already in the project folder, except for hal_lin_m which I can not find.
unless you mean they actually need to be included in the source

anyway after commenting out that line i get this error
Code: [Select]
Executing: "J:MCC18binmplink.exe" /l"j:mcc18lib" "rm18f2550 - HID Bootload.lkr" "usb_device.o" "usb_function_cdc.o" "usb_descriptors.o" "main.o" "SUMP.o" "IRIO.o" "RCdecoder.o" "USBbuf.o" "IRs.o" /u_CRUNTIME /z__MPLAB_BUILD=1 /m"USBIRToy.map" /w /o"USBIRToy.cof"
MPLINK 4.37, Linker
Copyright (c) 1998-2010 Microchip Technology Inc.
Error - could not find definition of symbol 'Usb2UartSetup' in file './main.o'.
Errors    : 1

Link step failed.
14
USB Infrared Toy / Re: trouble compiling
well not sure if this will help, but here is the directory tree for the project folder
Code: [Select]
J:Microchip Solutions v2010-08-04IRtoy-firmware>tree /f
Folder PATH listing
Volume serial number is 00650072 FCF5:AF5E
J:.
│   clean.bat
│   config.h
│   globals.h
│   HardwareProfile.h
│   IRIO.c
│   IRIO.err
│   IRIO.h
│   IRIO.o
│   IrReflect.c
│   IrReflect.h
│   IRs.c
│   IRs.err
│   IRs.h
│   IRs.o
│   main.c
│   main.err
│   main.h
│   main.o
│   RCdecoder.c
│   RCdecoder.err
│   RCdecoder.h
│   RCdecoder.o
│   README.TXT
│   rm18f2550 - HID Bootload.lkr
│   SUMP.c
│   SUMP.err
│   SUMP.h
│   SUMP.o
│   usb2uart.c
│   usb2uart.h
│   USBbuf.c
│   USBbuf.err
│   USBbuf.h
│   USBbuf.o
│   USBIRToy.hex
│   USBIRToy.mcp
│   USBIRToy.mcw
│   usb_config.h
│   usb_descriptors.c
│   usb_descriptors.o
│   usb_device.o
│   usb_function_cdc.o
│
├───build
└───USBStack
        usb.h
        usb_ch9.h
        usb_common.h
        usb_device.h
        usb_function_audio.h
        usb_function_ccid.h
        usb_function_cdc.h
        usb_function_generic.h
        usb_function_hid.h
        usb_function_midi.h
        usb_function_msd.h
        usb_hal.h
        usb_hal_pic18.h
        usb_hal_pic24.h
        usb_hal_pic32.h
        usb_host.h
        usb_host_audio_v1.h
        usb_host_cdc.h
        usb_host_cdc_interface.h
        usb_host_charger.h
        usb_host_generic.h
        usb_host_hid.h
        usb_host_hid_parser.h
        usb_host_msd.h
        usb_host_msd_scsi.h
        usb_host_printer.h
        usb_host_printer_esc_pos.h
        usb_host_printer_pcl_5.h
        usb_host_printer_postscript.h
        usb_host_printer_primitives.h
        usb_otg.h
        usb_printer_pos_bixolon_srp_270.h
        usb_printer_pos_epson_tm_t88iv.h
        usb_printer_pos_seiko_dpu_v445.h
        usb_printer_pos_seiko_mpu_l465.h


and the tree of the entire library folder (J:Microchip Solutions v2010-08-04).. this one is long, so i put it in a txt file (J: instead of "C:" is my root drive for some stupid reason)
15
USB Infrared Toy / trouble compiling
My aim here is to compile the code for a 18F2455, as it is so similar to the 2550 i expected this to be 'easy'
after installing the latest MPLAB IDE, C18 lite compiler and the sources for USB (from 'Microchip Application Libraries v2010-08-04 Installer.exe') and copying the usb_descriptors.c source to the project directory...
The files for USB don't seem to be in the same directory hierarchy as expected.. the compiler looks for files in ./USBStack
i found the files it was looking for in J:Microchip Solutions v2010-08-04MicrochipUSB
so i renamed the folder to USBStack and moved it into the project directory.
now it gets stuck at linking

and yes i did modify the 'library search path' to the correct MCC18 directory

Code: [Select]
----------------------------------------------------------------------
Release build of project `J:Microchip Solutions v2010-08-04IRtoy-firmwareUSBIRToy.mcp' started.
Language tool versions: mpasmwin.exe v5.37, mplink.exe v4.37, mcc18.exe v3.36, mplib.exe v4.37
Tue Sep 21 19:30:12 2010
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "..MicrochipUsbusb_device.c" -fo="usb_device.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "..MicrochipUsbCDC Device Driverusb_function_cdc.c" -fo="usb_function_cdc.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "usb_descriptors.c" -fo="usb_descriptors.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "main.c" -fo="main.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
J:Microchip Solutions v2010-08-04IRtoy-firmwaremain.c:226:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwaremain.c:410:Warning [2054] suspicious pointer conversion
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "SUMP.c" -fo="SUMP.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
J:Microchip Solutions v2010-08-04IRtoy-firmwareSUMP.c:71:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareSUMP.c:136:Warning [2054] suspicious pointer conversion
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "IRIO.c" -fo="IRIO.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRIO.c:46:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRIO.c:117:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRIO.c:233:Warning [2054] suspicious pointer conversion
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "RCdecoder.c" -fo="RCdecoder.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
J:Microchip Solutions v2010-08-04IRtoy-firmwareRCdecoder.c:55:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareRCdecoder.c:106:Warning [2054] suspicious pointer conversion
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "USBbuf.c" -fo="USBbuf.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
J:Microchip Solutions v2010-08-04IRtoy-firmwareUSBbuf.c:25:Warning [2054] suspicious pointer conversion
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "IRs.c" -fo="IRs.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRs.c:59:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRs.c:165:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRs.c:197:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRs.c:360:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRs.c:374:Warning [2054] suspicious pointer conversion
Executing: "J:MCC18binmplink.exe" /l"j:mcc18lib" "rm18f2550 - HID Bootload.lkr" "usb_device.o" "usb_function_cdc.o" "usb_descriptors.o" "main.o" "SUMP.o" "IRIO.o" "RCdecoder.o" "USBbuf.o" "IRs.o" /u_CRUNTIME /z__MPLAB_BUILD=1 /m"J:Documents and SettingsjarrodDesktopusbirtoyIRtoy-firmwarebuildUSBIRToy.map" /w /o"J:Documents and SettingsjarrodDesktopusbirtoyIRtoy-firmwarebuildUSBIRToy.cof"
MPLINK 4.37, Linker
Copyright (c) 1998-2010 Microchip Technology Inc.
Error - could not find definition of symbol 'mySetLineCodingHandler' in file './usb_function_cdc.o'.
Errors    : 1

Link step failed.
----------------------------------------------------------------------
Release build of project `J:Microchip Solutions v2010-08-04IRtoy-firmwareUSBIRToy.mcp' failed.
Language tool versions: mpasmwin.exe v5.37, mplink.exe v4.37, mcc18.exe v3.36, mplib.exe v4.37
Tue Sep 21 19:30:15 2010
----------------------------------------------------------------------
BUILD FAILED

( ! ) 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.01582459896session_write_close ( )...(null):0
20.01612591472ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01612592248Database_MySQL->query( ).../DatabaseHandler.php:119
40.06042730960Database_MySQL->error( ).../Db-mysql.class.php:273