You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am trying to carry out this project with the PIRBOX-Lite and the LilyGo LoRa Board gateway (https://github.com/PricelessToolkit/MailBoxGuard) but it is not working for me (in HA the MQTT does not recognize the PIRBOX-Lite). I load the LilyGo LoRa Board code correctly and in MQTT it recognizes it perfectly:
But when it comes to uploading the PIRBOX-Lite code, I cannot see it in MQTT. I see how the LED lights up every time it detects movement but however this entity does not appear in MQTT. I have the feeling that the gateway is not communicating with the PIRBOX-Lite, could someone help me? I have these configuration parameters set, do I have to set different ones? thanks.
// For sending 6 bytes "6 characters" of data using different Spreading Factors (SF), the estimated time on air (ToA)
// for each SF is as follows:
// SF7: Approximately 0.027 seconds (27.494 milliseconds)
// SF8: Approximately 0.052 seconds (52.224 milliseconds)
// SF9: Approximately 0.100 seconds (100.147 milliseconds)
// SF10: Approximately 0.193 seconds (193.413 milliseconds)
// SF11: Approximately 0.385 seconds (385.297 milliseconds)
// SF12: Approximately 0.746 seconds (746.127 milliseconds)
// These calculations demonstrate how the time on air increases with higher Spreading Factors
// due to the decreased data rate, which is a trade-off for increased communication range and signal robustness.
#define SIGNAL_BANDWITH 125E3 // signal bandwidth in Hz, defaults to 125E3
#define SPREADING_FACTOR 11 // ranges from 6-12,default 7 see API docs
#define CODING_RATE 6 // Supported values are between 5 and 8, these correspond to coding rates of 4/5 and 4/8. The coding rate numerator is fixed at 4.
#define SYNC_WORD 0xF3 // byte value to use as the sync word, defaults to 0x12
#define PREAMBLE_LENGTH 12 // Supported values are between 6 and 65535.
#define TX_POWER 20 // TX power in dB, defaults to 17, Supported values are 2 to 20
#define BAND 868E6 // 433E6 / 868E6 / 915E6
#define GATEWAY_KEY "x" // Separation Key "Keep it Short 2 letters is enough"
#define NODE_NAME "Buzon" // Sensor Name which will be visible in Home Assistant
#define Encryption true // Global Payload obfuscation (Encryption)
#define encryption_key_length 4 // must match number of bytes in the XOR key array
#define encryption_key { 0x4B, 0xA3, 0x3F, 0x9C } // Multi-byte XOR key (between 2–16 values).
// Use random-looking HEX values (from 0x00 to 0xFF).
// Must match exactly on both sender and receiver.
// Example: { 0x1F, 0x7E, 0xC2, 0x5A } ➜ 4-byte key.
/////////////////////////// LORA RADIO CONFIG ///////////////////////////
#define BAND 868E6 // 433E6 MHz or 868E6 MHz or 915E6 MHz
#define TX_OUTPUT_POWER 20 // dBm tx output power
#define LORA_BANDWIDTH 125E3 // bandwidth 4: 125Khz, 5: 250KHZ, 6: 500Khz
#define LORA_SPREADING_FACTOR 11 // spreading factor 6-12 [SF5..SF11]
#define LORA_CODINGRATE 6 // [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
#define LORA_PREAMBLE_LENGTH 12 // Same for Tx and Rx
#define LORA_PAYLOADLENGTH 0 // 0: Variable length packet (explicit header), 1..255 for Fixed length packet (implicit header)
#define LORA_CRC_ON true
#define LORA_SYNC_WORD 0xF3 // The 0x1424 private sync word is equivalent to the CapiBridge 0x12 sync word.
// LoRa Sync Word Compatibility Table20
//
// This table shows how 16-bit sync words used on "PirBOX" SX126x-based modules (like Ra-01SH) correspond to the 8-bit sync words used on older SX127x-based modules.
//
// | Type | SX126x Sync Word | SX127x Equivalent | Notes |
// |---------|------------------|-------------------|---------------------------------------------------------------------|
// | Public | 0x3444 | 0x34 | Default for LoRaWAN. Reserved, do not use for private networks. |
// | Private | 0x1424 | 0x12 | Recommended for custom/private networks. |
// | Private | 0x1437 | 0x37 | Custom private network sync word. |
// | Private | 0x14A9 | 0xA9 | Custom private network sync word. |
// | Private | 0x14D5 | 0xD5 | Custom private network sync word. |
//
// Notes:
// - SX126x uses a 16-bit sync word, always starting with 0x14 for compatibility.
// - SX127x uses an 8-bit sync word, derived from the lower byte (0xYZ from 0x14YZ).
// - Avoid 0x3444 (0x34) in private networks — it's reserved for "LoRaWAN public" use.
// - Choose a unique 0x14YZ value for a private network to avoid collisions and improve isolation.
`
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am trying to carry out this project with the PIRBOX-Lite and the LilyGo LoRa Board gateway (https://github.com/PricelessToolkit/MailBoxGuard) but it is not working for me (in HA the MQTT does not recognize the PIRBOX-Lite). I load the LilyGo LoRa Board code correctly and in MQTT it recognizes it perfectly:
But when it comes to uploading the PIRBOX-Lite code, I cannot see it in MQTT. I see how the LED lights up every time it detects movement but however this entity does not appear in MQTT. I have the feeling that the gateway is not communicating with the PIRBOX-Lite, could someone help me? I have these configuration parameters set, do I have to set different ones? thanks.
(1) config.h Gateway:
`/////////////////////////// LoRa Gateway Key ///////////////////////////
#define GATEWAY_KEY "x" // Keep it Tiny
///////////////////////////////////////////////////////////////////////////////
////////////////////////////// WIFI / MQTT ////////////////////////////////////
#define WIFI_SSID "RBB"
#define WIFI_PASSWORD "xxxx"
#define MQTT_USERNAME "nuki"
#define MQTT_PASSWORD "xxxx"
#define MQTT_SERVER "192.168.1.XX"
#define MQTT_PORT 1883
///////////////////////////////////////////////////////////////////////////////
////////////////////////////// LORA CONFIG ////////////////////////////////////
// For sending 6 bytes "6 characters" of data using different Spreading Factors (SF), the estimated time on air (ToA)
// for each SF is as follows:
// SF7: Approximately 0.027 seconds (27.494 milliseconds)
// SF8: Approximately 0.052 seconds (52.224 milliseconds)
// SF9: Approximately 0.100 seconds (100.147 milliseconds)
// SF10: Approximately 0.193 seconds (193.413 milliseconds)
// SF11: Approximately 0.385 seconds (385.297 milliseconds)
// SF12: Approximately 0.746 seconds (746.127 milliseconds)
// These calculations demonstrate how the time on air increases with higher Spreading Factors
// due to the decreased data rate, which is a trade-off for increased communication range and signal robustness.
#define SIGNAL_BANDWITH 125E3 // signal bandwidth in Hz, defaults to 125E3
#define SPREADING_FACTOR 11 // ranges from 6-12,default 7 see API docs
#define CODING_RATE 6 // Supported values are between 5 and 8, these correspond to coding rates of 4/5 and 4/8. The coding rate numerator is fixed at 4.
#define SYNC_WORD 0xF3 // byte value to use as the sync word, defaults to 0x12
#define PREAMBLE_LENGTH 12 // Supported values are between 6 and 65535.
#define TX_POWER 20 // TX power in dB, defaults to 17, Supported values are 2 to 20
#define BAND 868E6 // 433E6 / 868E6 / 915E6
///////////////////////////////////////////////////////////////////////////////`
(2) Config.h PirBox-Lite:
`/////////////////////////// LoRa Gateway Key ///////////////////////////
#define GATEWAY_KEY "x" // Separation Key "Keep it Short 2 letters is enough"
#define NODE_NAME "Buzon" // Sensor Name which will be visible in Home Assistant
#define Encryption true // Global Payload obfuscation (Encryption)
#define encryption_key_length 4 // must match number of bytes in the XOR key array
#define encryption_key { 0x4B, 0xA3, 0x3F, 0x9C } // Multi-byte XOR key (between 2–16 values).
// Use random-looking HEX values (from 0x00 to 0xFF).
// Must match exactly on both sender and receiver.
// Example: { 0x1F, 0x7E, 0xC2, 0x5A } ➜ 4-byte key.
/////////////////////////// LORA RADIO CONFIG ///////////////////////////
#define BAND 868E6 // 433E6 MHz or 868E6 MHz or 915E6 MHz
#define TX_OUTPUT_POWER 20 // dBm tx output power
//| Bandwidth | Supported Spreading Factors |
//|-----------|-----------------------------|
//| 125 kHz | SF5 – SF9 |
//| 250 kHz | SF5 – SF10 |
//| 500 kHz | SF5 – SF11 |
#define LORA_BANDWIDTH 125E3 // bandwidth 4: 125Khz, 5: 250KHZ, 6: 500Khz
#define LORA_SPREADING_FACTOR 11 // spreading factor 6-12 [SF5..SF11]
#define LORA_CODINGRATE 6 // [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
#define LORA_PREAMBLE_LENGTH 12 // Same for Tx and Rx
#define LORA_PAYLOADLENGTH 0 // 0: Variable length packet (explicit header), 1..255 for Fixed length packet (implicit header)
#define LORA_CRC_ON true
#define LORA_SYNC_WORD 0xF3 // The 0x1424 private sync word is equivalent to the CapiBridge 0x12 sync word.
// LoRa Sync Word Compatibility Table20
//
// This table shows how 16-bit sync words used on "PirBOX" SX126x-based modules (like Ra-01SH) correspond to the 8-bit sync words used on older SX127x-based modules.
//
// | Type | SX126x Sync Word | SX127x Equivalent | Notes |
// |---------|------------------|-------------------|---------------------------------------------------------------------|
// | Public |
0x3444|0x34| Default for LoRaWAN. Reserved, do not use for private networks. |// | Private |
0x1424|0x12| Recommended for custom/private networks. |// | Private |
0x1437|0x37| Custom private network sync word. |// | Private |
0x14A9|0xA9| Custom private network sync word. |// | Private |
0x14D5|0xD5| Custom private network sync word. |//
// Notes:
// - SX126x uses a 16-bit sync word, always starting with
0x14for compatibility.// - SX127x uses an 8-bit sync word, derived from the lower byte (
0xYZfrom0x14YZ).// - Avoid
0x3444(0x34) in private networks — it's reserved for "LoRaWAN public" use.// - Choose a unique
0x14YZvalue for a private network to avoid collisions and improve isolation.`
Beta Was this translation helpful? Give feedback.
All reactions