Hi - I’m new to this, so please be gentle.
I have a pair of Sparkfun Lora Gateway-1-ch(ESP32) which I’m trying to configure.
I have followed the hookup instructions and now have 1 board configured as a gateway (on wifi - serving a webpage)
The other board is configured as a device - showing period transmissions - see below
1097454844: engineUpdate, opmode=0x808
1097454866: Unknown event
1097454868: engineUpdate, opmode=0x888
1097454933: TXMODE, freq=905700000, len=26, SF=7, BW=125, CR=4/5, IH=0
Packet queued
1097521196: setupRx1 txrxFlags 0x20 → 01
start single rx: now-rxtime: 4
1097521327: RXMODE_SINGLE, freq=923900000, SF=7, BW=500, CR=4/5, IH=0
rxtimeout: entry: 1097521412 rxtime: 1097521321 entry-rxtime: 91 now-entry: 4 rxtime-txend: 62524
1097584056: setupRx2 txrxFlags 0x1 → 02
start single rx: now-rxtime: 3
1097584187: RXMODE_SINGLE, freq=923300000, SF=9, BW=125, CR=4/5, IH=0
rxtimeout: entry: 1097585484 rxtime: 1097584181 entry-rxtime: 1303 now-entry: 3 rxtime-txend: 125384
1097585500: processRx2DnData txrxFlags 0x2 → 00
1097727762: processDnData txrxFlags 00 → 20
1097727765: EV_TXCOMPLETE (includes waiting for RX windows)
1097727768: engineUpdate, opmode=0x800
Specific questions - how do I interpret this output?
Line 4 looks like it is transmitting (TXMODE) on 905700000 len 26 , SF 7 BW 125 kHZ - where is that frequency set?
so I assume this is transmitting 26 bytes (? including the ‘hello world’ message plus some meta data)
the rest looks like receive window data
Rx 1 is waiting for data on 923900000 with SF7
Rx 2 is waiting for data on 923300000 with SF9
is that correct?
lmic_project_config.h looks like this
// project-specific definitions
//#define CFG_eu868 1
#define CFG_us915 1
//#define CFG_au921 1
//#define CFG_as923 1
// #define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP /* for as923-JP */
//#define CFG_in866 1
#define CFG_sx1276_radio 1
//#define LMIC_USE_INTERRUPTS
#define LMIC_DEBUG_LEVEL 2
ESP-1CH-TTN_DEVICE_APB has the following modifications (as per instructions)
Const lmic_pinmap (as per the hookup notes)
BUT *******
Where the hookup notes say // first diable all sub-bands
// First disable all sub-bands
for (int b = 0; b < 8; ++b) {
LMIC_disableSubBand(b);
}
// Then enable the channel(s) you want to use
LMIC_enableChannel(8); // 903.9 MHz
My code says
// First disable all sub-bands
for (int b = 0; b < 8; ++b) {
LMIC_disableSubBand(b);
}
// Then enable the channel(s) you want to use
//LMIC_enableChannel(8); // 903.9 MHz
LMIC_enableChannel(17);
#endif
I don’t understand this bit at all - (not got my head around the channel numbers - doesn’t seem to relate to anything I’ve found online)
What channel do I want to use for Australia?
The gateway is configured ( as per the instructions ) - like this
Version = V.5.3.3.H; 180825a
ESP-sc_gway.h TAB
DUSB 1
_LFREQ 915
_SPREADING SF9
_CAD 0
_PIN_OUT 6
_STRICT_1CH 0
CFG sx1276 radio
(all the WiFi and TTN are configured and ? working)
loraModem.h TAB
struct pins { etc has been copied and inserted as per instructions)
Int freqa array looks like this
int freqs [] = {
868100000, // Channel 0, 868.1 MHz/125 primary
868300000, // Channel 1, 868.3 MHz mandatory
868500000, // Channel 2, 868.5 MHz mandatory
867100000, // Channel 3, 867.1 MHz Optional
867300000, // Channel 4, 867.3 MHz Optional
867500000, // Channel 5, 867.5 MHz Optional
867700000, // Channel 6, 867.7 MHz Optional
867900000, // Channel 7, 867.9 MHz Optional
868800000, // Channel 8, 868.9 MHz/125 Optional
869525000 // Channel 9, 869.5 MHz/125 for RX2 responses SF9(10%)
// TTN defines an additional channel at 869.525Mhz using SF9 for class B. Not used
};
#elif _LFREQ==433
// The following 3 frequencies should be defined/used in an EU433
// environment.
int freqs [] = {
433175000, // Channel 0, 433.175 MHz/125 primary
433375000, // Channel 1, 433.375 MHz primary
433575000, // Channel 2, 433.575 MHz primary
433775000, // Channel 3, 433.775 MHz primary
433975000, // Channel 4, 433.975 MHz primary
434175000, // Channel 5, 434.175 MHz primary
434375000, // Channel 6, 434.375 MHz primary
434575000, // Channel 7, 434.575 MHz primary
434775000 // Channel 8, 434.775 MHz primary
};
#elif _LFREQ==915
// US902=928
// AU915-928
int freqs [] = {
// Uplink
903900000, // Channel 0, SF7BW125 to SF10BW125 primary
904100000, // Ch 1, SF7BW125 to SF10BW125
904300000, // Ch 2, SF7BW125 to SF10BW125
904500000, // Ch 3, SF7BW125 to SF10BW125
904700000, // Ch 4, SF7BW125 to SF10BW125
904900000, // Ch 5, SF7BW125 to SF10BW125
905100000, // Ch 6, SF7BW125 to SF10BW125
905100000, // Ch 7, SF7BW125 to SF10BW125
904600000 // Ch 8, SF8BW500
// Downlink
// We should specify downlink frequencies here
// SFxxxBW500
};
#else
int freqs [] = {
// Print an Error, Not supported
#error "Sorry, but your frequency plan is not supported"
};
#endif
uint32_t freq = freqs[0];
uint8_t ifreq = 0; // Channel Index
I’m not sure if I’m supposed to comment any of these out or not?
Both sketches compile and upload fine - the gateway webpage runs - and shows the following settings
CAD = ON
HOP = OFF
SF Setting = AUTO
Channel = 0
…
WWW Refresh = ON
The message History shows 1 message (which I don’t think was me - but I don’t know for sure)
Saturday 26-9-2020 03:53:55 4f c5 dd 72 0 903900000 7 -118
Now I’m stuck as to what to do next.
My device appears to be transmitting (both have antenna by the way) - as per the Tx example shown above - but I’m not seeing any activity on the webpage at all (apart from the regular refresh).
So - specific questions
What channel (and other) settings should I use for Australia
Where can I find something more specific on how channels relate to frequencies (what Ch no. os which frequency? - Is that just the centre frequency? (I assume it is)
Should I expect to see any received messages on the webpage - or should I add a serial port
I’m sure many other beginners have had the same or similar questions - please don’t assume I know ANYTHING when answering any of this - your answers could help many people.
Many thanks in advance