tuxphone / CubeCellRepeater

Small repeater node for the meshtastic project.
40 stars 6 forks source link

default freq for meshtastic_Config_LoRaConfig_RegionCode_US do not match the default meshtastic frequency for US #6

Closed kalashnikov2 closed 5 months ago

kalashnikov2 commented 6 months ago

hello I am testing the lora 32 v3 from heltec and the cubeceel htcc-ab02a with the repeater code. when I set the meshtastic lora 32 v3 to US and the repeater to US mode default frequencies do not match in the meshtastic it on 906.875 and in the repeater it on 912.625

the lora 32 v3 its on meshtastic v2.3.6 and the htcc-ab02a its using this repo code

when set to EU-868 on both devices, this does not occur and the default frequencies work.

Shouldn't the default frequencies be the same in the US configuration?

tuxphone commented 6 months ago

Thank you for pointing this out. I will look into it asap, which is end of May/early June.

I'm fairly sure it's the Channel hash, because this selects the actual lora frequency slot to use.

EU868 had only one Slot, so being not accurate "meshtastic" doesn't matters so much.

kalashnikov2 commented 6 months ago

hello, Thanks for the answer, I look for more in the meshatic docs I found this

on https://meshtastic.org/docs/overview/radio-settings/ on 915 ism "There are 104 frequency slots defined with the standard radio preset LongFast. After factory reset the radio will be set to frequency slot 20 with a center frequency of 906.875 MHz."

the cube cell default its Frequency Slot: 43 Frequency of slot: 912.625

In meshtastic there is no way to choose the slot, only to set a frequency by hand.

meshtastic have the option to choose the slot that you want to use

kalashnikov2 commented 6 months ago

hello

after reading the code better

in startup variables

#define CC_MY_LORA_FREQ 0.0 // if you want to override frequency calculation: Freq in MHz (e.g. 869.4)

allows you to modify the frequency

i just set it to 906.875 and works : D


I'm going to make distance tests

-It would be very useful to be able to have a visual reference using the GPIO 13 LED, either for incoming messages or for outgoing messages, so a PC is not needed to know if the messages are arriving or leaving. :D

ref: http://community.heltec.cn/t/htcc-ab02a-has-a-secret-green-led/3092

Thanks for the help

tuxphone commented 6 months ago

Issue should be fixed with todays commit.

I added some serial output to make it clear how many slots are available and which channel was chosen (calculated based on the channel name or chosen via the new #define CC_CHANNEL_SLOT in main.h).

The "official" default channel slot of the Region US is 20. The actual number is 19 because the count starts at 0. So for serial output we increase it by 1.

I will keep the issue open a while to give you time to test it and for feedback. Again thanks for the detailed description of the problem.

[INF][CryptoEngine]Initializing ... Using AES128 key!
[INF]Init region List ... done!
[INF]Channel name is "LongFast"
[INF]Channel slot is 20 (104 available frequency slots).
[INF]Using Region US : freq=906875000 bw=250000 sf=11 cr=5 power=20 ... success!
tuxphone commented 6 months ago

The GPIO 13 is not forgotten, i will look into it and if it's easy to integrate, i will do it.

tuxphone commented 6 months ago

I integrated visual signalization of RX/TX.

Default is red/green blink via Neopixel LED.

For the HTTC-AB02A you would have to change the main.h

Comment the #define CC_SIGNAL_NEOPIXEL and uncomment CC_SIGNAL_GPIO13. GPIO13 signalization is all green for rx and tx.

Please test this and give feedback.

`

define CC_MONITOR_ONLY false // set true to suppress transmitting of packets (just monitor the traffic)

define CC_SIGNAL_NEOPIXEL // signal received packets with a green blink, signal transmits with red blink

//#define CC_SIGNAL_GPIO13 // signal received packets with the green LED on HTCC-AB02A `

kalashnikov2 commented 5 months ago

hi

i just add on line 56 in main.h

#define GPIO13 P0_6

and works

Thanks for the help

tuxphone commented 5 months ago

Thanks for testing. I added the P0_6 define. Im closing the issue now.

If you have other ideas to improve the code, feel free to open a new issue.