Skip to content
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

EU868 Compile Issue #19

Open
patmolloy opened this issue Oct 12, 2019 · 3 comments
Open

EU868 Compile Issue #19

patmolloy opened this issue Oct 12, 2019 · 3 comments

Comments

@patmolloy
Copy link

I am trying to use OTAA_DHT11.ino on the Heltec Wireless Stick

In LoRaMac-definitions.h is the line ..

#define USE_BAND_915

If I compile everything (in the arduino compiler) it all works, and loads to the board correctly -- but of course on the wrong frequency for my region (915).

So I change this line to

#define USE_BAND_868

and re-compile, I get the following error ...

C:\Users\patmo\OneDrive\Documents\Arduino\libraries\ESP32_LoRaWAN-master\src\LoRaMac.c: In function 'SetNextChannel':

C:\Users\patmo\OneDrive\Documents\Arduino\libraries\ESP32_LoRaWAN-master\src\LoRaMac.c:2038:60: error: expected expression before '==' token

                         if( ( JOIN_CHANNELS & ( 1 << j ) ) == 0 )

                                                            ^

C:\Users\patmo\OneDrive\Documents\Arduino\libraries\ESP32_LoRaWAN-master\src\LoRaMac.c:2038:65: error: expected statement before ')' token

                         if( ( JOIN_CHANNELS & ( 1 << j ) ) == 0 )

                                                                 ^

Can you help?

@patmolloy
Copy link
Author

I have resolved this by including the #defines here https://stackforce.github.io/LoRaMac-doc/group___r_e_g_i_o_n_e_u868.html and changing JOIN_CHANNELS to EU868_JOIN_CHANNELS

This works for EU868 but is NOT a general solution

@legapi
Copy link

legapi commented Oct 12, 2019

I am trying to use OTAA_DHT11.ino on the Heltec Wireless Stick

In LoRaMac-definitions.h is the line ..

#define USE_BAND_915

If I compile everything (in the arduino compiler) it all works, and loads to the board correctly -- but of course on the wrong frequency for my region (915).

So I change this line to

#define USE_BAND_868

and re-compile, I get the following error ...

C:\Users\patmo\OneDrive\Documents\Arduino\libraries\ESP32_LoRaWAN-master\src\LoRaMac.c: In function 'SetNextChannel':

C:\Users\patmo\OneDrive\Documents\Arduino\libraries\ESP32_LoRaWAN-master\src\LoRaMac.c:2038:60: error: expected expression before '==' token

                         if( ( JOIN_CHANNELS & ( 1 << j ) ) == 0 )

                                                            ^

C:\Users\patmo\OneDrive\Documents\Arduino\libraries\ESP32_LoRaWAN-master\src\LoRaMac.c:2038:65: error: expected statement before ')' token

                         if( ( JOIN_CHANNELS & ( 1 << j ) ) == 0 )

                                                                 ^

Can you help?

This error comes from the definition of "JOIN_CHANNELS" at line 490 of LoRaMac-definition.h.
If you compare the 868MHz frequency to 433MHz and 780MHz frequency, you may see more parentheses.

868MHz (line 490)
#define JOIN_CHANNELS ( uint16_t )( LC( 1 ) )| LC( 2 ) | LC( 3 ) )
...where maybe it should be...
#define JOIN_CHANNELS ( uint16_t )( LC( 1 ) | LC( 2 ) | LC( 3 ) )

433MHz (line 142)
#define JOIN_CHANNELS ( uint16_t )( LC( 1 ) | LC( 2 ) | LC( 3 ) )

780MHz (line 361)
#define JOIN_CHANNELS ( uint16_t )( LC( 1 ) | LC( 2 ) | LC( 3 ) )

@patmolloy
Copy link
Author

Brilliant !! Thanks :) That is definitely the issue and your solution is much better than my bodge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants