LMIC-node | One example to rule them all

Hardwired TTN sensor-node prototype with ATmega4808 and RFM95 running LMIC-node LoRaWAN example application. Documentation TBD.
grafik

2 Likes

TTN sensor-node with Thinary Nano Every ATmega4808 clone board & RFM95 running LMIC-node LoRaWAN example application. (board_build_variant = nano-4808) Watch the new YouTube video by Andreas Spiess about the ATmega4808 chip. ATmega4808, The New Arduino Chip? - YouTube
grafik

2 Likes

Really nice, well done! Great documentation, clear entry points for ‘user’ code, very simple to use.

I’m working on integrating the network time request and how we do our sleep mode, which is not at all integrated with LMICs HAL yet. So it sends the first few uplinks as usual to allow LMIC to send some of its own uplinks I see getting done between first and second ones I ask for, then when it has the network time and figured LMIC has had its say it switches to a hack where the uplinks are scheduled by an alarm rather than the LMIC os stuff, and sleeps between the TX_COMPLETE event and the next alarm. Then it runs a tight loop of run_osloop_once() until the TX_COMPLETE happens. I’m wondering if this leaves some LMIC stuff not done but it’s working so far.

I’d much rather make MCCI LMIC work nicely with the AdaFruit M0 LoRaWAN board so it isn’t always awake, but that may be beyond me. The pin interrupts work, which is something.

I don’t think any of that belongs in your repo. But I will give pull requests for things I think could be worth it. Eg I’ve changed it so setup() doesn’t immediately schedule a call to the processing callback, given it’s going to be ignored while the join happens and tossed away and a new one done when the join completes. I guess this needs to be guarded by a check for OOTA/ABP in setup().

That’s the only downside I see to this - you can’t run it on a Feather M0 on a battery without solar because it’s just too power hungry without sleeping.

2 Likes

It would be nice if sleep support can be added to LMIC-node, but the problem is that it will have to work for all MCU families and all supported boards (where possible).

Unfortunately MCCI LMIC still does not provide any sleep support (hooks/functions) to work with LMIC.
Only when MCCI LMIC adds such support, will it be worthwhile to investigate if it is possible to add sleep support to LMIC-node.

For users who want to add sleep support to their solution, you can start with LMIC-node and then add (deep) sleep support to it yourself (but this is not further described here).

It is currently not possible to add sleep support in a generic manner that works for all MCU (boards) supported by LMIC-node. Different type of MCU will/may require a different implementation.
For discussions related to that subject please start a separate topic.

1 Like

8 posts were split to a new topic: Problem getting my first node working

An off-topic post was split to a new topic: ATmega4808 and Nano Every 4808 modules

Sorry for going off topic @bluejedi but looking at the latest release v1.3.0 I see the old pro mini board bsf_pro8mhzatmega328.h, just wondering if you plan to add support for Nano Every or other 4808/4809 dev boards? I like the LMIC-node but MCCI LMIC, memory etc.
Thx, G

1 Like

Not currently planned but support could be added if there is enough request for it.
(This will require Arduino platform and PlatformIO support and access to the hardware for dev & testing).

2 Likes

Fix for ESP32 hal_init naming conflict issue

Recent versions (> 3.5.0) of PlatformIO Espressif 32 platform have introduced a naming conflict for the hal_init function (probably caused by a new version of the ESP32 Arduino core).
The naming conflict causes the build of LMIC-node to fail.

A workaround has been added to LMIC-node to fix the issue.

2 Likes

4 posts were split to a new topic: How to get SD card on TTGO LoRa32 working

Hi brother. I’m currently using the same type of board as you. But unfortunately i can’t find this board on the list of LoRa development board. Mind to share which dev board you are using? Thanks in advance.

Try looking at the example I made few years back on LMIC with my SAMD21 board. Sleep was included. Many of my end clients uses them in the field with the MCCI version subsequently.

vs

Making it work for what is effectively the Adafruit Feather M0 only would generate lots and lots of “why doesn’t the sleep work on X board”. The ESP32 TTGO range are particularly problematic.

The ESP32 boards has to be treated differently as when it goes to sleep and wake up, it is actually a reset event. In such event, some of the LMIC specific variables need to the stored on the RTC RAM section in order for it to be non-volatile. Your code also actually only run in the setup() section and never went into the loop() in your typical Arduino code. This probably leave you needing to write the code slightly differently.

Hi @rocketscream,

@alihi asked for which board configuration (boardid) was used in LMIC-node.

Your responses do not answer his question and in fact generates noise into the conversation.
Like @descartes already mentioned we are aware about different sleep requirements for different MCU family types and yes the ESP32 is notoriously limited/crippled in this area because sleep/wakeup actually causes a reset of the MCU where program state is not mainted.

Discussions about deep-sleep differences and their requirments for different types of MCU families are off-topic here because this topic is dedicated to LMIC-node (which currently does not support deep sleep for reasons previously mentioned).

Please be clear about EXACTLY WHICH BOARD you are using.

This I know, hence my comment - if you search the forum you’ll see plenty of discussions about how hard it is to sleep an ESP32 board.

Love your MiniUltra - perhaps you could help us all out with a version that has space for an RFM95? Which LMIC-node could support for those getting started - and the sleep add-on would be very simple as you’ve already written the library.

And as you were “forced” to design an ESP32 board, perhaps finish it off with a sleep library and space for the RFM95 - I’m happy to help with the linking in to LMIC - there’s no explicit support for sleep but the API is there.

Firstly, great repo, love the detail in documentation and everything is very impressive. Thanks for all the hard work. However, I have an issue.
I have a TTGO-LoRa32-V2.1-T3_V1.6 board and I uncommented “ttgo_lora32_v21” in the platform.ini file. After build and then uploading I seem to be stuck in a boot loop with the following output on the serial:

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:12784
load:0x40080400,len:3032
entry 0x400805e4
ets Jun  8 2016 00:22:57

I can confirm the board is a TTGO-LoRa32-V2.1-T3_V1.6 by comparing to the linked repo’s image.

Hi @MrBlueSea,

Thanks! :slightly_smiling_face:

I have not had the time to look into the issue yet but it appears to be caused by v4.3.0 of the Espressif 32 platform (ESP32 Arduino Core). Version 4.2.0 just works. See below for a workaround:

Workaround:

Bootloop with TTGO LoRa32 V2.1.6 board with platform-espressif32 v4.30 and higher · Issue #45 · lnlp/LMIC-node · GitHub

1 Like

I tried this and got the following issue when trying to build

Building in release mode
Compiling .pio\build\ttgo_lora32_v21\src\LMIC-node.cpp.o
Compiling .pio\build\ttgo_lora32_v21\lib128\SPI\SPI.cpp.o
In file included from C:/Users/MrBlueSea/.platformio/packages/framework-arduinoespressif32@3.20002.220503/libraries/SPI/src/SPI.cpp:22:
C:/Users/MrBlueSea/.platformio/packages/framework-arduinoespressif32@3.20002.220503/libraries/SPI/src/SPI.h:25:10: fatal error: pins_arduino.h: No such file or directory