2022-10-27 02:10 AM
/* Defines ---------------------------------------------------------------*/
#define XTAL_OFFSET_PPM 0
#define INFINITE_TIMEOUT 0.0
#define BASE_FREQUENCY 868.0e6
#define CHANNEL_SPACE 100e3
#define CHANNEL_NUMBER 0
#define DATARATE 38400
#define FREQ_DEVIATION 20e3
#define BANDWIDTH 100E3
#define POWER_INDEX 7
#define RECEIVE_TIMEOUT 2000.0 /*change the value for required timeout period*/
#define RSSI_THRESHOLD -120 /* Default RSSI at reception, more
than noise floor */
#define CSMA_RSSI_THRESHOLD -90 /* Higher RSSI to Transmit.
If it's lower, the Channel will be seen as busy */
/* Packet configuration parameters */
#define SYNC_WORD 0x88888888
#define LENGTH_WIDTH 7
#define CRC_MODE PKT_CRC_MODE_8BITS
#define EN_FEC S_DISABLE
#define EN_WHITENING S_ENABLE
#define MODULATION_SELECT MOD_2FSK
#define POWER_DBM 16.0
#define PREAMBLE_LENGTH PREAMBLE_BYTE(4)
#define SYNC_LENGTH SYNC_BYTE(4)
#define CONTROL_LENGTH 0x00 //PKT_CONTROL_LENGTH_0BYTES
#define VARIABLE_LENGTH S_ENABLE
#define EXTENDED_LENGTH_FIELD S_DISABLE
#define PREAMBLE_BYTE(v) (4*v)
#define SYNC_BYTE(v) (8*v)
#define VARIABLE_LENGTH S_ENABLE
#ifndef USE_BASIC_PROTOCOL_ADDRESS
/* Addresses configuration parameters */
#define EN_ADDRESS S_DISABLE
#define EN_FILT_MY_ADDRESS S_DISABLE
#define EN_FILT_MULTICAST_ADDRESS S_DISABLE
#define EN_FILT_BROADCAST_ADDRESS S_DISABLE
#define EN_FILT_SOURCE_ADDRESS S_DISABLE//S_ENABLE
#define SOURCE_ADDR_MASK 0xf0
#define SOURCE_ADDR_REF 0x37
#define MULTICAST_ADDRESS 0xEE
#define BROADCAST_ADDRESS 0xFF
#else
#define EN_ADDRESS S_ENABLE
#define EN_FILT_MY_ADDRESS S_ENABLE
#define EN_FILT_MULTICAST_ADDRESS S_ENABLE
#define EN_FILT_BROADCAST_ADDRESS S_ENABLE
#define EN_FILT_SOURCE_ADDRESS S_ENABLE
#define SOURCE_ADDR_MASK 0xf0
#define SOURCE_ADDR_REF 0x37
#define MULTICAST_ADDRESS 0xEE
#define BROADCAST_ADDRESS 0xFF
#endif
#define EN_AUTOACK S_DISABLE
#define EN_PIGGYBACKING S_DISABLE
#define MAX_RETRANSMISSIONS PKT_DISABLE_RETX
#define PAYLOAD_LEN 25 /*20 bytes data + tag + cmd_type + cmd + cmdlen + datalen*/
#define APPLI_CMD 0x11
#define NWK_CMD 0x22
#define LED_TOGGLE 0xff
#define ACK_OK 0x01
#define MAX_BUFFER_LEN 96
#define TIME_TO_EXIT_RX 3000
#define DELAY_RX_LED_TOGGLE 100
#define DELAY_TX_LED_GLOW 100
#define LPM_WAKEUP_TIME 100
#define DATA_SEND_TIME 50
2022-10-27 02:13 AM
>>I would like to be able to reach a communication distance between 2 devices that is at least 1 KM.
To improve your link budget:
Lower the base frecuency as much as possible (if the antenna allows it), ive seen youre in the 868MHZ area, try going down to the 433Mhz zone.(if allowed in your country)
depending of how noisy is your 1Km and whats your acceptable data troughput you could try out other modulations such as ASK
2022-10-27 02:36 AM
Dear Javier,
thanks for the reply, i was also wondering if it is worth reducing the bandwidth and baud rate (current 38400). In any case I will do other tests with the changes you suggested and update you.
BR