-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Some repeated keys are not working #2
Comments
I've noticed this before, but I don't have a solution for it. I could imagine that the TSOP7000 replicas can no longer keep up, or something similar. Do you perhaps have a recording with the oscilloscope and a screenshot of the output of these “repeat” key sequences? Maybe you can see something. I've only prepared the transmitter routine once and couldn't test it because I don't have any transmitter hardware or would first have to set it up with a suitable IR transmitter LED. Have you ever tried this? |
Thanks for your answer. It's not a TSOP problem, because I'm using "real" TSOP. This link: https://github.com/Arduino-IRremote/Arduino-IRremote/discussions/1181 I will connect a scope and send you some screenshots. Compiling with Tx routines gives errors. hope it help ! Thanks |
1. repeated-button press
If it works for your setup, then I can think about how I could solve this situation for the TSOP7000 replicas. So maybe something like an additional state in the state machine that handles the end of the frame and then does not debounce for the next falling edge (the next start of the frame). In order to catch the short gap between two repeat frames. 2. beo4_tx_task() |
New insight, it looks like the repeat buttons are sent without a pause between the individual frames. I have to think about it, I'm afraid the statemachine RxFsm() is not prepared for this and can't recognize the beginning of the following frames. |
I just saw that we answered at the sample time ! But why does vol down and yellow work ? |
ooops I pressed the wrong button |
Just a quick answer, I will add a main.cpp example later. In principle you have to add these lines in main.cpp 1. declaration sectionadd a transmit GPIO, e.g. 33, add a queue, call Constructor with rx, tx and channel #define IR_RX_PIN 34 // IR receive pin
#define IR_TX_PIN 33 // IR transmit pin
xQueueHandle beo4_rx_queue; // queue for beo4codes from receiver
xQueueHandle beo4_tx_queue; // queue for beo4codes from transmitter
IrBeo4 beo4(IR_RX_PIN,IR_TX_PIN,0); // receive, transmit, channel=0 2. the setup()within the setup() function the beo4.Begin() member function gets both queues beo4_ok=beo4.Begin(beo4_rx_queue,beo4_tx_queue); // start both tasks 3. your my_send_function()generate the beoCode from source-code and command-code, and push to the beo_tx_queue uint32_t beoCode=((uint32_t)BEO_SRC_AUDIO << 8) + (uint32_t)BEO_CMD_VOL_DOWN;
Serial.printf_P(PSTR("sending (%s, %s) = 0x%x --> beo4_tx_queue \n"),beo_src_tbl(beoCode), beo_cmd_tbl(beoCode),beoCode);
xQueueSend(beo4_tx_queue,&beoCode,0);
For now, the only thing I can think of is perhaps the length of the complete frame. It's a bit tricky with the “BEO_SAME” pulse code. The idea is probably to create frames of approximately the same length. But it doesn't work for everyone, so there are longer and shorter frames. Maybe the statemachine can still keep up with the "yellow" and "down" key. I'll have to have a look at this at my leisure. Maybe I can improve the statemachine further. The evaluation of long codes from the lintronic source is helpful. I'll see what I can do. A nice idea, by the way, if you could send me an original Vishay TSOP7000 Receiver. |
Thanks! I also discover this library but using timer on arduino (probably not easy to transpose it on ESP); If you have access to my email address, please send me an email with your address to send you TSOP7000 |
OK here the complete setup() // prepares queue, starts beo4_task and the internal beo4 receiver tasks
void setup_beo4(void) {
static int beo4_ok=-1;
Serial.printf(PSTR("===> start beo4... "));
beo4_rx_queue = xQueueCreate(50, sizeof(uint32_t));
beo4_tx_queue = xQueueCreate(50, sizeof(uint32_t));
xTaskCreatePinnedToCore(beo4_task,"beo4_task",10000,NULL,0,&beo4_task_h,0);
beo4_ok=beo4.Begin(beo4_rx_queue,beo4_tx_queue); // start beo4 receiver only
Serial.printf(PSTR("%s\n"),beo4_ok==0? "OK":"failed");
} Q: what is your development environment? Are you running Arduino or platformio + VScode? to help your compiler errors from above, you could try to add esp32-hal-ledc.h" like so within IrBeo4.h. It seems that platformio finds all dependences, maybe for Arduino you have to add the header-file. #ifndef IRBEO4_H_
#define IRBEO4_H_
#include "Arduino.h"
#include "esp32-hal-ledc.h" 2. further investigationsI made some tests with the transmit routine, I think the signal at GPIO33 itself seems to look OK, the burst has 455khz the length of the different pulsewith codes is OK. these are the screen shots from the [audio, +vol--] Button. the complete framethe stop pulsecode has about 12,6 msthe 455khz bursts are about 200µsthe frequency of the bursts is about 455khz3. an idea how to add a sender IR LEDhave a look at this website |
Thanks.
\Arduino\libraries\esp32_beo4-main\src\IrBeo4.cpp:49:5: error: 'ledcSetup' was not declared in this scope 49 | ledcSetup(beo4->m_tx_pwm,455000,4); // pCarrier=455kHz,duty_range=[0..15] Arduino\libraries\esp32_beo4-main\src\IrBeo4.cpp:50:5: error: 'ledcAttachPin' was not declared in this scope; did you mean 'ledcAttach'? 50 | ledcAttachPin(beo4->m_tx_pin,beo4->m_tx_pwm); // attach to transmit pin
|
1. Arduino IDE,
|
Sometimes it's easier than you think. The RxFsm() state machine determines the start sequence case rxSt::S0: {
if(bZero==m_pCode) {
m_rxFSM=rxSt::S1; // next state --> continue start sequence
} else if(bStart==m_pCode) {
m_rxFSM=rxSt::Data; // next state --> collect data
} else { // frame corrupt
resetRxFsm("ERR: FSM_S_0 state failed ");
}
break;
}
case rxSt::S1: {
if(bZero==m_pCode) {
m_rxFSM=rxSt::Start; // next state --> continue start sequence
} else if(bStart==m_pCode) {
m_rxFSM=rxSt::Data; // next state --> collect data
} else { // frame corrupt
resetRxFsm("ERR: S1 state failed ");
}
break;
}
case rxSt::Start: {
if(bStart==m_pCode) {
m_rxFSM=rxSt::Data; // next state --> collect data
} else { // frame corrupt
resetRxFsm("ERR: Start state failed ");
}
break;
} The Bugfix included in the Release 1.2.1 |
Hi,
Thanks a lot for this great library. 👍
With a continue press on the key volume down you get:
beo4_task: 0164 audio vol--
beo4_task: 0164 audio vol--
beo4_task: 0164 audio vol--
beo4_task: 0164 audio vol--
with vol up:
you receive
beo4_task: 0160 audio vol++
but only once !
Same for green, red, blue, audio up:
beo4_task: 01d5 audio green
beo4_task: 0176 audio green++
but yellow is working perfectly as audio down !
you have already writed a Tx code writed. Do you have some example ?
Thanks
The text was updated successfully, but these errors were encountered: