LMIC-node | One example to rule them all

I welcome your feedback. Please share if you have your device(s) working
with LMIC-node and whether you use macOS, Linux or Windows.

Or discuss issues you run into that may need to be fixed in LMIC-node.
Issues can be reported in the LMIC-node repository on GitHub.

Easy and well working.
Tried on ESP32 Espressif DevKit v1 and ESP32 Wroom32 module
Easy to set and to use. The only needed adaptation is the pinout which depends on the used board.

Not clear what the max possible power is.
Looks to be 14dBm “only”

1 Like

Support has been added for the compact Adafruit QT Py board.

A picture of a working setup can be seen in The Workbench topic here

MCCI LoRaWAN LMIC library v4.0.0 has been released.

If the LMIC-node application is already cloned/installed onto your system and you want to use the latest LMIC library version, you can update the LMIC library in your LMIC-node project by running the PlatformIO command:

pio lib update

This will update all libraries in the project that were previously downloaded (based on lib_deps in platformio.ini). Without a manual lib update PlatformIO will keep using the previously downloaded libraries (which may not be the latest versions).

If a library was not previously downloaded, the latest version will be downloaded.

(PlatformIO downloads libraries separately for each board.)

Espressif8266 platform version 3.0.0 causes an issue in LMIC-node for the NodeMCU V2 (ESP8266) board. If you run into this problem, to fix just update to the latest LMIC-node version on Github.

In PlatformIO installed platforms (e.g. ESP32, STM32, SAMD, ESP8266) are not automatically updated. Updating a platform can be done from the PlatformIO IDE Home/Platforms/Update page or with PlatformIO command pio update. Latter will update all platforms at once.

Updating a platform normally does not cause issues. However, the new espressif8266 platform version 3.0.0 does cause an issue for the NodeMCU V2 (ESP8266) board for LMIC debugging (LMIC_PRINTF_TO). This manifests as compilation error "cookie_io_functions_t does not name a type". This has been fixed (i.e. support for espressif8266 v3.0.0 has been added) in the latest version of LMIC-node.

4 posts were split to a new topic: Looking for easier to program node

I added GPS functionality to the LMIC-node application. You can find my github repository here:
LMIC-node-gps-tracker, forked from lnlp/LMIC-node.

I did not add a decent readme file in the repository yet , but I did add a lot of comments in the code.

1 Like

Nice!

A decent README.md was already included with LMIC-node so you won’t have to write it from scratch. :wink:

The README.md is the first thing people will see on the repository home page.
At minimum it should be updated to reflect the name of your repository.

Requiring users to dive into the code first to find out if it provides the functionality they are looking for and if they can use it for their board and GPS module is not user friendly and time consuming. Some documentation will therefore be appreciated.

Adding the documentation in a separate file (e.g. GPS.md) will make it easier to sync with future LMIC-node updates.

Things that will be useful to document:

  • What functionality is added and/or changed in your code?
    What makes your repository different from LMIC-node?
  • Which GPS module(s) and which board(s) are supported by the added GPS code?
  • A description of added functionality and how people can use it.
  • With which GPS module and board was it tested?
  • Any known limitations.

(Don’t forget to also update the repository description aka ‘About’).


In a future update LMIC-node program documentation will be moved from README.md to a separate file. That will make it easier to update the README.md for repository forks.

I know, (and a very extensive one) but I did not have the time to complete a readme.
When writing the readme I will adopt your recommendations.

What do you mean by that? It is my first forked repository that I published on Github. (I have a lot to learn)

On the repository home page top-right select the settings icon:

capture 2021-08-19 14·40·07

You can then edit/update the description:

capture 2021-08-19 14·40·47

It will also be useful to add “GPS” as keyword (‘topic’). LMIC-node already has the maximum number of 20 topics defined so you will need to remove one of the existing topics first (I suggest to remove cmwx1zzabz).

The description (‘about’) and keywords (‘topics’) are used by search engines (including GitHub search) for finding relevant matches.

1 Like

Thank you for your extensive answer. I know now what to do.

Please specify (in this thread) which board and GPS module your added GPS code supports.

The code is tested on a TTGO T-Beam board v1.0 (with and without display) and a TTGO LoRa32 v2.1.6 with an NEO-6M gps module.
I think all other ESP32 boards in the boards directory equiped with a gps (module) will work if they support the tinygps++ library. You only have to change the TX en RX port definitions in platfomio.ini.

LOL - for various values of “only” - see one of the other threads where that is the exact issue for someone right now!

Hence the extreme importance of a basic readme, however terse, to highlight that with different board revisions comes different pin connections. Otherwise you’ll end up with lots of issues on your repro asking why it doesn’t work.

I know, I know. I’m on holyday now somewhere in Europe and there are a lot of other important things to do now :wink:

FYI:

LMIC-node is currently listed
First in The Top 5 LoRaWAN LMIC Open Source Projects on GitHub.

See: https://awesomeopensource.com/projects/lmic/lorawan

And 10th place in The Top 60 Arduino Lorawan Open Source Projects on Github.

8 Likes

Well deserved - a comprehensive & detailed piece of work!

2 Likes

Hello,
I cannot get this code to work with a heltec wireless stick lite card, are other parameters necessary to modify?

I also copied the keyfiles file

;-------------------------------------------------------------------------------
;
; File: platformio.ini
;
; Function: Project configuration file for LMIC-node.
;
; Copyright: Copyright (c) 2021 Leonel Lopes Parente
;
; License: MIT License. See accompanying LICENSE file.
;
; Author: Leonel Lopes Parente
;
; Description: This is the main configuration file. It contains:
; - Board selector to select your board type
; - Common settings used for all boards
; - Board specific settings that can be altered per board.
;
; For a description of all settings see README.md
;
;-------------------------------------------------------------------------------

; ------------------------------------------------------------------------------
; | Board Selector |
; | |
; | Select your board by uncommenting EXACTLY ONE board-id below. |
; ------------------------------------------------------------------------------

[platformio]
default_envs =
; <platformio.ini board selector guard> Comment this line and uncomment one board-id below:

; LoRa development boards with integrated LoRa support:

; Board-id                            Board name
;---------                            ----------
; adafruit_feather_m0_lora          ; Adafruit Feather M0 LoRa
; disco_l072cz_lrwan1               ; Discovery B-L072Z-LRWAN1
; heltec_wifi_lora_32_v2            ; Heltec Wifi LoRa 32 V2
; heltec_wifi_lora_32               ; Heltec Wifi LoRa 32
 heltec_wireless_stick_lite        ; Heltec Wireless Stick Lite
; heltec_wireless_stick             ; Heltec Wireless Stick
; lopy4                             ; Pycom Lopy4
; lora32u4II                        ; BSFrance LoRa32u4 II v1.0, v1.1, v1.2, v1.3
; ttgo_lora32_v1                    ; TTGO LoRa32 v1.3
; ttgo_lora32_v2                    ; TTGO LoRa32 v2.0
; ttgo_lora32_v21                   ; TTGO LoRa32 v2.1.6
; ttgo_t_beam                       ; TTGO T-Beam v0.5, v0.6, v0.7
; ttgo_t_beam_v1                    ; TTGO T-Beam v1.0, v1.1

; Development boards that require an external SPI LoRa module:

; Board-id                            Board name
;---------                            ----------
; adafruit_qt_py_m0                 ; Adafruit QT Py    
; blackpill_f103c8_128k             ; Black Pill 128k
; blackpill_f103c8                  ; Black Pill  64k
; bluepill_f103c8_128k              ; Blue Pill 128k
; bluepill_f103c8                   ; Blue Pill  64k
; lolin_d32_pro                     ; Lolin D32 Pro
; lolin_d32                         ; Lolin D32
; lolin32                           ; Lolin32
; nodemcu_32s                       ; NodeMCU-32S
; nodemcuv2                         ; NodeMCU V2
; pico                              ; Raspberry Pi Pico
; pro8mhzatmega328                  ; Arduino Pro Mini 3.3V 8Mhz
; samd21_m0_mini                    ; SAMD21 M0-Mini
; teensylc                          ; Teensy LC

; ------------------------------------------------------------------------------
; | Common Settings |
; | |
; | These settings are shared by all board configurations except for |
; | nodemcuv2 which uses its own monitor_speed setting. |
; ------------------------------------------------------------------------------

[common]

monitor_speed = 115200 ; No need to change this.

build_flags =
-D DO_WORK_INTERVAL_SECONDS=60

; -D ABP_ACTIVATION                ; Use ABP instead of OTAA activation.
;
; -D WAITFOR_SERIAL_SECONDS=10     ; Can be used to override the default value (10).
;                                    Is used only for boards with default set to != 0 in BSF.
;
; -D LMIC_CLOCK_ERROR_PPM=0        ; If not defined defines, otherwise overrides value defined in BSF.
;                                    Is for testing purposes only.
;                                    Do not enable this unless you explicitly know what you are doing.
;
; -D STM32_POST_INITSERIAL_DELAY_MS=1500  ; Workaround for STM32 boards. Can be used 
;                                           to override value (milliseconds) in BSF.

lib_deps =
olikraus/U8g2 ; OLED display library
lnlp/EasyLed ; LED library
; ███ Add additional libraries for User Code below this line ███

; --------------------------------------------------
; | Shortcuts to enable quick and easy changes |
; --------------------------------------------------

[pico]
upload_port = E: ; For Raspberry Pi Pico.
; Operating system and hardware dependent.
; Placed here so it can be easily changed.
; See section [env:pico] below for more information.

; --------------------------------------------------
; | MCCI LoRaWAN LMIC library specific settings |
; --------------------------------------------------

[mcci_lmic]
; LMIC-node was tested with MCCI LoRaWAN LMIC library v3.3.0 and v4.0.0.
; Some changes have been announced for future versions of the MCCI library
; which may be incompatible with LMIC-node. In case of problems just
; use mcci-catena/MCCI LoRaWAN LMIC library@4.0.0 below which will
; explicitly use v4.0.0 of the library.
; Perform ‘PlatformIO: Clean’ after changing library version and
; in case of issues remove the old version from .pio/libdeps/*.

; Note: LMIC_PRINTF_TO is defined for each board separately
; in the board specific sections. Don’t define it in this section.

lib_deps =
; Only ONE of below LMIC libraries should be enabled.
mcci-catena/MCCI LoRaWAN LMIC library ; MCCI LMIC library (latest release)
; mcci-catena/MCCI LoRaWAN LMIC library@4.0.0 ; MCCI LMIC library v4.0.0

build_flags =
; Use platformio.ini for settings instead lmic_project_config.h.
-D ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS

; Ping and beacons not supported for class A, disable to save memory.
-D DISABLE_PING
-D DISABLE_BEACONS

; -D LMIC_DEBUG_LEVEL=1            ; 0, 1 or 2

; -D CFG_sx1272_radio=1            ; Use for SX1272 radio
-D CFG_sx1276_radio=1              ; Use for SX1276 radio
-D USE_ORIGINAL_AES                ; Faster but larger, see docs
; -D LMIC_USE_INTERRUPTS           ; Not tested or supported on many platforms
; -D LMIC_ENABLE_DeviceTimeReq=1   ; Network time support

; --- Regional settings -----
; Enable only one of the following regions:    
; -D CFG_as923=1
; -D CFG_as923jp=1   
; -D CFG_au915=1
; -D CFG_cn490=1                   ; Not yet supported
; -D CFG_cn783=1                   ; Not yet supported
; -D CFG_eu433=1                   ; Not yet supported
-D CFG_eu868=1
; -D CFG_in866=1
; -D CFG_kr920=1
; -D CFG_us915=1

; --------------------------------------------------
; | IBM LMIC framework library specific settings |
; --------------------------------------------------

[classic_lmic]
; IMPORTANT:
; This library was recently DEPRECATED and is no longer maintained.
; It is not fully LoRaWAN compliant (e.g. in handling of MAC commands)
; and is therefore less suitable for use with The Things Network V3.
;
; Region, radio and debug settings CANNOT be changed in platformio.ini.
; They must be configured in file: config.h in the following location:
; .pio/libdeps//IBM LMIC framework/src/lmic
;
; When making changes to config.h:
; CONFIG.H MUST BE CHANGED FOR EACH BOARD SEPARATELY!
; (By default libraries are installed per project per build config/board.)

lib_deps =
matthijskooijman/IBM LMIC framework ; [Deprecated] Classic LMIC library

build_flags =
; DEFAULT VALUES defined in config.h:
; CFG_sx1276_radio 1
; CFG_eu868 1
; LMIC_DEBUG_LEVEL 0

; Ping and beacons not supported for class A, disable to save memory.
-D DISABLE_PING
-D DISABLE_BEACONS

; ------------------------------------------------------------------------------
; | LoRa development boards with integrated LoRa support |
; | |
; | Some but not all of these boards have an onboard display. |
; | Some boards require additional wiring that needs to be manually added. |
; | Check the Board Support Files in the boards folder for information. |
; ------------------------------------------------------------------------------

What have you tried?

What output does your serial monitor show?

You copied the file? Or did you create a new file with the as in step “3.12 lorawan-keys.h” and inserted your keys in it?