I’m trying to use AnalysIR to capture a string of around 12 codes which are sent in relatively quick succession by a remote control to unlock the region code in a DVD player. I have configured an Arduino Uno R3 to use two photo receivers as shown in the startup guide. I also loaded the sketch “AnalysIR _Firmware_801” (I hope this is the correct sketch, but on loading it reports low RAM memory). When I press the remote key which sends the string of codes I get inconsistent reports, sometimes four codes are reported in AnalysIR history log, other times six codes, and the protocol is shown as “Japanese”, 48 bit. However if I run Ken Shirriff’s IRrecvDumpV2 with a serial port speed of 500000bps it logs 12 codes (albeit unknown protocol, 32 bit). If I then import these 12 codes into AnalysIR they are shown as Japanese protocol, 48 bit.
It appears to me that up to 50% of the codes are being missed when attempting to read the codes direct into AnalysIR via AnalysIR_Firmware_801. Having looked at AnalysIR I’m wondering if the serial port speed (115200) may be a factor? For example if it has not finished reporting one code before another is received then possibly it cannot stay in sync?
Please could anyone advise/confirm what my be causing this and also whether I have configured something incorrectly etc?
Erratic code capture in AnalysIR
Re: Erratic code capture in AnalysIR
This is operating as designed...we want to use as much SRAM as possible for buffering & the IDE just provides a warning.but on loading it reports low RAM memory
It is likely that you are running out of buffer. Once the buffer is full, it is then sent over serial to the PC. If your signal continues to arrive during this time then some parts may be lost. Another possibility is that your particular signal coincides with the SIGNALGAP setting (try point 4 below)
The use case you describe is rare.
NB: Try option 4 below first!
Workarounds:
1. IF you use another MCU...like an Arduino mega2560 you can assign more SRAM to the buffer. Similarly for any supported 32-bit platforms DUE, Teensy, ESP8266/ESP32, particle photon. They all have lots more SRAM available. We have complete ESP systems available in our Shop.
2. Alternatively, our LearnIR product uses a lossless compression technique, which can record very long sequences of signals - should be able to capture this.
3. If you don't have any of the above to hand, you could try upping the BAUD rate to see if you can get the buffer uploaded before the next signal part arrives. (You can override the BAUD rate in the ini file. If changed you need to restart AnalysIR. The BAUD rate is defined near the end of the file. Use Menu->File->Explore to find it - AnalysIR.ini). Some Arduinos will support 1mbps or even 2mbps depending on original vs clone.
4. try changing the following line in the firmware, as below.
Code: Select all
#define SIGNALGAP 125000 //determines gap between signals (typical range 100000->125000)
change to
#define SIGNALGAP 5000000 //determines gap between signals (typical range 100000->125000)
-
- Posts: 3
- Joined: Thu Jun 25, 2020 5:53 am
Re: Erratic code capture in AnalysIR
Thanks very much for your suggestions:
Thanks again for your suggestions, I'll let you know how I progress.
I tried increasing the serial port speed, but on start up I receive a popup advising that the maximum allowed value is 125000.you could try upping the BAUD rate
I tried SIGNALGAP = 500000 but it further reduces the captured codes to 2 or even 1. I tried adjusting SIGNALGAP in different directions but the default value of 125000 appears to report the most codes (6-8).#define SIGNALGAP 5000000
I already have a mega2560 on order and will try this once it has been delivered to me. Are you able to advise how/where I assign more SRAM?IF you use another MCU...like an Arduino mega2560 you can assign more SRAM to the buffer
I will definitely check this option on your website.Alternatively, our LearnIR product uses a lossless compression technique
Not sure I fully understand what you mean: Do you mean that trying to capture a string of codes is rare? Or something else?The use case you describe is rare.
Thanks again for your suggestions, I'll let you know how I progress.
Re: Erratic code capture in AnalysIR
you need an extra zeroI tried SIGNALGAP = 500000
Code: Select all
#define SIGNALGAP = 5000000
Code: Select all
#define SIGNALGAP = 5000000UL //unsigned long value
Re: Erratic code capture in AnalysIR
For the Arduino 2560, set the following to true & the other platforms to false.
Then you can configure the SRAM buffer, via the maxpulses definition below (the default should be fine...but can be increased more if needed)
One thing you could do is to email me a saved session file ( to info@......), of what you get in AnalysIR via Menu->File->Save Session
Another thing to try is the following sketch: https://www.analysir.com/blog/2014/03/1 ... s-arduino/ and email me the output
Code: Select all
//set true for Microcontroller system being used, set all others to false
#define Arduino328 false //Any standard Arduino - Duemilenova, Nano or compatible with ATMega328x @16Mhz
#define ArduinoUNO false//Any Arduino - UNO @16Mhz
#define ArduinoLeonardo false //Select this for for Arduino Yún & Arduino (pro)Micro also, when connected via USB as the Yún is also a Leonardo
#define ArduinoMega1280 true//Also Mega2560 - untested
#define ArduinoDUE false //
#define ArduinoYUN false //
#define ArduinoZero false //
#define ArduinoM0 false //
#define MSP430F5529 false //
#define TivaC false //
#define FubarinoMini false //
#define Teensy3 false //tested on teensy 3.1, but should also work for Teensy 3.0
#define Moteino false //uses D3 for IR Receiver and therefore no carrier measurement possible
//............................................................................................
Code: Select all
#elif ArduinoMega1280
#define pin2HIGH (PINE & 0b00010000) //Port E bit 4
#define maxPULSES 1024*3 //even More RAM is available on Megas...can increase this for longer signals if neccessary
Because you are trying to programme a DVD, which seems to have an unusual pattern & this issue has not been raised in many yearsNot sure I fully understand what you mean: Do you mean that trying to capture a string of codes is rare? Or something else?
One thing you could do is to email me a saved session file ( to info@......), of what you get in AnalysIR via Menu->File->Save Session
Another thing to try is the following sketch: https://www.analysir.com/blog/2014/03/1 ... s-arduino/ and email me the output
-
- Posts: 3
- Joined: Thu Jun 25, 2020 5:53 am
Re: Erratic code capture in AnalysIR
thanks, i have sent you a message.
Re: Erratic code capture in AnalysIR
Yes..I saw that...will look at it over the weekend.