Closed jcwren closed 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.
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 ?
/ >
Please, attach your sdkconfig file.
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.
Yes, you are right. Please, try with this commit https://github.com/whitecatboard/Lua-RTOS-ESP32/commit/e330d2ebe87490991f8cb457cd3d81430472f614.
Let me to close this issue. No feedback were provided.
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.
This is with commit 799b155. Selecting LUA_RTOS_LORA_NODE_BAND_EU868=y succeeds.