Webinar about the new LoRaWAN stack in Mbed OS 5.8, co-hosted with Etteplan. Recording: https://pages.arm.com/build-with-mbed-explore-LoRa-using-mbed.html
6. An IoT device is more than an MCU + a radio
Bootloader
Asymmetric crypto
Storage driver
Resilient filesystem
Advanced
LoRaWAN stack
Radio drivers
FlashIAP
Update client
7.
8. Arm Mbed
A free, open source Platform OS targeting IoT end node devices
Mbed
OS
Cortex-M
RTOS
kernel
Portable
drivers
Integrated
security
IoT
connectivity
Device
management
Development
tools
Developer
community
Partner
ecosystem
140 development boards
LoRa, BLE, Cellular, Wi-Fi, etc.
9. Investment in LoRa
- Arm invested early and has excellent support for LoRa in Mbed
- 7 LoRa hardware devices already in platform/component database
- Mbed LoRa examples imported 1000's times
- Increasing investment in LoRa with interested partners
- Aiming to be #1 LoRa development platform
- Mbed OS 5.8: LoraWAN native support, APIs, examples and
showcase demos
- 2018: Services support, widespread deployment of low cost Mbed
Enabled modules
- Low-cost modules, support for operator "starter kits", events and
demos
- Firmware updates over the air
11. Two approaches
Radio + MCU
Easy to integrate in own design
Pre-certified
Module Radio
SX1272 or SX1276
Cheaper material / higher design cost
Need to do own RF design
12. Etteplan
• For industrial design engineering services, embedded systems and IoT
services and technical documentation.
• Established in 1983.
• In 2017, Etteplan had a turnover of some EUR 215 million.
• The company employs over 2,800 experts in Finland, Sweden, the
Netherlands, Germany, Poland and China.
• Currently 600 engineers in IoT projects.
• Etteplan provides e.g.:
• Complete product design (hardware, firmware and applications, mechanics, testing).
• Software design (Firmware, protocol stacks, backend, cloud, mobile app design)
• Test services, like LoRaWAN certification, accredited EMC and RF testing, environmental testing.
More information on www.etteplaniot.com
15. LoRa in Mbed – Overall SW architecture
3rd party Application
Mbed OS
LoRaStack
• Semtech LoRaMac
implementation
RADIO API
Radio adaptation
nn
LoRa Radio nn
Application API
Radio adaptation
for SX1272
LoRa Radio 1272
16. LoRa in Mbed - Some examples of Application APIs
• Initialize() – Initialize LoRa stack.
• add_app_callbacks() - Add application callbacks to the stack to handle
LoRaWAN events.
• connect() – creates a LoRa connection for application
• set_datarate() - Sets up a fixed data rate for application.
• enable_adaptive_datarate() – ADR
• send() - Sends LoRa message to gateway.
• receive() – Copies received message from stack to application buffer based on
specific port.
17.
18. LoRa in Mbed – Example stack events visible to application
Initialize()
Connect() Join_failure
Connected
Function call from app
Event from stack
send()
Tx_doneRx_done
Receive()
Tx_timeout
Tx_error
Tx_crypto_error
Tx_scheduling_error
19. LoRa in Mbed – Stack key figures
• Performance
• Data throughput: depending on used frequency band, stack restricts air traffic according to duty cycle regulations
• For example 868MHz, sub band 0, duty cycle is 1%.
• Power consumptions
• Measured on Multi-Tech mDot running Mbed OS 5.8 RC1, compiled with GCC ARM 6.
• Average power consumption in idle-state is 0,59 mA.
• Average power consumption in send-state and/or receive-state is 15,0-18,0 mA.
• Future commitments
• New radio drivers for LoRaWAN.
• Stack updates according to LoRaWAN 1.1 specification.
• Firmware updates over LoRaWAN.
20. LoRaWAN Stack configurations on Mbed OS 5.8 RC1
Measured on Multi-Tech xDot
Compiled with GCC ARM 6
• Default build (develop profile):
• ROM: 117K
• Static RAM: 15.4K
• Dynamic RAM: 3.3K
• Fully optimized (release profile, newlib-nano, no RTOS, custom printf):
• ROM: 72.3K
• Static RAM: 6.3K
• Dynamic RAM: 0.8K
23. Demo setup
Guide videos are availabe @ youtube:
Configuring Conduit first time:
https://youtu.be/u8jZ6zVMEQ0
Lora HW setup and example application on mbed:
https://youtu.be/vA5AtjZaM3Q
32. Mbed compiler environment
Offline option:
• Install offline environment according to mbed instructions
• https://os.mbed.com/docs/v5.7/tutorials/quickstart-offline.html
Online option:
• Log in to Mbed online compiler.
• Import LoRaWAN example application by typing LoRaWAN example to
search field. Temperature example app will be added after webinar.
33. Demo setup – LoRa Mbed example software
Core parts of application
• Define variables.
• Create and initialize radio instance with correct IO-pins.
• Create initialize LoRaWAN interface
• Create state machine and event handler function for stack events.
• Set keys and connection type.
• Initialize and connect your LoRaWAN node.
35. Demo setup – LoRa Mbed example software
• After doing necessary changes, build the project.
• Flash mDot by drag and drop the compiled binary from compiler to Mbed
drive and press reset button of MTUDK2-st.
• Now we should have proper application up and running in our Mbed
board.
36.
37. Tips and tricks
- Device battery life can be extended by using Mbed deep sleep
functionality.
- Mbed will go to deep sleep mode, if main thread is put to wait state.
- Deep sleep is very target specific, make sure no peripheral or timer is blocking sleep.
- Datarate affects to distance/coverage.
- If device is not moving, ADR usage is recommended.
- If device is constantly moving, disable ADR and use fixed datarate.
- Remember duty cycle limitations
- Keep packet sizes small and send packets with long interval to avoid unexpected delays.
- Different bands have different duty cycle limitations
38. Recap
• LoRaWAN is great
• Increased complexity calls for a platform OS
• Mbed OS 5.8 is a great first step, and many more will follow