MordFIdel / SOCORAD32

ESP32 SOftware COntrolled RADio (SOCORAD32)
161 stars 21 forks source link

How to remove tone code CTCSS ? #21

Closed joyel24 closed 1 year ago

joyel24 commented 1 year ago

I am trying to disable the tone code CTCSS and pushed 0 to RxCT & TxCT but the tone is still on.

In my ui.c below, you can find that all first 16 channels has been modified. I disabled the VOX with 0 and wanted to do the same for tone but it's not working as I expected. https://github.com/joyel24/SOCORAD32/blob/PMR446/SCRD32_firmware_official/main/ui.c

The doc about the firmware talks about "editing the ctcss" but not about disabling it completely. The documentation

Can i have some help please ?

This video shows the issue: https://youtu.be/DQbvcjrrRdY?feature=shared

KillerTurtleSoftware commented 1 year ago

Instead of {446.00625, 446.00625, 0, 0, 0, WIDE_BAND, HIGH_LEVEL} try {446.00625, 446.00625, , , 0, WIDE_BAND, HIGH_LEVEL} There is no '0' value in the matrix, so it may be defaulting to the first option. The option may need to be a Null value. I don't have my radios at work to try.

joyel24 commented 1 year ago

I'll try and tell you...

I saw this function managing ctcss, with interval from 1 to 38 (0 excluded). I thought that when this function returns 0, it disables the tone, but didn't try to understand the code more than that.

static float getToneFreq(uint8_t ctcss_code) { if (ctcss_code > 0 && ctcss_code <= 38) return tone_freq[ctcss_code-1]; else return 0; }

KillerTurtleSoftware commented 1 year ago

I saw that code too, but it's only used once, Line 303, and that line is commented out.

The Radio module doesn't have any mentions of what code is needed to disable the tones, just how to set them.

joyel24 commented 1 year ago

ui.c:23:25: error: expected expression before ',' token {446.01875, 446.01875, , , 0, WIDE_BAND, HIGH_LEVEL},

That was not a good idea, now it's not compiling at all... @MordFIdel Can you tell something ? You sell this product and it appears that you have no skills on programming... Strange

joyel24 commented 1 year ago

I saw that code too, but it's only used once, Line 303, and that line is commented out.

After rechecking, yes this function is still here but not used apparently.

The Radio module doesn't have any mentions of what code is needed to disable the tones, just how to set them.

Yes, that's why I'm annoyed. Anyway, thanks for your help @KillerTurtleSoftware.

KillerTurtleSoftware commented 1 year ago

Ok,

Just tried it and tested with my HackRF One. You can't leave it empty, but the "0" does turn it off'.

KillerTurtleSoftware commented 1 year ago

ui.c:23:25: error: expected expression before ',' token {446.01875, 446.01875, , , 0, WIDE_BAND, HIGH_LEVEL},

That was not a good idea, now it's not compiling at all... @MordFIdel Can you tell something ? You sell this product and it appears that you have no skills on programming... Strange

This is why I created the site/forum. To have a place to work together and build/test at.

joyel24 commented 1 year ago

Ok,

Just tried it and tested with my HackRF One. You can't leave it empty, but the "0" does turn it off'.

I don't have the same result, check this video: https://youtu.be/DQbvcjrrRdY?feature=shared

joyel24 commented 1 year ago

Nut sure but I think I found why it's not working.

After reading schematics I found that PIN14 (SQUELCH) of radio module is connected to PIN5 of our ESP32 MCU but I didn't find any mention of this pin on the firmware source code. https://github.com/MordFIdel/SOCORAD32/blob/main/SOCORAD32.PDF

Maybe the squelch level is so high and never toggle RX as it's not in code, the only way to trigger the squelch is to use a Tone code for the moment I suppose... Do you plan to make the squelch working @MordFIdel ?

Edit not sure as rf module datasheet says it's output only, a pin to tell us when the radio is receiving I guess.

joyel24 commented 1 year ago

Well I found a solution, it will be in pull request soon.

Edit: Here it is https://github.com/MordFIdel/SOCORAD32/pull/24

KillerTurtleSoftware commented 1 year ago

Ok, Just tried it and tested with my HackRF One. You can't leave it empty, but the "0" does turn it off'.

I don't have the same result, check this video: https://youtu.be/DQbvcjrrRdY?feature=shared

Hmm,

I wonder if just using zero sets it as having a CTCSS, but at 0 Hz, and not just CW (CSQ). It works between 2 SoCoRads though. I'll have to get another UHF radio to test with.

joyel24 commented 1 year ago

Ok, Just tried it and tested with my HackRF One. You can't leave it empty, but the "0" does turn it off'.

I don't have the same result, check this video: https://youtu.be/DQbvcjrrRdY?feature=shared

Hmm,

I wonder if just using zero sets it as having a CTCSS, but at 0 Hz, and not just CW (CSQ). It works between 2 SoCoRads though. I'll have to get another UHF radio to test with.

In fact, originally if ct is set to 0, it will put it automatically to 1: This is from uart.c

if(gRxCtcss == 0) gRxCtcss = 1;
        else if(gRxCtcss > 38) gRxCtcss = 38;

        if(gTxCtcss == 0) gTxCtcss = 1;
        else if(gTxCtcss > 38) gTxCtcss = 38;

I read the RF module datasheet and it says, you have to send 0xFF to disable the CT/DCS with the AT+ command

KillerTurtleSoftware commented 1 year ago

Nut sure but I think I found why it's not working.

After reading schematics I found that PIN14 (SQUELCH) of radio module is connected to PIN5 of our ESP32 MCU but I didn't find any mention of this pin on the firmware source code. https://github.com/MordFIdel/SOCORAD32/blob/main/SOCORAD32.PDF

Maybe the squelch level is so high and never toggle RX as it's not in code, the only way to trigger the squelch is to use a Tone code for the moment I suppose... Do you plan to make the squelch working @MordFIdel ?

Edit not sure as rf module datasheet says it's output only, a pin to tell us when the radio is receiving I guess.

The ESP Pin 5 is SENSOR_VN (GPIO_39). which is referenced in gpio.c as "#define RX_STATE_PIN (GPIO_NUM_39) " the Squelch is just a output from the RF module, saying it's receiving a signal.

also, it looks like you have to use the AT+DMOFUN command to set the squelch level, haven't seen it set any where. I will work on adding this line to the uart.c code. This is really needed as the mic gain level needs to be adjusted as well. I feel it's way too low by default.

joyel24 commented 1 year ago

The ESP Pin 5 is SENSOR_VN (GPIO_39). which is referenced in gpio.c as "#define RX_STATE_PIN (GPIO_NUM_39) " the Squelch is just a output from the RF module, saying it's receiving a signal.

i know, after reading schematics and RF module datasheet I understood how pin5 works, this is basically to toggle an RX led.

also, it looks like you have to use the AT+DMOFUN command to set the squelch level, haven't seen it set any where. I will work on adding this line to the uart.c code. This is really needed as the mic gain level needs to be adjusted as well. I feel it's way too low by default.

Yes this is possible to change squelch level via bluetooth AT+. But I can't confirm that without choosing a specific squelch level, after sending 0xFF bytes to the RF module for the RXct & TXct its working well with a random Walkie talkie with no CT/DCS

joyel24 commented 1 year ago

fixed by #29