catdog8516
04/30/2024, 10:13 AMfloitsch
04/30/2024, 10:23 AMfloitsch
04/30/2024, 10:25 AMcatdog8516
05/01/2024, 6:36 AMfloitsch
05/01/2024, 7:54 AMcatdog8516
05/02/2024, 6:38 AMpin_ := gpio.Pin.in 18
rx := rmt.Channel pin_ --input
--idle_threshold=26_000
--filter_ticks_threshold=10
--clk_div=233
And the error I'm getting is:
E (14590) rmt(legacy): rmt_set_gpio(528): RMT CHANNEL ERR
E (14590) rmt(legacy): rmt_config(673): set gpio for RMT driver failed
----
EXCEPTION error.
UNKNOWN ERROR 0x102(258)
0: rmt-config-rx_ <sdk>/rmt.toit:574:3
1: Channel.configure <sdk>/rmt.toit:381:5
2: Channel <sdk>/rmt.toit:294:12
3: main test-ir.toit:10:9
I've tried using a few different GPIO pins, but get the same error.
device has version
esp32s3-20210327
Build:Mar 27 2021
Appreciate any suggestionsfloitsch
05/02/2024, 6:41 AMpin_ := gpio.Pin 18 (without the .in). The RMT will configure it correctly itself.floitsch
05/02/2024, 6:41 AMcatdog8516
05/02/2024, 6:46 AMfloitsch
05/02/2024, 6:53 AMfloitsch
05/02/2024, 6:53 AMfloitsch
05/02/2024, 6:54 AMcatdog8516
05/02/2024, 7:01 AMfloitsch
05/02/2024, 7:41 AMcatdog8516
05/02/2024, 7:43 AMjag flash --chip esp32s3-spiram-octo for these boards.floitsch
05/02/2024, 7:44 AMcatdog8516
05/02/2024, 7:46 AMfloitsch
05/02/2024, 8:41 AMcatdog8516
05/02/2024, 8:52 AMfloitsch
05/02/2024, 9:10 AMfloitsch
05/02/2024, 9:11 AMcatdog8516
05/02/2024, 9:33 AMfloitsch
05/02/2024, 12:39 PMcatdog8516
05/06/2024, 9:47 AMfloitsch
05/06/2024, 10:27 AMcatdog8516
05/17/2024, 7:01 AMsignals.stringify shows a bunch of numbers when I press IR remote button).
But I'm struggling with a few things, maybe you can give me some pointers:
1. For transmitting, how can I represent the NEC message structure using signals? For example, it uses a 9ms burst as a header. How do I map 9ms to a signal period (i.e. ticks)?
2. And.. should I use a single rmt.Signals instance to represent the entire message (header + address + command + eom), or should the message be made and transmitted as a series of Signals instances?
3. NEC IR uses a carrier frequency of 38kHz. I assume this means I'll need to use the --carrier-frequency-hz option. What other options might I need? --clk-div and --carrier-duty-percent?
4. When it comes to reading in Signals - can you let me know a rough outline of how to parse these into usable data? I'm assuming that I would first match a signal pulse to the 9ms header, and then buffer/parse the remaining pulses (address + command, etc) until I detect the EOM pulse?
I've been trying to repurpose the 1wire source code, but I'm struggling to see the big picture of how it all hangs together.
Anyways - any tips appreciated.floitsch
05/17/2024, 9:39 AMfloitsch
05/17/2024, 9:41 AMfloitsch
05/17/2024, 9:41 AMfloitsch
05/17/2024, 9:42 AMc
static void nec_tx_init()
{
rmt_config_t rmt_tx;
rmt_tx.channel = RMT_TX_CHANNEL;
rmt_tx.gpio_num = RMT_TX_GPIO_NUM;
rmt_tx.mem_block_num = 1;
rmt_tx.clk_div = RMT_CLK_DIV;
rmt_tx.tx_config.loop_en = false;
rmt_tx.tx_config.carrier_duty_percent = 50;
rmt_tx.tx_config.carrier_freq_hz = 38000;
rmt_tx.tx_config.carrier_level = 1;
rmt_tx.tx_config.carrier_en = RMT_TX_CARRIER_EN;
rmt_tx.tx_config.idle_level = 0;
rmt_tx.tx_config.idle_output_en = true;
rmt_tx.rmt_mode = 0;
rmt_config(&rmt_tx);
rmt_driver_install(rmt_tx.channel, 0, 0);
}floitsch
05/17/2024, 9:43 AMcatdog8516
05/20/2024, 5:36 AMSEND: 121 178
TX: 17 items -- 1-16 0-8 0-1 0-1 1-3 1-3 1-3 1-3 0-0 0-0 1-3 1-3 1-1 1-1 1-1 1-1 0-0 1-1
RX: Reading...
RX: 4 items - 1-16 0-10 1-12 0-0
SEND: 121 178
TX: 17 items -- 1-16 0-8 0-1 0-1 1-3 1-3 1-3 1-3 0-0 0-0 1-3 1-3 1-1 1-1 1-1 1-1 0-0 1-1
RX: Reading...
RX: 4 items - 1-16 0-10 1-12 0-0
I used these Channel settings:
CLK-DIV := 45
IDLE-LEVEL := 0
IDLE-THRESHOLD-TICKS := 15000
FILTER-TICKS-THRESHOLD := 5
I tried a range of values for idle threshold and filter ticks, but they don't appear to have much affect on the receiver.
My test code essentially calls rx.start-reading followed by a short sleep, then tx.send signals, then rx.read.
I feel as though I'm close, but missing something fundamental..floitsch
05/20/2024, 8:13 AMcatdog8516
05/20/2024, 8:19 AMfloitsch
05/20/2024, 8:20 AMcatdog8516
05/20/2024, 8:20 AMfloitsch
05/20/2024, 8:21 AMFILTER-TICKS-THRESHOLD 5catdog8516
05/20/2024, 8:21 AMfloitsch
05/20/2024, 8:21 AMcatdog8516
05/21/2024, 5:46 AMTX: 68 items -- 1-16000 0-8000 1-1000 0-3000 1-1000 0-1000 1-1000 0-3000 1-1000 0-1000 1-1000 0-3000 1-1000 0-3000 1-1000 0-3000 1-1000 0-3000 1-1000 0-1000 1-1000 0-3000 1-1000 0-1000 1-1000 0-3000 1-1000 0-3000 1-1000 0-3000 1-1000 0-3000 1-1000 0-3000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-3000 1-1000 0-3000 1-1000 0-3000 1-1000 0-3000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-0
RX: Reading...
RX: 68 items - 1-16000 0-8000 1-1000 0-3000 1-1000 0-1000 1-1000 0-3000 1-1000 0-1000 1-1000 0-3000 1-1000 0-3000 1-1000 0-3000 1-1000 0-3000 1-1000 0-1000 1-1000 0-3000 1-1000 0-1000 1-1000 0-3000 1-1000 0-3000 1-1000 0-3000 1-1000 0-3000 1-1000 0-3000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-3000 1-1000 0-3000 1-1000 0-3000 1-1000 0-3000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-1000 1-1000 0-0kasperl
05/21/2024, 6:21 AMcatdog8516
05/24/2024, 5:32 AMkasperl
05/24/2024, 5:43 AMfloitsch
05/24/2024, 7:18 AMcatdog8516
05/24/2024, 8:03 AMfloitsch
05/24/2024, 8:13 AMfloitsch
05/24/2024, 8:14 AMfloitsch
05/24/2024, 8:15 AMfloitsch
05/24/2024, 8:16 AMcatdog8516
05/24/2024, 8:57 AM