Xinyuan-LilyGO / LilyGo-LoRa-Series

LILYGO LoRa Series examples
644 stars 177 forks source link

T3S3v1.2 sx1280 PA RadioLibExample not working #131

Closed 53-74-65-66-61-6e closed 6 months ago

53-74-65-66-61-6e commented 8 months ago

Hello,

can someone confirm, that the Lilygo T3S3 v1.2 SX1280 PA board works out of the box with the provided example ( https://github.com/Xinyuan-LilyGO/LilyGo-LoRa-Series/tree/master/examples/RadioLibExamples/SX1280 ) ?

I am able to compile and upload the tx and rx example programs in vscode+platformio and the displays are working, but no data is received. I did some research in the RadioLib documentation, but no success so far.

To verify, that my boards are not broken, i can flash meshtastic and that defintiely works.

One thing, which does not seem to comply with RadioLib is the initalization of SPI. According to RadioLib, the SPI Class should be handed over in radio.begin() like here: https://github.com/jgromes/RadioLib/wiki/Basics#non-standard-spi-setup I tried that as well, but still no luck.

Before i dive into more details, it would be helpful to know, if others are having success with this example on these boards.

best regards, Stefan

lewisxhe commented 8 months ago

Please paste your test code

53-74-65-66-61-6e commented 8 months ago

My test code is the example from Lilygo Github: RadioLibExamples/SX1280

53-74-65-66-61-6e commented 8 months ago

i tried again step by step:

  1. in platformio.ini uncomment: src_dir = examples/RadioLibExamples/SX1280/SX128x_Transmit_Interrupt

    • compilation and upload works. board boots and displays "Transmitting: OK!"
  2. in platformio.ini uncomment: src_dir = examples/RadioLibExamples/SX1280/SX128x_Receive_Interrupt

    • compilation fails with errors:
In file included from /LilyGo-LoRa-Series-master/examples/RadioLibExamples/SX1280/SX128x_Receive_Interrupt/SX128x_Receive_Interrupt.ino:28:
examples/RadioLibExamples/SX1280/SX128x_Receive_Interrupt/boards.h:116:15: error: redefinition of 'SPIClass SDSPI'
 SPIClass SDSPI(HSPI);
/LilyGo-LoRa-Series-master/examples/RadioLibExamples/SX1280/SX128x_Receive_Interrupt/SX128x_Receive_Interrupt.ino: In function 'void loop()':
/LilyGo-LoRa-Series-master/examples/RadioLibExamples/SX1280/SX128x_Receive_Interrupt/SX128x_Receive_Interrupt.ino:199:53: error: 'str' was not declared in this scope
                 snprintf(buf, sizeof(buf), "RX:%s", str);
puboy7 commented 8 months ago

Please use the latest uploaded code. The specific problem is to accommodate the use of new screens and new versions of edp screens but to repeatedly define SDSPI at design time. Sorry for the inconvenience

53-74-65-66-61-6e commented 8 months ago

Great, it works! photo

Thank you very much for the direct support.

puboy7 commented 8 months ago

It's my pleasure.

53-74-65-66-61-6e commented 8 months ago

one more thing. It would be nice, if the example shows the text which was sent by the transmitter.

In SX128x_Receive_Interrupt.ino use arduino string instead of counter:

// you can read received data as an Arduino String
String str;
int state = radio.readData(str);
/*
uint32_t counter;
int state = radio.readData((uint8_t *)&counter, 4);
*/

here at Serial print:

// print data of the packet
Serial.print(F("[SX1280] Data:\t\t"));
//Serial.println(counter);
Serial.println(str);

and here at oled output:

//snprintf(buf, sizeof(buf), "Data:%s", counter);
str = "Data: " + str;
str.toCharArray(buf, 256);
u8g2->drawStr(0, 26, buf);
53-74-65-66-61-6e commented 8 months ago

Hello World

puboy7 commented 8 months ago

Yes, as you can see in the sample code for other models there are also examples that show you what you want according to your requirements

53-74-65-66-61-6e commented 8 months ago

I just noticed something else:

The difference is in utilities.h:

#elif defined(LILYGO_T3_S3_V1_0)
[...]
#define RADIO_RX_PIN                21
#define RADIO_TX_PIN                10

these two defines for antenna control pins are are missing after:

#elif defined(LILYGO_T3_S3_V1_2)

without these defines, the transmit example code does not actually transmit. It compiles and the oled displays "Transmitting: OK!", but it does not send anything and the receiver cannot receive anything.

(Also, because i have the PA version, i set txpower back to 3. WIth default_envs = T3_S3_V1_2_SX1280, tx Power would be set to 13.)

Please update the corresponding utilities.h in the repository.

puboy7 commented 8 months ago

Our original plan was to remove the use of pa mode in version 1.2 but later added it back so please try it with the latest code

53-74-65-66-61-6e commented 8 months ago

I was confused, because in the schematics, there is no lora_tx and lora_rx at U1 HDP17.

Are these pins unique to the PA versions of the chips?

puboy7 commented 8 months ago

The PA version does not have lora_tx and lora_rx so you need to define it by yourself

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 6 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.