'하드웨어/lora lorawan'에 해당되는 글 6건

  1. 2026.02.27 sx1276 raw pakcet
  2. 2026.02.26 lora driver for stm32 written in c
  3. 2026.02.19 sx1276 spi 통신
  4. 2025.12.16 LoRa modulation basics
  5. 2025.12.16 lora CR(coding rate)
  6. 2025.10.02 lora evk
하드웨어/lora lorawan2026. 2. 27. 18:30

preamble은 빼고 payload + crc 까진 받아볼 수 있다곤 하는데 정작해보니 잘 안된다.

노이즈만 잔뜩.. 멀 빼먹은걸까?

1. Payload CRC 포함 수신 (가장 일반적)
레지스터 설정으로 CRC를 수신 데이터에 포함시킬 수 있습니다.
c// RegModemConfig2 (0x1E) - RxPayloadCrcOn bit 설정
// bit[2] = 1: CRC 활성화
uint8_t config2 = readReg(REG_MODEM_CONFIG_2);
config2 |= (1 << 2);  // RxPayloadCrcOn = 1
writeReg(REG_MODEM_CONFIG_2, config2);
수신 후 CRC 에러 여부 확인:
c// RegIrqFlags (0x12)
// bit[5] = PayloadCrcError
uint8_t irqFlags = readReg(REG_IRQ_FLAGS);
if (irqFlags & (1 << 5)) {
    // CRC 에러
}

2. Implicit Header Mode (헤더 없이 raw payload)
c// RegModemConfig1 (0x1D)
// bit[0] = ImplicitHeaderModeOn
uint8_t config1 = readReg(REG_MODEM_CONFIG_1);
config1 |= 0x01;  // Implicit Header Mode
writeReg(REG_MODEM_CONFIG_1, config1);
Implicit Header Mode에서는:

헤더(Length, CR, CRC 정보)가 전송되지 않음
송수신 양측이 동일한 파라미터를 사전에 알고 있어야 함
FIFO에서 고정 길이의 raw 데이터를 읽음

 

'하드웨어 > lora lorawan' 카테고리의 다른 글

lora driver for stm32 written in c  (0) 2026.02.26
sx1276 spi 통신  (0) 2026.02.19
LoRa modulation basics  (0) 2025.12.16
lora CR(coding rate)  (0) 2025.12.16
lora evk  (0) 2025.10.02
Posted by 구차니
하드웨어/lora lorawan2026. 2. 26. 10:08

매번 찾아도 안나오더니 오늘 검색하니 똭. -_-

구글아 날 괴롭히는거지?

 

아무튼 c로 작성된 녀석인데.. dio 인터럽트는 사용하지 않고

레지스터 읽어서 (0x12 IRQ flag) 처리하는 쪽으로 구성이 된 듯.

 

RECEIVE packet routines
uint8_t  lora_is_packet_available(lora_sx1276 *lora) Checks if packet modem has packet awaiting to be received Returns 0 if no packet is available, or any positive integer in case packet is ready

uint8_t  lora_pending_packet_length(lora_sx1276 *lora); If modem has packet awaiting to be received - returns it's length.

[링크 : https://github.com/belyalov/stm32-hal-libraries/blob/master/doc/lora.md]

[링크 : https://github.com/belyalov/stm32-hal-libraries/tree/master]

'하드웨어 > lora lorawan' 카테고리의 다른 글

sx1276 raw pakcet  (0) 2026.02.27
sx1276 spi 통신  (0) 2026.02.19
LoRa modulation basics  (0) 2025.12.16
lora CR(coding rate)  (0) 2025.12.16
lora evk  (0) 2025.10.02
Posted by 구차니
하드웨어/lora lorawan2026. 2. 19. 15:53

 

CPOL=0 CPHA=0 으로 설정해주고

데이터가 전송되는 동안 NSS를 low로 유지

address 1byte(MSB wnr bit = 1 write, 0 read)

1byte data 로 데이터를 주고 받을수 있는 듯.

 

아쉽게도 통신 확인용 device id 레지스터는 없는 듯 한데..

그나마 그런용도로 쓸만한게 0x42 RegVersion 0x12 로 리턴되나 보면 될 듯

 

+

NRESET 핀을 HIGH로 해주어야 sx1276 이 살아나고

그 외엔 정상적으로 잘 읽는 듯 하다.

void sx1276_read_ver()
{
  uint8_t address = 0x42; // RegVersion
  uint8_t data = 0x00;
  uint16_t len = 1;

  HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1, GPIO_PIN_SET);
  HAL_Delay(500);

  HAL_GPIO_WritePin(NSS_GPIO_Port, NSS_Pin, GPIO_PIN_RESET);
    HAL_SPI_Transmit(&hspi2, &address, len, 100);
    HAL_SPI_Receive(&hspi2, &data, len, 100);
  HAL_GPIO_WritePin(NSS_GPIO_Port, NSS_Pin, GPIO_PIN_SET);

  printf("sx1276 ver %X\r\n", data);
}

 

ver 0 나와서 당황.. -_-

sx1276 ver 0
sx1276 ver 12

'하드웨어 > lora lorawan' 카테고리의 다른 글

sx1276 raw pakcet  (0) 2026.02.27
lora driver for stm32 written in c  (0) 2026.02.26
LoRa modulation basics  (0) 2025.12.16
lora CR(coding rate)  (0) 2025.12.16
lora evk  (0) 2025.10.02
Posted by 구차니
하드웨어/lora lorawan2025. 12. 16. 15:59

먼진 모르겠지만.. FSK 보단 LoRa가 더 좋다고 보면되려나?

동일한 속도를 내려면 lora가 더 신호가 안 좋아도 되고 (약 -10 dBm)

동일한 감도라면 더 빠른 속도를 낼 수 있다. (fsk 1000bps, -123 dBm = LoRa 10000bps)

 

 

[링크 : https://www.frugalprototype.com/wp-content/uploads/2016/08/an1200.22.pdf]

'하드웨어 > lora lorawan' 카테고리의 다른 글

sx1276 raw pakcet  (0) 2026.02.27
lora driver for stm32 written in c  (0) 2026.02.26
sx1276 spi 통신  (0) 2026.02.19
lora CR(coding rate)  (0) 2025.12.16
lora evk  (0) 2025.10.02
Posted by 구차니
하드웨어/lora lorawan2025. 12. 16. 15:46

래핑 모듈만 사용하다 보니, SF / 주파수만 신경썼었는데

sx1276 데이터 시트를 보다보니 CR(Coding Rate)라는게 있어서 먼지 감이 안와서(메뉴얼 상에서는) 찾아보니

 

FEC를 위한 추가 비트를 이야기 하고, 순수데이터/패리티포함데이터 길이로 보면 된다고 한다.

4/5는 4bit data + 1bit parity

4/6은 4bit data + 2bit parity

4/7은 4bit data + 3bit parity

4/8은 4bit data + 4bit parity 식인셈

4.1.1.3. Coding Rate
To further improve the robustness of the link the LoRa® modem employs cyclic error coding to perform forward error
detection and correction. Such error coding incurs a transmission overhead - the resultant additional data overhead per
transmission is shown in the table below.



Forward error correction is particularly efficient in improving the reliability of the link in the presence of interference. So that
the coding rate (and so robustness to interference) can be changed in response to channel conditions - the coding rate can
optionally be included in the packet header for use by the receiver. Please consult Section 4.1.1.6 for more information on
the LoRa® packet and header.

[링크 : https://blog.naver.com/bae3421_/221274850012]

 

FEC - Forward Error Correction

[링크 : http://www.ktword.co.kr/test/view/view.php?no=693]

 

CRC -Cyclic Redundancy Checking

[링크 : http://www.ktword.co.kr/test/view/view.php?nav=2&no=603&sh=crc]

 

FEC는 전송할때 복구를 위한 데이터를 포함하여 전송하여 correction에 포인트를 두는 전송방식이고

CRC는 정정이 아니라 에러가 있음을 확인하는 방법이다.

 

'하드웨어 > lora lorawan' 카테고리의 다른 글

sx1276 raw pakcet  (0) 2026.02.27
lora driver for stm32 written in c  (0) 2026.02.26
sx1276 spi 통신  (0) 2026.02.19
LoRa modulation basics  (0) 2025.12.16
lora evk  (0) 2025.10.02
Posted by 구차니
하드웨어/lora lorawan2025. 10. 2. 15:39

중앙의 뚜껑있는 놈이 stm32L 과 sx1276 통합 모듈, 왼쪽은 stlink 인듯.

 

The B-L072Z-LRWAN1 LoRa®/Sigfox™ Discovery kit is a development tool to learn and develop solutions based on LoRa®, Sigfox™, and FSK/OOK technologies. This Discovery kit features the all-in-one CMWX1ZZABZ-091 open module by Murata. The module is powered by an STM32L072CZ microcontroller and SX1276 transceiver. The transceiver features the LoRa® long-range modem, providing ultra-long-range spread-spectrum communication and high interference immunity, minimizing current consumption. Since CMWX1ZZABZ-091 is an open module, the user has access to all STM32L072CZ peripherals such as ADC, 16-bit timer, LP-UART, I2C, SPI, and USB 2.0 FS (supporting BCD and LPM).

[링크 : https://www.st.com/en/evaluation-tools/b-l072z-lrwan1.html]

 

 

[링크 : https://www.murata.com/en-global/products/connectivitymodule/lpwa/overview/lineup/type-abz-091]

 

FSK (Frequency Shift Keying)
OOK (On-Off Keying)

[링크 : https://blog.naver.com/bruno_annie/220777474513]

 

 

 

 

 

[258199.737417] usb 1-2: new full-speed USB device number 31 using xhci_hcd
[258199.866439] usb 1-2: New USB device found, idVendor=0483, idProduct=374b, bcdDevice= 1.00
[258199.866457] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[258199.866464] usb 1-2: Product: STM32 STLink
[258199.866470] usb 1-2: Manufacturer: STMicroelectronics
[258199.866475] usb 1-2: SerialNumber: 066BFF363637503457160939
[258199.927997] usb-storage 1-2:1.1: USB Mass Storage device detected
[258199.928972] scsi host0: usb-storage 1-2:1.1
[258199.930589] cdc_acm 1-2:1.2: ttyACM0: USB ACM device
[258200.938237] scsi 0:0:0:0: Direct-Access     MBED     microcontroller  1.0  PQ: 0 ANSI: 2
[258200.939003] sd 0:0:0:0: Attached scsi generic sg0 type 0
[258200.940836] sd 0:0:0:0: [sda] 456 512-byte logical blocks: (233 kB/228 KiB)
[258200.941073] sd 0:0:0:0: [sda] Write Protect is off
[258200.941080] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[258200.941299] sd 0:0:0:0: [sda] No Caching mode page found
[258200.941312] sd 0:0:0:0: [sda] Assuming drive cache: write through
[258200.963802] sd 0:0:0:0: [sda] Attached SCSI removable disk

 

[링크 : https://os.mbed.com/platforms/ST-Discovery-LRWAN1/]

[링크 : https://os.mbed.com/teams/ST/code/DISCO-L072CZ-LRWAN1_LoRa_PingPong/]

'하드웨어 > lora lorawan' 카테고리의 다른 글

sx1276 raw pakcet  (0) 2026.02.27
lora driver for stm32 written in c  (0) 2026.02.26
sx1276 spi 통신  (0) 2026.02.19
LoRa modulation basics  (0) 2025.12.16
lora CR(coding rate)  (0) 2025.12.16
Posted by 구차니