Example of using the mDot UDK with the X-NUCLEO-IKS01A1 shield

Dependencies:   mDot_X_NUCLEO_IKS01A1 libmDot-dev-mbed5-deprecated

Hardware

Hardware List

Setup

  • Install the mDot on the developer board.
  • Install the IKS01A1 on the developer board.
  • If using a MTUDK-ST-CELL (white board) plug in the AC power adapter
  • Connect the microusb power to your development PC
    • if using a MTUDK-ST-CELL there are 2 microusb ports. Use the one closest to the serial port.

Your developer board should look like the following:

/media/uploads/pferland/udk_iks01a1.jpg

Software

This example program uses LoRa utility functions from Dot-Examples and the IKS01A1 library from ST Micro.

LoRa Configuration

Senet

By default this program is configured to connect to the Senet network. To connect to Senet you will need to register your mDot's Node ID with the Senet developer portal and change the network_key array in main.cpp.

Others

To connect to a different LoRa gateway change the arrays network_id and network_key. If you are using passphrases, edit the strings network_name and network_key, uncomment the function "update_ota_config_name_phrase" and comment out the function "update_ota_config_id_key".

dot_util.h

Committer:
pferland
Date:
2017-02-14
Revision:
11:1425f2e65663
Parent:
0:9e88a9018fc0

File content as of revision 11:1425f2e65663:

#ifndef __DOT_UTIL_H__
#define __DOT_UTIL_H__

#include "mbed.h"
#include "mDot.h"
#include "MTSLog.h"
#include "MTSText.h"

extern mDot* dot;

void display_config();

void update_ota_config_name_phrase(std::string network_name, std::string network_passphrase, uint8_t frequency_sub_band, bool public_network, uint8_t ack);

void update_ota_config_id_key(uint8_t *network_id, uint8_t *network_key, uint8_t frequency_sub_band, bool public_network, uint8_t ack);

void update_manual_config(uint8_t *network_address, uint8_t *network_session_key, uint8_t *data_session_key, uint8_t frequency_sub_band, bool public_network, uint8_t ack);

void update_peer_to_peer_config(uint8_t *network_address, uint8_t *network_session_key, uint8_t *data_session_key, uint32_t tx_frequency, uint8_t tx_datarate, uint8_t tx_power);

void update_network_link_check_config(uint8_t link_check_count, uint8_t link_check_threshold);

void join_network();

void sleep_wake_rtc_only(bool deepsleep);

void sleep_wake_interrupt_only(bool deepsleep);

void sleep_wake_rtc_or_interrupt(bool deepsleep);

void sleep_save_io();

void sleep_configure_io();

void sleep_restore_io();

void send_data(std::vector<uint8_t> data);

#endif