Skip to content

EU433 Support #1008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
- [Selecting V1.0.2](#selecting-v102)
- [Selecting V1.0.3](#selecting-v103)
- [Selecting the LoRaWAN Region Configuration](#selecting-the-lorawan-region-configuration)
- [eu868, as923, in866, kr920](#eu868-as923-in866-kr920)
- [eu868, as923, in866, kr920, eu433](#eu868-as923-in866-kr920-eu433)
- [us915, au915](#us915-au915)
- [Selecting the target radio transceiver](#selecting-the-target-radio-transceiver)
- [Controlling use of interrupts](#controlling-use-of-interrupts)
Expand Down Expand Up @@ -257,6 +257,7 @@ The library supports the following regions:
------------|-----------------|:----------------:|:-------------------:|--------
`-D CFG_eu868` | `LMIC_REGION_eu868` | 1 | 2.2 | EU 863-870 MHz ISM
`-D CFG_us915` | `LMIC_REGION_us915` | 2 | 2.3 | US 902-928 MHz ISM
`-D CFG_eu433` | `LMIC_REGION_eu433` | 4 | 2.5 | EU 433-434 MHz ISM
`-D CFG_au915` | `LMIC_REGION_au915` | 5 | 2.6 | Australia 915-928 MHz ISM
`-D CFG_as923` | `LMIC_REGION_as923` | 7 | 2.8 | Asia 923 MHz ISM
`-D CFG_as923jp` | `LMIC_REGION_as923` and `LMIC_COUNTRY_CODE_JP` | 7 | 2.8 | Asia 923 MHz ISM with Japan listen-before-talk (LBT) rules
Expand All @@ -269,7 +270,7 @@ MCCI BSPs add menu entries to the Arduino IDE so you can select the target regio

The library changes configuration pretty substantially according to the region selected, and this affects the symbols in-scope in your sketches and `.cpp` files. Some of the differences are listed below. This list is not comprehensive, and is subject to change in future major releases.

#### eu868, as923, in866, kr920
#### eu868, as923, in866, kr920, eu433

If the library is configured for EU868, AS923, or IN866 operation, we make
the following changes:
Expand Down
1 change: 1 addition & 0 deletions project_config/lmic_project_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// #define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP /* for as923-JP; also define CFG_as923 */
//#define CFG_kr920 1
//#define CFG_in866 1
//#define CFG_eu433 1
#define CFG_sx1276_radio 1
//#define CFG_sx1261_radio 1
//#define CFG_sx1262_radio 1
Expand Down
2 changes: 2 additions & 0 deletions src/lmic/lmic_bandplan.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
# include "lmic_bandplan_kr920.h"
#elif defined(CFG_in866)
# include "lmic_bandplan_in866.h"
#elif defined(CFG_eu433)
# include "lmic_bandplan_eu433.h"
#else
# error "CFG_... not properly set for bandplan"
#endif
Expand Down
92 changes: 92 additions & 0 deletions src/lmic/lmic_bandplan_eu433.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* Copyright (c) 2014-2016 IBM Corporation.
* Copyright (c) 2017, 2019-2021 MCCI Corporation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef _lmic_eu433_h_
# define _lmic_eu433_h_

#ifndef _lmic_eu_like_h_
# include "lmic_eu_like.h"
#endif

// return maximum frame length (including PHY header) for this data rate (eu433); 0 --> not valid dr.
uint8_t LMICeu433_maxFrameLen(uint8_t dr);
// return maximum frame length (including PHY header) for this data rate; 0 --> not valid dr.
#define LMICbandplan_maxFrameLen(dr) LMICeu433_maxFrameLen(dr)

int8_t LMICeu433_pow2dBm(uint8_t mcmd_ladr_p1);
#define pow2dBm(mcmd_ladr_p1) LMICeu433_pow2dBm(mcmd_ladr_p1)

// Times for half symbol per DR
// Per DR table to minimize rounding errors
ostime_t LMICeu433_dr2hsym(uint8_t dr);
#define dr2hsym(dr) LMICeu433_dr2hsym(dr)

static inline int
LMICeu433_isValidBeacon1(const uint8_t *d) {
return d[OFF_BCN_CRC1] != (u1_t)os_crc16(d, OFF_BCN_CRC1);
}

#undef LMICbandplan_isValidBeacon1
#define LMICbandplan_isValidBeacon1(pFrame) LMICeu433_isValidBeacon1(pFrame)

// override default for LMICbandplan_isFSK()
#undef LMICbandplan_isFSK
#define LMICbandplan_isFSK() (/* RX datarate */LMIC.dndr == EU433_DR_FSK)

#define LMICbandplan_getInitialDrJoin() (EU433_DR_SF7)

void LMICeu433_setBcnRxParams(void);
#define LMICbandplan_setBcnRxParams() LMICeu433_setBcnRxParams()

u4_t LMICeu433_convFreq(xref2cu1_t ptr);
#define LMICbandplan_convFreq(ptr) LMICeu433_convFreq(ptr)

void LMICeu433_initJoinLoop(void);
#define LMICbandplan_initJoinLoop() LMICeu433_initJoinLoop()

ostime_t LMICeu433_nextTx(ostime_t now);
#define LMICbandplan_nextTx(now) LMICeu433_nextTx(now)

ostime_t LMICeu433_nextJoinState(void);
#define LMICbandplan_nextJoinState() LMICeu433_nextJoinState()

void LMICeu433_initDefaultChannels(bit_t join);
#define LMICbandplan_initDefaultChannels(join) LMICeu433_initDefaultChannels(join)

#undef LMICbandplan_nextJoinTime
ostime_t LMICeu433_nextJoinTime(ostime_t now);
#define LMICbandplan_nextJoinTime(now) LMICeu433_nextJoinTime(now)

void LMICeu433_setRx1Params(void);
#define LMICbandplan_setRx1Params() LMICeu433_setRx1Params()

#undef LMICbandplan_validDR
bit_t LMICeu433_validDR(dr_t dr);
#define LMICbandplan_validDR(dr) LMICeu433_validDR(dr)

#endif // _lmic_eu433_h_
2 changes: 1 addition & 1 deletion src/lmic/lmic_config_preconditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Revision history:
(1 << LMIC_REGION_eu868) | \
(1 << LMIC_REGION_us915) | \
/* (1 << LMIC_REGION_cn783) | */ \
/* (1 << LMIC_REGION_eu433) | */ \
(1 << LMIC_REGION_eu433) | \
(1 << LMIC_REGION_au915) | \
/* (1 << LMIC_REGION_cn490) | */ \
(1 << LMIC_REGION_as923) | \
Expand Down
Loading