whitecatboard / Lua-RTOS-ESP32

Lua RTOS for ESP32
Other
1.2k stars 221 forks source link

Selecting LUA_RTOS_LORA_NODE_BAND_US915=y fails to compile. #22

Closed jcwren closed 7 years ago

jcwren commented 7 years ago

This is with commit 799b155. Selecting LUA_RTOS_LORA_NODE_BAND_EU868=y succeeds.

CC node/lmic/aes.o
CC node/lmic/lmic.o
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.c: In function 'decodeFrame':
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.c:1126:17: warning: unused variable 'window' [-Wunused-variable]
     const char *window = (LMIC.txrxFlags & TXRX_DNW1) ? "RX1" : ((LMIC.txrxFlags & TXRX_DNW2) ? "RX2" : "Other");
                 ^
CC node/lmic/lmic_hal.o
CC node/lmic/lora_lmic.o
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:117:2: error: 'DR_SF12' undeclared here (not in a function)
  DR_SF12, DR_SF11, DR_SF10, DR_SF9, DR_SF8, DR_SF7, DR_SF7B, DR_FSK
  ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:117:11: error: 'DR_SF11' undeclared here (not in a function)
  DR_SF12, DR_SF11, DR_SF10, DR_SF9, DR_SF8, DR_SF7, DR_SF7B, DR_FSK
           ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:117:53: error: 'DR_SF7B' undeclared here (not in a function)
  DR_SF12, DR_SF11, DR_SF10, DR_SF9, DR_SF8, DR_SF7, DR_SF7B, DR_FSK
                                                     ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:117:62: error: 'DR_FSK' undeclared here (not in a function)
  DR_SF12, DR_SF11, DR_SF10, DR_SF9, DR_SF8, DR_SF7, DR_SF7B, DR_FSK
                                                              ^
In file included from /Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:56:0:
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c: In function 'lora_init':
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:47: error: invalid operands to binary << (have 'int' and 'const u1_t * {aka const unsigned char *}')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                               ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:218:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(0, 868100000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:57: error: invalid operands to binary & (have 'const u1_t * {aka const unsigned char *}' and 'int')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                         ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:218:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(0, 868100000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:218:70: error: 'BAND_CENTI' undeclared (first use in this function)
      LMIC_setupChannel(0, 868100000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:218:70: note: each undeclared identifier is reported only once for each function it appears in
In file included from /Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:56:0:
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:33: warning: passing argument 3 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                 ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:218:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(0, 868100000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 'u2_t {aka short unsigned int}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:218:70: warning: passing argument 4 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
      LMIC_setupChannel(0, 868100000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                                                      ^
In file included from /Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:56:0:
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 's1_t {aka signed char}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:47: error: invalid operands to binary << (have 'int' and 'const u1_t * {aka const unsigned char *}')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                               ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:219:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(1, 868300000, DR_RANGE_MAP(DR_SF12, DR_SF7B), BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:77: error: invalid operands to binary - (have 'int' and 'const u1_t * {aka const unsigned char *}')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                                             ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:219:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(1, 868300000, DR_RANGE_MAP(DR_SF12, DR_SF7B), BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:72: error: invalid operands to binary >> (have 'int' and 'const u1_t * {aka const unsigned char *}')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                                        ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:219:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(1, 868300000, DR_RANGE_MAP(DR_SF12, DR_SF7B), BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:57: error: invalid operands to binary & (have 'const u1_t * {aka const unsigned char *}' and 'const u1_t * {aka const unsigned char *}')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                         ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:219:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(1, 868300000, DR_RANGE_MAP(DR_SF12, DR_SF7B), BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:33: warning: passing argument 3 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                 ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:219:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(1, 868300000, DR_RANGE_MAP(DR_SF12, DR_SF7B), BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 'u2_t {aka short unsigned int}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:219:70: warning: passing argument 4 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
      LMIC_setupChannel(1, 868300000, DR_RANGE_MAP(DR_SF12, DR_SF7B), BAND_CENTI);
                                                                      ^
In file included from /Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:56:0:
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 's1_t {aka signed char}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:47: error: invalid operands to binary << (have 'int' and 'const u1_t * {aka const unsigned char *}')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                               ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:220:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(2, 868500000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:57: error: invalid operands to binary & (have 'const u1_t * {aka const unsigned char *}' and 'int')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                         ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:220:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(2, 868500000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:33: warning: passing argument 3 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                 ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:220:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(2, 868500000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 'u2_t {aka short unsigned int}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:220:70: warning: passing argument 4 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
      LMIC_setupChannel(2, 868500000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                                                      ^
In file included from /Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:56:0:
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 's1_t {aka signed char}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:47: error: invalid operands to binary << (have 'int' and 'const u1_t * {aka const unsigned char *}')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                               ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:221:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(3, 867100000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:57: error: invalid operands to binary & (have 'const u1_t * {aka const unsigned char *}' and 'int')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                         ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:221:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(3, 867100000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:33: warning: passing argument 3 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                 ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:221:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(3, 867100000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 'u2_t {aka short unsigned int}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:221:70: warning: passing argument 4 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
      LMIC_setupChannel(3, 867100000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                                                      ^
In file included from /Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:56:0:
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 's1_t {aka signed char}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:47: error: invalid operands to binary << (have 'int' and 'const u1_t * {aka const unsigned char *}')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                               ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:222:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(4, 867300000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:57: error: invalid operands to binary & (have 'const u1_t * {aka const unsigned char *}' and 'int')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                         ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:222:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(4, 867300000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:33: warning: passing argument 3 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                 ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:222:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(4, 867300000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 'u2_t {aka short unsigned int}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:222:70: warning: passing argument 4 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
      LMIC_setupChannel(4, 867300000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                                                      ^
In file included from /Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:56:0:
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 's1_t {aka signed char}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:47: error: invalid operands to binary << (have 'int' and 'const u1_t * {aka const unsigned char *}')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                               ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:223:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(5, 867500000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:57: error: invalid operands to binary & (have 'const u1_t * {aka const unsigned char *}' and 'int')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                         ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:223:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(5, 867500000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:33: warning: passing argument 3 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                 ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:223:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(5, 867500000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 'u2_t {aka short unsigned int}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:223:70: warning: passing argument 4 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
      LMIC_setupChannel(5, 867500000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                                                      ^
In file included from /Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:56:0:
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 's1_t {aka signed char}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:47: error: invalid operands to binary << (have 'int' and 'const u1_t * {aka const unsigned char *}')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                               ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:224:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(6, 867700000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:57: error: invalid operands to binary & (have 'const u1_t * {aka const unsigned char *}' and 'int')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                         ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:224:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(6, 867700000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:33: warning: passing argument 3 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                 ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:224:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(6, 867700000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 'u2_t {aka short unsigned int}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:224:70: warning: passing argument 4 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
      LMIC_setupChannel(6, 867700000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                                                      ^
In file included from /Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:56:0:
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 's1_t {aka signed char}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:47: error: invalid operands to binary << (have 'int' and 'const u1_t * {aka const unsigned char *}')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                               ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:225:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(7, 867900000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:57: error: invalid operands to binary & (have 'const u1_t * {aka const unsigned char *}' and 'int')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                         ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:225:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(7, 867900000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:33: warning: passing argument 3 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                 ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:225:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(7, 867900000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 'u2_t {aka short unsigned int}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:225:70: warning: passing argument 4 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
      LMIC_setupChannel(7, 867900000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);
                                                                      ^
In file included from /Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:56:0:
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 's1_t {aka signed char}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:47: error: invalid operands to binary << (have 'int' and 'const u1_t * {aka const unsigned char *}')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                               ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:226:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK,  DR_FSK),  BAND_MILLI); 
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:77: error: invalid operands to binary - (have 'int' and 'const u1_t * {aka const unsigned char *}')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                                             ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:226:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK,  DR_FSK),  BAND_MILLI); 
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:72: error: invalid operands to binary >> (have 'int' and 'const u1_t * {aka const unsigned char *}')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                                        ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:226:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK,  DR_FSK),  BAND_MILLI); 
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:57: error: invalid operands to binary & (have 'const u1_t * {aka const unsigned char *}' and 'const u1_t * {aka const unsigned char *}')
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                         ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:226:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK,  DR_FSK),  BAND_MILLI); 
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:226:70: error: 'BAND_MILLI' undeclared (first use in this function)
      LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK,  DR_FSK),  BAND_MILLI); 
                                                                      ^
In file included from /Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:56:0:
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:270:33: warning: passing argument 3 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                 ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:226:38: note: in expansion of macro 'DR_RANGE_MAP'
      LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK,  DR_FSK),  BAND_MILLI); 
                                      ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 'u2_t {aka short unsigned int}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:226:70: warning: passing argument 4 of 'LMIC_setupChannel' makes integer from pointer without a cast [-Wint-conversion]
      LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK,  DR_FSK),  BAND_MILLI); 
                                                                      ^
In file included from /Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:56:0:
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lmic.h:275:7: note: expected 's1_t {aka signed char}' but argument is of type 'const u1_t * {aka const unsigned char *}'
 bit_t LMIC_setupChannel (u1_t channel, u4_t freq, u2_t drmap, s1_t band);
       ^
/Users/jcw/esp/Lua-RTOS-ESP32/components/lora/./node/lmic/lora_lmic.c:240:16: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
     current_dr = DR_SF12;
                ^
make[1]: *** [node/lmic/lora_lmic.o] Error 1
make: *** [lora-build] Error 2
mbpro:Lua-RTOS-ESP32 $
jolivepetrus commented 7 years ago

@jcwren, many thanks for report this.

The compilation issue is solved in https://github.com/whitecatboard/Lua-RTOS-ESP32/commit/0ee3fa89f7dee733835d1615ae72f83d88ce36c4.

This commit solves the issue, but it's not tested because we can't use this band in our location. Please send us your feedback.

jcwren commented 7 years ago

I've gotten it to compile, but having an issue trying to pass BAND915 to lora.setup(). I need to qualify this by saying at the moment I do not have an SX1276 actually wired to the board. If the setup() call is failing due to reading back a register, perhaps there should be a call that allows checking if the SX1276 is actually present or not? Maybe read the silicon version register or something like that (this is why I like I2C over SPI; I2C will return a timeout)

Update: Here's the problem. 915 isn't tested.

static int llora_setup(lua_State* L) {
  driver_error_t *error;

    int band = luaL_checkinteger(L, 1);

    // Sanity checks
    if ((band != 868) && (band != 433)) {
        return luaL_error(L, "%d:invalid band", LORA_ERR_INVALID_ARGUMENT);
    }

    // Setup in base of frequency
    error = lora_setup(band);
    if (error) {
        return luaL_driver_error(L, error);
    }

    return 0;
}
  /\       /\
 /  \_____/  \
/_____________\
W H I T E C A T

Lua RTOS beta 0.1 build 1492979468 Copyright (C) 2015 - 2017 whitecatboard.org
board type ESP32THING
cpu ESP32 rev 0 at 240 Mhz
spiffs0 start address at 0x180000, size 512 Kb
spiffs0 mounted

Lua RTOS beta 0.1 powered by Lua 5.3.4

Executing /system.lua ...
Executing /autorun.lua ...

/ > lora.setup(lora.BAND868)
invalid band for your location
stdin:1: 100663307:invalid band for your location
stack traceback:
    [C]: in field 'setup'
    stdin:1: in main chunk
    [C]: in ?
/ > 
lora.setup(lora.BAND915)
stdin:2: 100663305:invalid band
stack traceback:
    [C]: in field 'setup'
    stdin:2: in main chunk
    [C]: in ?
/ > 
lora.setup(lora.BAND433)
invalid band for your location
stdin:2: 100663307:invalid band for your location
stack traceback:
    [C]: in field 'setup'
    stdin:2: in main chunk
    [C]: in ?
/ > 
lora.setup(lora.BAND123)
stdin:2: bad argument #1 to 'setup' (number expected, got nil)
stack traceback:
    [C]: in field 'setup'
    stdin:2: in main chunk
    [C]: in ?
/ >
jolivepetrus commented 7 years ago

Please, attach your sdkconfig file.

jcwren commented 7 years ago

I can do that when I get home this evening. However, the problem line is if ((band != 868) && (band != 433)) { in ./components/lua_rtos/Lua/module/lora.c, where it's not permitting 915 as a valid value.

jolivepetrus commented 7 years ago

Yes, you are right. Please, try with this commit https://github.com/whitecatboard/Lua-RTOS-ESP32/commit/e330d2ebe87490991f8cb457cd3d81430472f614.

jolivepetrus commented 7 years ago

Let me to close this issue. No feedback were provided.

jcwren commented 7 years ago

Sorry about that. I've had to temporarily preempt this project and haven't been able to test it. If I find an issue, I'll re-open it. Thanks.