Closed huzhifeng closed 8 years ago
Hi, I did not run this tests. In my tutorial I explain the baseband is clocked by the other radio, not the default one. In packet forwarder it is modified in global_conf.json file.
In util_tx_test it should be modified in line 121 of util_tx_test.c https://github.com/mirakonta/lora_gateway/blob/master/util_tx_test/src/util_tx_test.c#L121
Tell me if this (clocksource = 0) solves the problem and I will update the repository
Hi @nestorayuso
You are right, it works now when I change "clocksource = 1" to "clocksource = 0" Thanks for your help.
BTW, test_loragw_hal
and test_loragw_cal
have same problem, you'd better fix them before close this issue.
My changes and test logs:
huzhifeng@Ubuntu14:~/lora/mirakonta/lora_gateway$ grep -rwn "clocksource = 1" ./
./util_tx_test/src/util_tx_test.c:121: uint8_t clocksource = 1; /* Radio B is source by default */
./libloragw/tst/test_loragw_hal.c:101: uint8_t clocksource = 1; /* Radio B is source by default */
./libloragw/tst/test_loragw_cal.c:145: uint8_t clocksource = 1; /* Radio B is source by default */
huzhifeng@Ubuntu14:~/lora/mirakonta/lora_gateway$ grep -rwl "clocksource = " ./ | xargs sed -i "s/clocksource = 1/clocksource = 0/g"
huzhifeng@Ubuntu14:~/lora/mirakonta/lora_gateway$ git diff
diff --git a/libloragw/tst/test_loragw_cal.c b/libloragw/tst/test_loragw_cal.c
index fe8c140..8d36fc1 100644
--- a/libloragw/tst/test_loragw_cal.c
+++ b/libloragw/tst/test_loragw_cal.c
@@ -142,7 +142,7 @@ int main(int argc, char **argv)
double xd = 0.0;
uint32_t fa = 0, fb = 0;
enum lgw_radio_type_e radio_type = LGW_RADIO_TYPE_NONE;
- uint8_t clocksource = 1; /* Radio B is source by default */
+ uint8_t clocksource = 0; /* Radio B is source by default */
uint8_t tx_enable = 0;
int nb_cal = 5;
diff --git a/libloragw/tst/test_loragw_hal.c b/libloragw/tst/test_loragw_hal.c
index 62dc115..e4f6129 100644
--- a/libloragw/tst/test_loragw_hal.c
+++ b/libloragw/tst/test_loragw_hal.c
@@ -98,7 +98,7 @@ int main(int argc, char **argv)
int nb_pkt;
uint32_t fa = 0, fb = 0, ft = 0;
enum lgw_radio_type_e radio_type = LGW_RADIO_TYPE_NONE;
- uint8_t clocksource = 1; /* Radio B is source by default */
+ uint8_t clocksource = 0; /* Radio B is source by default */
uint32_t tx_cnt = 0;
unsigned long loop_cnt = 0;
diff --git a/util_tx_test/src/util_tx_test.c b/util_tx_test/src/util_tx_test.c
index f4166aa..f5c681b 100644
--- a/util_tx_test/src/util_tx_test.c
+++ b/util_tx_test/src/util_tx_test.c
@@ -118,7 +118,7 @@ int main(int argc, char **argv)
/* RF configuration (TX fail if RF chain is not enabled) */
enum lgw_radio_type_e radio_type = LGW_RADIO_TYPE_NONE;
- uint8_t clocksource = 1; /* Radio B is source by default */
+ uint8_t clocksource = 0; /* Radio B is source by default */
struct lgw_conf_board_s boardconf;
struct lgw_conf_rxrf_s rfconf;
huzhifeng@Ubuntu14:~/lora/mirakonta/lora_gateway$ make clean all
huzhifeng@Ubuntu14:~/lora/mirakonta/lora_gateway$ ./util_tx_test/util_tx_test -r 1257 -f 868
Sending -1 packets on 868000000 Hz (BW 125 kHz, SF 10, CR 1, 16 bytes payload, 8 symbols preamble) at 14 dBm, with 1000 ms between each
INFO: concentrator started, packet can be sent
Sending packet number 1 ...OK
Sending packet number 2 ...OK
Sending packet number 3 ...OK
Sending packet number 4 ...OK
Sending packet number 5 ...OK
Sending packet number 6 ...OK
Sending packet number 7 ...OK
^CExiting LoRa concentrator TX test program
huzhifeng@Ubuntu14:~/lora/mirakonta/lora_gateway$
huzhifeng@Ubuntu14:~/lora/mirakonta/lora_gateway$ ./libloragw/test_loragw_hal -a 868.1 -b 868.3 -t 868 -r 1257
Beginning of test for loragw_hal.c
*** Library version information ***
Version: 3.1.0; Options: ftdi;
*** Concentrator started ***
+++
Sending packet #0, rf path 0, return 0
status -> 4:2:
TX finished
+++
Sending packet #1, rf path 0, return 0
status -> 4:2:
TX finished
+++
Sending packet #2, rf path 0, return 0
status -> 4:2:
TX finished
^C
End of test for loragw_hal.c
huzhifeng@Ubuntu14:~/lora/mirakonta/lora_gateway$ ./libloragw/test_loragw_cal -a 868.1 -b 868.3 -t 868 -r 1257
Library version information: Version: 3.1.0; Options: ftdi;
Radio type: 2
Radio A frequency: 868.100000 MHz
Radio B frequency: 868.300000 MHz
Number of calibration iterations: 5
Calibration command: brd: 0, chip: 1257, dac: 3
fixed in test_loragw_hal and test_loragw_cal too.
Hi @nestorayuso Wiki page is really an awesome tutorial. I'm following the Part 3: Compile LoRa gateway software to setup my own LoRa gateway, the only difference is that i'm using Ubuntu 14.04 instead of Raspberry-Pi, packet_forwarder(basic_pkt_fwd) works as expected, but util_tx_test, test_loragw_hal and test_loragw_cal report "ERROR: Version of calibration firmware not expected, actual:4 expected:2"
Below is the detail, any suggestions will be appreciated, thanks.