Giter VIP home page Giter VIP logo

rak4600_arduino's Introduction

RAK4600 Arduino

Introduction

RAK4600 LoRa Module includes an nRF52832 MCU and an SX1276 LoRa chip. Its RF communication capabilities (LoRa+BLE) make it suitable for a variety of applications in the IoT field.More details can be found in this:

RAK4600 LoRa Module - RAKwireless Knowledge Hub.

RAK4600 can be ordered in RAK store:

https://store.rakwireless.com/products/rak4600-lora-module?variant=31767268851757

BSP Installation

The following describes how the module builds the development environment in Arduino IDE and runs the demo project.

  1. What is Arduino? If you know little about Arduino, please have a look below: https://www.arduino.cc/

  2. You have known Arduino. Install the IDE first: https://www.arduino.cc/en/Main/Software

  3. Which BSP is used? RAK4600 is based on nrf52832, therefore Arduino Core for Adafruit Bluefruit nRF52 Boards is suitable for RAK4600.

    Refer to the following link to install Adafruit Bluefruit nRF52 in Arduino. https://github.com/adafruit/Adafruit_nRF52_Arduino

    After installation, select the board according to the figure below.

    nRF52

  4. Download the gpio map of RAK4600 from: https://github.com/RAKWireless/RAK4600_Arduino It contains gpio maping, serial tool, demo project and Softdevice hex.

    • feather_nrf52832: GPIO maping of RAK4600.
    • example: lorawan and ble demo project.
    • serial tool: serial tool on PC.
    • feather_nrf52832_bootloader.hex: Includes sotfdevice and bootloader.
  5. Replace your folder with our folder feather_nrf52832, your file path maybe

    %APPDATA%\Local\Arduino15\packages\adafruit\hardware\nrf52\0.14.6\variants

  6. The last step is program the bootloader hex file feather_nrf52832_bootloader.hex to RAK4600 with Jlink or DAP, etc.

At this point, the development environment is ready.

BootLoader

The bootloader of RAK4600 supports the serial port upgrade program. Use the Arduino IDE to upgrade as follows.

  1. Connect the pin 10 of module to the GND.
  2. After restarting the MCU, disconnect pin 10 from GND. The current state is bootloader mode.
  3. Click the Upload button to update the firmware to RAK4600.

Note

​ 1. If you use a WisBLOCK board (RAK5005), the silk screen of pin 10 on the back of the board is "RX1".

​ 2. You can also refer to the following link to customize your own bootloader.Adafruit_nRF52_Bootloader

DFU

BLE example

Adafruit provides many BLE demos, we open them from File->Examples.

  1. Open one of the demos, File->Examples->Adafruit Bluefruit nRF52 Libraries->peripheral->bleuart.

Project

  1. Update firmware with bootloader, View the log through the serial port on the PC.

  2. We need to install an app in the mobile phone to connect with the module.

    Refer to the following link for installation. nRF Connect for Mobile - nordicsemi.com

  3. After the installation is completed, open Bluetooth and app. Scan and connect a device named "bluefruit 52". You can communicate with your device via Bluetooth.

ble_scan

  1. Here are the logs of mobile phone and PC。

ble_mobile_app

ble_pc_tool

LoRa example

RAK4600 uses open source protocol stack to realize lorawan communication.

  1. What lorawan lib is used?

    LMIC is a LoraWAN-MAC-in-C library, adapted to run under the Arduino environment.

    Refer to the following link to install it.

    https://github.com/mcci-catena/arduino-lmic

lmic

  1. Open the demo project RAK4600_LoRaWAN_Demo.ino in Arduino IDE. Modify the device parameters to your own.

    Notice:The APPEUI and DEVEUI must be in little-endian format.

Device Parameter

  1. Update firmware with bootloader. When download ok, the RAK4600 will be auto join LoRaWAN and send data.

Run information

Please note that the default region is US915, if you want to use another region like EU868, you should open the file "lmic_project_config.h" in the folder <...\Documents\Arduino\libraries\arduino-lmic-master\project_config>, and modify the region to the one you want to use.

Region

BLE + LoRa example

BLE and LoRa demo is RAK4600_ble_scan_lora.ino, Modify the lora parameters to your own, compile and upload it as before.

We can see the following logs.

Run information

rak4600_arduino's People

Contributors

rakstory avatar fomi-rak avatar

Stargazers

Nathan avatar Jimmy Pedersen avatar  avatar Orkhan Amiraslan avatar

Watchers

Bernd Giesecke avatar James Cloos avatar Todor Velev avatar  avatar

Forkers

leogaggl

rak4600_arduino's Issues

Low Power, Sleep mode implementation

I tried to use delay(Sleep_Time); But the not that effective!
But I found that I need to use os_runloop_once(); to able to handle lmic events.
The current measured is 2.45 mA.
How I can put the module in better sleep mode - the one which you have mentioned in electrical characteristics - 2uA???

Issues to flash from arduino IDE

I try to find the PIN 18, but it is already grounded! I am using RAK4600 Module and not the breakout board!
I am not able to flash the code from Arduino IDE using serial.
Also, I tried using J-Link(select as a programmer and then Upload using programmer) it flashed, but no results!
If I am putting RAK firmware hex via J-Link again, it works fine!
But, when I flashed code via Arduino by 1) Serial update is not working
2) J-Link is also not working

I am stuck!

sleep mode reboot

I have a rak4600 with firmware version 3.4.0.14.
I send sleep mode and it work well until the chip reboot, in 2 to 3 minutes.

Do you have some ideas , how to avoid it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.