Code Monkey home page Code Monkey logo

lnlp / lmic-node Goto Github PK

View Code? Open in Web Editor NEW
203.0 18.0 100.0 140 KB

LMIC-node | One example to rule them all. LMIC-node is an example LoRaWAN application for a node that can be used with The Things Network. It demonstrates how to send uplink messages, how to receive downlink messages, how to implement a downlink command and it provides useful status information. With LMIC-node it is easy to get a working node quickly up and running. LMIC-node supports many popular (LoRa) development boards out of the box. It uses the Arduino framework, the LMIC LoRaWAN library and PlatformIO.

License: MIT License

C++ 17.48% C 82.13% JavaScript 0.39%
lorawan lorawan-node lorawan-device the-things-network ttn arduino lmic platformio example sx1276

lmic-node's People

Contributors

lnlp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lmic-node's Issues

LMIC_PRINTF_TO is not correctly set

README.md states:

  • When using LMIC debugging, output is automatically routed to the correct serial port.
    No need to set the LMIC_PRINTF_TO parameter to Serial or SerialUSB manually.

It looks like this happens is in LMIC-node.h:

#if defined(LMIC_DEBUG_LEVEL) && LMIC_DEBUG_LEVEL > 0
    // Do not overrule if already defined
    #ifndef LMIC_PRINTF_TO
        #define LMIC_PRINTF_TO serial
    #endif
#endif

However, this does not take effect when the LMIC library is actually being built. The individual LMIC source files will not include LMIC-node.h and therefore do not see the defined LMIC_PRINTF_TO value. I have verified that this results in debug output not going to serial, even when LMIC_DEBUG_LEVEL is set to > 0.

I have been fixing this in my project by simply defining LMIC_PRINTF_TO in the LMIC compilation flags in platformio.ini, i.e.:

; --------------------------------------------------
; |  MCCI LoRaWAN LMIC library specific settings   |
; --------------------------------------------------
; (...)
build_flags =
; (...)
    -D LMIC_PRINTF_TO=Serial

...but I am not sure if there is a better way that keeps the intended behaviour of it only being set when LMIC_DEBUG_LEVEL > 0.

Does it matter if LMIC_PRINTF_TO is set but LMIC_DEBUG_LEVEL is 0? I would imagine LMIC wouldn't suddenly start spamming debug output, but I haven't tried this.

How to add MAC commands to uplinks?

I want to use the linkCheckReq MAC command. The server should report the gateway margin and number of gateways which picked up the signal.

This could be very useful when installing nodes to ensure there is gateway redundancy (more reliability). The gateway margin indicates the chances of being able to decode the received signal - if my reading/interpretation of the LoRaWAN spec is correct.

I know I have to expose gwmargin and ngws from lmic.h and lmic.c but I tried calling put_mac_uplink_byte(0x02); (after exposing the method) but didn't see any evidence in the V3 console that the MAC command was received, just the normal uplink messages on Port 10.

Can anyone help? I have posted a similar question on github for the MCCI library and asked for an enhancement to the library but no-one has commented in 5 days. (mcci-catena/arduino-lmic#823)

Uplink not scheduled because TxRx pending

Hi,

I am trying to use this code on the Helium network and have made the lease amount of modifications possible to get this to work.

I am able to receive the first transmit and after that it just says: "UL not scheduled" on the OLED or "Uplink not scheduled because TxRx pending" in the serial output.

My hardware is a ttgo_lora32_v2, and I am in Australia so have "-D CFG_au915=1" uncommented. My keys must be ok as I am receiving Join and Accept messages plus the first data message.

If I had to guess the first send never completes correctly.
I would normally use TTN but there is no gateway near me and someone has one setup on Helium. I don't really have the budget to purchase a gateway for either.

Here is an output of my serial monitor with debugging on level 1

LMIC-node

Device-id: ttgo-lora32-v2
LMIC library: MCCI
Activation: OTAA
LMIC debug: 1
Interval: 60 seconds

RXMODE_RSSI
000000027652: Event: EV_JOINING
29586: engineUpdate, opmode=0x4
000000029648: Event: EV_TXSTART
31638: TXMODE, freq=917000000, len=23, SF=10, BW=125, CR=4/5, IH=0

000000031666: doWork job started
start single rx: now-rxtime: 2
367198: RXMODE_SINGLE, freq=923900000, SF=10, BW=500, CR=4/5, IH=0
000000372607: Event: EV_JOINED
Network Id: xxxxxx
Device Address: xxxxxx
Application Session Key: xxxxxxxx
Network Session Key: xxxxxxxx
375436: engineUpdate, opmode=0x800

000003781666: doWork job started
000003784801: Input data collected
COUNTER value: 1
000003785637: Packet queued
3787745: engineUpdate, opmode=0x808
000003787794: Event: EV_TXSTART
3789870: TXMODE, freq=917200000, len=15, SF=10, BW=125, CR=4/5, IH=0
start single rx: now-rxtime: 2
3872869: RXMODE_SINGLE, freq=924500000, SF=10, BW=500, CR=4/5, IH=0

000007531666: doWork job started
000007534801: Input data collected
COUNTER value: 2
000007534801: Uplink not scheduled because TxRx pending

000011281666: doWork job started
000011284801: Input data collected
COUNTER value: 3
000011284801: Uplink not scheduled because TxRx pending

Limit SF range for auto configuration

I really like this example: very well documented and easy to set up.
I would like to change the SFs that the auto configurations uses. I am quite far away from the next gateways and only messages with SF > 9 will reach the next gateway. Is there a way to change the SF range from 7 to 12 to 10 to 12?

TCXO control not working with B-L072Z-LRWAN1

I'm making a custom board /node based on B-L072Z-LRWAN1 dev kit (just CMWX1ZZABZ module, no other MCU).

By default in B-L072Z-LRWAN1 TCXO_VCC (pin48) is on all the time (JP9, pins 2-3 shorted). LMIC-node works in this setting.

In order to save current in a battery powered node TCXO_VCC (pin48) must be shut down when not transmitting. In B-L072Z-LRWAN1 this is done by controlling TCXO_VCC (pin48) with PA12 (pin 1) by shorting pins 1-2 in JP9. LMIC-node does not work in this setting: LMIC-node doesn't control PA12 at all.

Is my finding correct? How can I fix it?

image

Thanks,
Tipo

LMIC-node project adding MCCI LoRaWAN LMIC library@^4.0.0

Hi,

I am setting LMIC-node project on my win10 platformIO project targeting heltec wireless stick lite
I tried to add mcci-catena/MCCI LoRaWAN LMIC library@^4.0.0 library and got this error:

PIO Core Call Error: "Error: Invalid 'D:\userX\Documents\PlatformIO\Projects\HelctecWiFiLORAone4all\platformio.ini' (project configuration file): 'No section: 'common''"

My platforio.ini:
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:heltec_wireless_stick_lite]
; Heltec Wireless Stick Lite (ESP32).
; No display.
platform = espressif32
board = heltec_wireless_stick_lite
framework = arduino
upload_speed = 921600
monitor_speed = ${common.monitor_speed}
lib_deps =
${common.lib_deps}
${mcci_lmic.lib_deps}
build_flags =
${common.build_flags}
${mcci_lmic.build_flags}
-D BSFILE="boards/bsf_heltec_wireless_stick_lite.h"
-D MONITOR_SPEED=${common.monitor_speed}
-D LMIC_PRINTF_TO=Serial
-D USE_SERIAL
-D USE_LED
; -D USE_DISPLAY ; Requires external I2C OLED display

How to change Pico SPI channel?

I have an iLabs Challenger RP2040 Lora (SX1276).

From what I can tell it uses the second SPI channel to talk to the RFM95W. I have found the pin outs from the schematic for the board (see diagram). That's the relatively easy bit.

How can I tell LMIC-node to use spi1 instead of spi0.

Thanks for any help.

Challenger schematic
d

Add Network Layer settings to documentation

Add the following to the documentation:

For LMIC-node / MCCI LMIC it is preferred to use the following Network Layer settings for a device:

LoRaWAN version: MAC V1.0.3
Regional parameters version: PHY V1.0.3 REV A

Question on approach to use ESP32 Devboards and RFM95

This code works very well (indeed, thanks) on Heltec but I can't make it work on a generic DevKitC-v1 ESP32 with external RFM95. My approach has been to adjust a Lolin-d32 file and get the pin mappings right - so far without success.

Has anyone used this code on ESP32/RFM95 or can you offer an approach to add ESP32 dev module to the list of configured devices?

Non-standard config for Feather M0

Line 88 of adafruit_feather_m0_lora.h has dio1 on pin 5. However the common pin used on all examples I've seen uses pin 6.

Additionally, and I'm not sure if it makes a difference, but the examples also has .rssi_cal = 8, instead of 10.

Example code not working on Heltec LoRa 32 v2

Greetings,

and first of all thanks for that great project and the detailed description on the front page. I just startet to work with LoRa a few days ago and I still have many questions, but the documentation is quite good. Unfortunately, the example code does not work for me. The compilation and upload works fine, but the only thing I can see on the TTB console is a "Accept join-request", after around one minute.

The serial console of LoRa 32 (with debugging flag set to 2) shows the following:

RXMODE_RSSI
000000029396:  Event: EV_JOINING
31440: engineUpdate, opmode=0x4 

000000031474:  doWork job started
35075: engineUpdate, opmode=0x4
000000035115:  Event: EV_TXSTART
37234: TXMODE, freq=868500000, len=23, SF=7, BW=125, CR=4/5, IH=0
352849: setupRx1 txrxFlags 00 --> 01
start single rx: now-rxtime: 2
353479: RXMODE_SINGLE, freq=868500000, SF=7, BW=125, CR=4/5, IH=0
rxtimeout: entry: 354007 rxtime: 353474 entry-rxtime: 533 now-entry: 2 rxtime-txend: 312375
415349: setupRx2 txrxFlags 0x1 --> 02
start single rx: now-rxtime: 1
415978: RXMODE_SINGLE, freq=869525000, SF=12, BW=125, CR=4/5, IH=0
rxtimeout: entry: 430330 rxtime: 415974 entry-rxtime: 14356 now-entry: 2 rxtime-txend: 374875
430345: processRx2Jacc txrxFlags 0x2 --> 00
000000430388:  Event: EV_JOIN_TXCOMPLETE
432883: engineUpdate, opmode=0x4
<snip>

What did I do?
I installed Visual Studio code and PlatformIO. Then i cloned the GitHub repo and opened it as a project. I selected the board "heltec_wifi_lora_32_v2" in the platformio.ini and set the correct LoRaWAN keys in lorawan-keys.h, which is a copy of the examples key file. I also added the uplink formatter to the TTN console. Compile and upload worked fine (dependencies installed on the first build). The display of the LoRa 32 shows the following:

LMIC-node
wifi-lora-32-v2
Interval: 60s

Time:21040164
TE_JOIN_TXCOMPLE

The event details for the join-request event are:

{
  "name": "js.join.accept",
  "time": "2021-08-04T11:24:32.032208112Z",
  "identifiers": [
    {
      "device_ids": {
        "device_id": "eui-70b<blanked>",
        "application_ids": {
          "application_id": "<blanked>"
        }
      }
    },
    {
      "device_ids": {
        "device_id": "eui-70b3<blanked>",
        "application_ids": {
          "application_id": "<blanked>"
        },
        "dev_eui": "<blanked>",
        "join_eui": "0000000000000000",
        "dev_addr": "<blanked>"
      }
    }
  ],
  "correlation_ids": [
    "rpc:/ttn.lorawan.v3.NsJs/HandleJoin:01FC8EGTCTR1VE2CMQDQQC6MTH"
  ],
  "origin": "ip-<blanked>.eu-west-1.compute.internal",
  "context": {
    "tenant-id": "CgN0dG4="
  },
  "visibility": {
    "rights": [
      "RIGHT_APPLICATION_TRAFFIC_READ",
      "RIGHT_APPLICATION_TRAFFIC_READ"
    ]
  },
  "unique_id": "<blanked>"
}

Any idea what's wrong here?

Thanks!

Wrong Pi Pico pinout

I think the pin mapping for the Pi Pico is incorrect.
Managed to figure out the pinout and got it working with the RFM95W.
pico

I believe this pin mapping is correct:

 *                SCK   <――――――――――>  18   (SCK)      (PIN_SPI_SCK)
 *                MOSI  <――――――――――>  19   (MOSI)     (PIN_SPI_MOSI)
 *                MISO  <――――――――――>  16   (MISO)     (PIN_SPI_MISO)
 *                NSS   <――――――――――>  17   (SS)       (PIN_SPI_SS)

Definition: _LMIC_CONFIG_PRECONDITIONS_H_

Hi

where is the definition to "LMIC_CONFIG_PRECONDITIONS_H"?
I don't know where to define the LMIC_CONFIG_PRECONDITIONS_H

The project compiles everytime with the deprecated lmic lib. Unfortunately the deprecated lib doesn't work with TTN Stack v3.

#ifdef _LMIC_CONFIG_PRECONDITIONS_H_

best regards
CK1

Lilygo TTGO v2.1 Bootloop issue caused by wrong Reset pin

The following board and latest platformio (first time user here)
LILYGO®TTGO ESP32-Paxcounter LoRa32 V 2,1 1.6.1

Is mostly compatible with TTGO 2.1 settings. However, the wrong setting of the OLED_RST pin causes a boot loop.

I have seen this documented in other topics (#45) just want to give a quick solution.

bsf_ttgo_lora32_v21.h
l101: U8X8_SSD1306_128X64_NONAME_HW_I2C display(/*rst*/ OLED_RST, /*scl*/ SCL, /*sda*/ SDA);
changed to
U8X8_SSD1306_128X64_NONAME_HW_I2C display(/*rst*/ -1, /*scl*/ SCL, /*sda*/ SDA);

You can alternatively change this in pins_arduino.h

Bootlop message

rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2

Testing Heltec Wireless Stick Lite and TTN-OTAA

Hi,

I am not an expert in LoRa, but I did some Arduino, RFM95, TTN Gateway, sensors testing, etc.
I bought Heltec Wirelefs Stick lite and I am testing it, trying to connect to TTN via OTAA.

The stick works OK (Chip ID and WiFiScan examples are tested and OK)

I tried Heltect script in Arduino IDE to test LoRaWan - https://github.com/HelTecAutomation/ESP32_LoRaWAN/blob/master/examples/OTAA/OTAA.ino and it works OK, sending data to TTN - Live data (using my payload formater):

16:32:51 Forward uplink data message Payload sensor 0 value 10 00010203 FPort 2 SNR 4 RSSI -105 Bandwidth 125000 ...

I also tested in Arduion IDE the TTN-OTAA example from LMIC library (https://github.com/mcci-catena/arduino-lmic/blob/master/examples/ttn-otaa/ttn-otaa.ino) and it works OK.

Live data (using my payload formater): 17:09:49 Forward uplink data message Payload sensor 8311 value 127748 FPort 1 SNR 9.5 RSSI -86 Bandwidth 125000

When I test LMIC-node script on my Win 10, VisualStudiCode 1.58.2, Platform IO IDE 2.3.2, Lcation Europe, MCCI LoRaWAN LMIC library by IBM 4.0.0 installed, with \Documents\PlatformIO\Projects\HWFLlora.pio\libdeps\heltec_wireless_stick_lite\MCCI LoRaWAN LMIC library\project_config\lmic_project_config.h:

// project-specific definitions
#define CFG_eu868 1
//#define CFG_us915 1
//#define CFG_au915 1
//#define CFG_as923 1
// #define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP /* for as923-JP */
//#define CFG_kr920 1
//#define CFG_in866 1
#define CFG_sx1276_radio 1
//#define LMIC_USE_INTERRUPTS

I get:

LMIC-node
Device-id: wireless-sticklt
LMIC library: MCCI
Activation: OTAA
Interval: 300 seconds
000000002826: Event: EV_JOINING
000000003650: Event: EV_TXSTART

000000005873: doWork job started
000000407523: Event: EV_JOIN_TXCOMPLETE
000000462601: Event: EV_TXSTART
000000842883: Event: EV_JOIN_TXCOMPLETE
000000965706: Event: EV_TXSTART
000001367386: Event: EV_JOIN_TXCOMPLETE
...

I change everything needed in \keyfiles\lorawan-keys.h adding \boards\bsf_heltec_wireless_stick_lite.h

My platformIO.ini:

[env:heltec_wireless_stick_lite]
platform = espressif32
board = heltec_wireless_stick_lite
framework = arduino
lib_deps =
mcci-catena/MCCI LoRaWAN LMIC library@^4.0.0
lnlp/EasyLed@^1.1.0
upload_speed = 921600
build_flags =
-D BSFILE=\"../boards/bsf_heltec_wireless_stick_lite.h\"
-D MONITOR_SPEED=9600
-D LMIC_PRINTF_TO=Serial
-D USE_SERIAL
-D USE_LED

No Activity is detected on my Mikrotik Router as well. It might be that the frequencies are not set right?

Can someone help me detecting, what am I doing wrong?

Thank you
Mitja

Filename of LMIC_node.h mixed case

In LMIC_node.cpp the file is included by #include "lmic_node.h", but it is actually named LMIC_node.h.
Might work on systems insensitive to file name case, but not on Linux.I had to change the line to #include "LMIC_node.h"

USE_DISPLAY Not working TTGO-Lora32 V1.3

I have two new V1.3 TTGO-Lora32 and as far as I can tell everything is configured correctly but the display is either blank or not working. I know the display is good because it worked with the stock firmware. Has something changed in recent V1.3 hardware?

Doesn't build with target platform set to 'nodemcu2'

The build log:

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 (4.2.0) > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 @ 3.30102.0 (3.1.2) 
 - tool-esptool @ 1.413.0 (4.13) 
 - tool-esptoolpy @ 1.30000.201119 (3.0.0) 
 - toolchain-xtensa @ 2.100300.220621 (10.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 40 compatible libraries
Scanning dependencies...
Dependency Graph
|-- U8g2 @ 2.35.3
|-- EasyLed @ 1.1.0
|-- MCCI LoRaWAN LMIC library @ 4.1.1
|-- Wire @ 1.0
Building in release mode
Compiling .pio/build/nodemcuv2/src/LMIC-node.cpp.o
In file included from src/LMIC-node.h:82,
                 from src/LMIC-node.cpp:53:
src/boards/bsf_nodemcuv2.h:68:10: fatal error: ESP8266WiFi.h: No such file or directory

*********************************************************************
* Looking for ESP8266WiFi.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:ESP8266WiFi.h"
* Web  > https://registry.platformio.org/search?q=header:ESP8266WiFi.h
*
*********************************************************************

   68 | #include <ESP8266WiFi.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Compiling .pio/build/nodemcuv2/libba3/U8g2/clib/u8x8_d_uc1608.c.o
Compiling .pio/build/nodemcuv2/libba3/U8g2/clib/u8x8_d_uc1609.c.o
Compiling .pio/build/nodemcuv2/libba3/U8g2/clib/u8x8_d_uc1610.c.o
Compiling .pio/build/nodemcuv2/libba3/U8g2/clib/u8x8_d_uc1611.c.o
Compiling .pio/build/nodemcuv2/libba3/U8g2/clib/u8x8_d_uc1617.c.o
Compiling .pio/build/nodemcuv2/libba3/U8g2/clib/u8x8_d_uc1638.c.o
Compiling .pio/build/nodemcuv2/libba3/U8g2/clib/u8x8_d_uc1701_dogs102.c.o
Compiling .pio/build/nodemcuv2/libba3/U8g2/clib/u8x8_d_uc1701_mini12864.c.o
Compiling .pio/build/nodemcuv2/libba3/U8g2/clib/u8x8_debounce.c.o
Compiling .pio/build/nodemcuv2/libba3/U8g2/clib/u8x8_display.c.o
Compiling .pio/build/nodemcuv2/libba3/U8g2/clib/u8x8_fonts.c.o
Compiling .pio/build/nodemcuv2/libba3/U8g2/clib/u8x8_gpio.c.o
Compiling .pio/build/nodemcuv2/libba3/U8g2/clib/u8x8_input_value.c.o
Compiling .pio/build/nodemcuv2/libba3/U8g2/clib/u8x8_message.c.o
*** [.pio/build/nodemcuv2/src/LMIC-node.cpp.o] Error 1
Compiling .pio/build/nodemcuv2/libba3/U8g2/clib/u8x8_selection_list.c.o
=========================================================== [FAILED] Took 1.93 seconds ===========================================================

Environment    Status    Duration
-------------  --------  ------------
nodemcuv2      FAILED    00:00:01.927
====================================================== 1 failed, 0 succeeded in 00:00:01.927 ======================================================

It works just fine for other platforms like pico:

image

axp2101 please

Is it possible to integrate axp2101 and m8n gps please

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) - infinite loop bug

Hello guys, I have this issue on my LilyGo TTGO v2.1.6 ESP32 LoRa32 - after I click the reset button to start, it gets in an infinite bootloop , probably some watchdog or something ... :

rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13132
load:0x40080400,len:3036
entry 0x400805e4
ets Jun 8 2016 00:22:57

rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13132
load:0x40080400,len:3036
entry 0x400805e4
ets Jun 8 2016 00:22:57

If anyone knows how to fix it, I'll be very thankful :)

Event: Uplink not scheduled because TxRx pending issue

I'm using the LMIC-node library on the Heltec LoRa WIFI V2 board and there is the following problem that appears randomly in time:

Event: Uplink not scheduled because TxRx pending

After this even if I do rejoin device is unable to send data, only the device reboot helps.

Remove setDrTxPowForOtaaExplicit parameter from initLmic()

Remove the optional setDrTxPowForOtaaExplicit parameter from initLmic() and make this automatic.

Automatic means call LMIC-setDrTxPow() for OTAA automatically if the dataRate or txPower parameter values differ from their default value.
For ABP this will have no impact (for ABP the parameters are already used).

Spreading Factor can't be set

Hey,

How can i change the default SF from 7 to 9? Have done that in LMIC-node.h const dr_t DefaultABPDataRate = DR_SF9; but it still does Transmission with SF7 all times. Have disabled ADR too, but nothing changes...

Move program documentation to a separate file

Currently most of LMIC-node's documentation is contained in README.md.

The main purpose of README.md is to describe the purpose and contents of the repository however.
I should be possible to update README.md (e.g. for repository forks) without modifying any program documentation.

To make this possible program documentation will have to be moved to a separate file.

TTGO LoRa32 V1.0

My board does have an onboard blue led at pin 2.
I had to add rst (pin 16) to the display call to get it to work.

Nice app overall.

K

TTGO T-Beam V1.1 - analogRead - Uplink not scheduled because TxRx pending

I have add the following (see below). It sends one uplink and then "Uplink not scheduled because TxRx pending", not sending any more uplinks (see serial print)

If I remove the analogRead it sends uplinks as per normal scheduled time interval.

#define loadV 33

And then in --- if (LMIC.devaddr != 0) ---

        //Read Voltages

        int16_t int16_loadV;
        int16_loadV = 0;

        float Vload = analogRead(loadV);
        int16_loadV = Vload;
        Serial.print("int16_loadV: " );
        Serial.println(int16_loadV);

Serial print:

000000772779:  Event: EV_JOINED
               Network Id: 19
               Device Address: 2xxxxxx4
               Application Session Key: A5-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-CC
               Network Session Key:     7A-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-1F

000000773629:  doWork job started
int16_loadV: 22
000000773829:  Input data collected
               downLink: 0
000000774275:  Packet queued
000000774492:  Event: EV_TXSTART

000002648629:  doWork job started
int16_loadV: 4095
000002648639:  Input data collected
               downLink: 0
000002648639:  Uplink not scheduled because TxRx pending

Question: How to properly include deepsleep functionality instead of timed rescheduling?

Dear Leonel,

thanks first and foremost for this very comprehensive software. I could get it running on a bluepill/rfm95 within a few minutes. Just wonderful.

Now I would like to include a deepsleep function. Most of the time my sensor will be in deepsleep to save battery. Previously, I have just "hacked" that deepsleep call into the code right at the end of the EV_TXCOMPLETE event. But this seems nothing but brutal in your code. I bet there could be a place where it would be properly called within a wrapper function perhaps which every board then could specify out by itself. But where would that call be and how would one properly stop the timed rescheduling? Essentially, this should be replaced: instead of rescheduling after x seconds, the MC should sleep and when waking up, start the next roundtrip.

Could you be so kind as to let me know where I can implement this properly?
Thanks,
Andreas

Sub-band selection

Hello.
This is a great example of how to develop a node with LoraWAN technology. Unlike what has been done here, I am using a private server (Chirpstack) whose network is configured in the AU915 region, sub-band 0. How can I choose which sub-band I should use?
From what I understand TTN always works on the same sub-band and maybe this feature is hardcoded, if you can tell me how to change the setting I would appreciate it.

Greetings and congratulations for the great work done here.

strange behaviour, application crashing sometimes...

My application (T-Beam LoRa v1.1) is crashing sometimes, not sure why:

000032937399: Packet queued
000032937523: Event: EV_TXSTART
FAILURE
.pio\libdeps\ttgo_t_beam_v1\MCCI LoRaWAN LMIC library\src\lmic\radio.c:1065

On the board, I have connected 3 push-buttons, connected to pin 2, 4 and 32.
Pinmode: INPUT_PULLUP and to be sure, also attached a 10K resistor between datapin and 3.3Volt.

Will add more details here asap.

The crash appears sometimes after pressing the pin32-button.

Support for Dragino Arduino Uno + Dragino LoRa-shield (BSF?)

A few weeks ago I bought a The Things Network Gateway (v3), because my Dragino Arduino Uno + Dragino LoRa-shield didn't work anymore since TTN v2 is not supported anymore. My Dragino was programmed as single channel device and it seems that was not conform to the latest standards The Things Network requires (multichannel etc.).

So I found the LMIC-node site and installed platform.io and I can upload simple code to let the LEDs blink on my Arduino. That's working.

Then I added the LMIC-node library (can be seen in this thread on https://www.thethingsnetwork.org/forum/t/starting-out-with-an-arduino-uno-and-dragino-lora-shield/55895, last comment). I fixed the SPI.h error in the meanwhile.

Now my main issue is that I need to give it a BSF (Board Support File) configuration, which I can see examples for other boards, but I have no clue what BSF I need for my Dragino Arduino Uno board. Is it possible at all to get it working on my board? I find it very hard to almost impossible to find information or examples. I also contacted the seller of my board who is in contact with Dragino, but till now no response/solution.

Error ESP32s + Lilygo T-Highrow lora shield 20191223

Hello everyone,
Anyone have an error like the one below
`LMIC-node

Device-id: nodemcu-32s
LMIC library: MCCI
Activation: OTAA
Interval: 60 seconds

FAILURE
.pio/libdeps/nodemcu_32s/MCCI LoRaWAN LMIC library/src/lmic/oslmic.c:53`

i used wiring like below
SPI/LoRa module GPIO
MOSI <――――――――――> 23 (MOSI)
MISO <――――――――――> 19 (MISO)
SCK <――――――――――> 18 (SCK)
NSS <――――――――――> 5 (SS)
RST <――――――――――> 27
DIO0(IO14) <――――――――――> 34
DIO1(IO13) <――――――――――> 35
DIO2 - Not needed for LoRa.

When i compiled the log message
`PLATFORM: Espressif 32 (4.2.0) > NodeMCU-32S
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:

  • framework-arduinoespressif32 @ 3.20002.220503 (2.0.2)
  • tool-esptoolpy @ 1.30300.0 (3.3.0)
  • toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
    LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 34 compatible libraries
    Scanning dependencies...
    Dependency Graph
    |-- U8g2 @ 2.34.13
    | |-- SPI @ 2.0.0
    | |-- Wire @ 2.0.0
    |-- EasyLed @ 1.1.0
    |-- MCCI LoRaWAN LMIC library @ 4.1.1
    | |-- SPI @ 2.0.0
    |-- Wire @ 2.0.0`

Thanks for your help

Are there any plans to add GPS functionality?

Thank you for your hard work on this, it is literally the only code out there from probably 10 libraries I have tried that works first time on the T-Beamv1.0

Is there any plans to add GPS functionality to your code so we can use it on TTN-Mapper? Unfortunately i'm not a coder and have no idea how to do this. Do you know if I can drop in a few files from the below and get it working?

https://github.com/kizniche/ttgo-tbeam-ttn-tracker

thanks again,

Matt

Bootloop with TTGO LoRa32 V2.1.6 board with platform-espressif32 v4.30 and higher

Update: See further below for a more complete description of the workaround.


I have observed a bootloop after using the latest espressif32 plattform with a ttgo_lora32_v21 board.
My personal workaround was to specify the previous version in the env section for my board variant.

[env:ttgo_lora32_v21]
platform = [email protected]

Can anybody confirm this problem?

Tested with the current main branch (v.1.3.0 version fail to build because of #41 )

Pro8MHz board does join but does not transfer messages

I wanted to use a LoRa Radio Node board with an 328 chip and OTA on the V3 stack. It uses the old LMIC library and joins, but does not transfer messages. Serial stops after:

LMIC-node

Device-id: pro-mini
LMIC library: Classic [Deprecated]
Activation: OTAA
Interval: 60 seconds

Clock Error: 30000 ppm (1965)
000000000817: Event: EV_JOINING

000000000882: doWork job started

Unfortunately, the memory is too small to use the new MCCI library. Was anybody successful to use an "Arduino-like" board on the V3 stack?

Persist OTAA session across reboots

First of all thanks for the project, it is a really good starting point for those new to LoRaWAN :)

My current issue is that my device can't hear for join messages after booting. I'll have to move the device outside first and then move it to its normal position to start transmitting messages. I've used ABP while testing with The Things Network but now that I switched to Helium (which only supports OTAA) this a huge issue.

I've read that I can persist the "network session key" and "application session key" on RTC memory on my ESP32 (I believe this would be an issue with all the board this project supports) but I'm a bit lost on whether this is correct or a simpler solution exists. Any thoughts?

Failing build: multiple definition of `hal_init'

Hello, I'm building this project with these libraries for heltec_wireless_stick board.

Dependency Graph

  • |-- <U8g2> 2.33.2
  • | |-- <SPI> 2.0.0
  • | |-- <Wire> 2.0.0
  • |-- <EasyLed> 1.1.0
  • |-- <MCCI LoRaWAN LMIC library> 4.0.0
  • | |-- <SPI> 2.0.0
  • |-- <Wire> 2.0.0
  • |-- <SPI> 2.0.0
    `
    Building in release mode

and I am getting this error message
Linking .pio\build\heltec_wireless_stick\firmware.elf c:/users/xxx/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\xxx\.platformio\packages\framework-arduinoespressif32\tools\sdk\esp32\lib\libpp.a(hal_mac.o): in functionhal_init':
(.text.hal_init+0xc8): multiple definition of hal_init'; .pio\build\heltec_wireless_stick\libc40\libMCCI LoRaWAN LMIC library.a(hal.cpp.o):C:\Users\xxx\Documents\GitHub\LMIC-node/.pio/libdeps/heltec_wireless_stick/MCCI LoRaWAN LMIC library/src/hal/hal.cpp:416: first defined here collect2.exe: error: ld returned 1 exit status *** [.pio\build\heltec_wireless_stick\firmware.elf] Error 1

Document optional initLmic() parameters

initLmic() allows to specify several optional parameters.
All parameters have default values so initLmic() can be called without parameters.

These optional parameters are currently not documented.
Add documentation for the parameters to README.md.

MIC mismatch with ttgo lora

Hi, with this firmware I have always error in TTN:
Join-request to cluster-local join server failed MIC mismatch

Do you have a idea?

Can you hel me? Thank you!

on terminal:

Device-id: ttgo-lora32-v1
LMIC library: MCCI
Activation: OTAA
Interval: 60 seconds

000000023153: Event: EV_JOINING

000000023943: doWork job started
000000161248: Event: EV_TXSTART
000000555186: Event: EV_JOIN_TXCOMPLETE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.