disk91 / itsdk-example-murata-lora

Example code for ItSdk with Murata & LoRaWan
GNU General Public License v3.0
9 stars 4 forks source link

LoRaWan example for MURATA CMWX1ZZABZ using ItSdk

This project is a demo project on how to use a Murata STM32-SX1276 CMWX1ZZABZ and communicate over LoRaWAN network (TTN). This example is based on Disk91 IoT SDK repository where the driver code is.

The project is used as a documentation for supporting a blog post. Check this blog post to understand how to use it. See here : https://www.disk91.com/?p=3469

The hardware configuration has been set with CubeMX and the project has been created for CubeIDE.

Status

Ready for use

Dependencies

Installation

  1. If you never start CubeIDE, do it to get your project's workspace created. Then open a terminal and go to this directory.
  2. Clone this repository
    [Workspace_CubeMx]# git clone https://github.com/disk91/itsdk-example-murata-lora.git
  3. Enter this repository
    [Workspace_CubeMx]# cd itsdk-example-murata-lora
  4. Clone the ItSDK repository
    [itsdk-example-sigfox-sx1276]# git clone -b Version-1.6 https://github.com/disk91/stm32-it-sdk.git
  5. In CubeIDE go to File >> Import >> Existing Projects into Workspace. Select the itsdk-example-murata-lora directory and import the project.
  6. Build the project in Release mode
  7. You get a itsdk-example-murata-lora.bin in the Release folder
  8. Connect the LRWAN ST board with USB
  9. Open a serial tty on the STM32 STLink USB Serial port with 9600bps configuration
  10. Copy the itsdk-example-murata-lora.bin file on the automatically mounted drive (named DIS_L072Z)
  11. The board programming led is blinking, then the program is running.

On the console, at this step you should see:

[INFO] S 0x10001001
Startup
Booting
- 

On the board, you should see:

If you want to better understand how the LRWAN board led are mapped, take a look to this post

Configuration

The board is not yet configured for Sigfox: you need to setup different infromations:

  1. Test the console, typing ? on the serial port. You should get:
    ?
    --- Common
    ?          : print help
    !          : print copyright
    v          : print version
    o          : print OK
    --- ConfigMng
    c          : print config
    C          : print shadow config
  2. Enter in admin mode by typing in the console changeme
    changme
    OK
  3. Verify you are now in admin mode by typing ?
    -- Common
    ?          : print help
    !          : print copyright
    v          : print version
    o          : print OK
    X          : exit console
    R          : reset device
    R!         : clear the whole eeprom
    l / L      : switch LowPower ON / OFF
    s          : print device state
    t          : print current time in S
    T          : print current cpu temperature in oC
    b          : print battery level
    B          : print VCC level
    r          : print last Reset Cause
    --- ErrorMng
    e          : print errors log
    E          : Clear the error logs
    --- SecureStore
    ss:R       : restore all SS to factory default
    SS:0:xxxx  : change the secure store dyn Key (12B)
    ...
  4. configure Sigfox assuming
    • Device EUI like : 756404B9D784EF5A
    • App EUI : 52DF791129AC5AAC
    • App KEY : FB501096443B4FC8954949520C895889

These credentials can be use for your tests but you won't be able to register them as the PAC is invalid. Now you can type in the console to setup your device (if you copy/paste, you need to add a delay >= 300ms between each char)

After setting up the Device EUI you should get:

 Init LoRawan Stack success
\ Connecting LoRaWAN success
- Fire a LoRaWAN message success

You can verify your Device EUI and App EUI with

ss:9
00F86ABA56993000
ss:A
70B3D57EF0003B19

The Device Key is not accessible once set, so you can't verify it.

A first LoRaWan transmission has been fired and you will get one new on every 1 minute.

General Usage

License

This code and ItSdk are under GPLv3. You can use it freely, you can modify, redistribute but you must to publish your source code. Other licenses can be obtained by contacting me on disk91.com