Navigation

Welcome to Renogy Developer Toolkit (SDK) and API Services.

Overview

The Renogy SDK is a suite of tools that enables external communication capabilities with Renogy products. Developers can integrate our authorized SDK to implement communication features with Renogy energy products in their software projects. As Renogy’s product line continues to expand, the SDK’s supported energy product types are also growing.

Currently, it supports multiple product categories including Controllers, Inverters, DCDC and more, with additional energy products being added continuously.

The new SDK version achieves uniformity across different programming languages, featuring consistent:

• SDK usage methods
• API calling conventions
• Error codes
• Response packet formats

SDK Supported

Product Type Sample Products SDK Version Release Date
Charge Controller RVR Series
RVRE Series
REGO Series
VOYAGER Series
WANDERER Series
ADVENTURER Series
1.0.0 2022-09-01
Battery Charger DC-DC Series
AC-DC Series
1.0.0 2022-09-01
Inverter 12V Pure Sine Wave Series
24V Pure Sine Wave Series
48V Pure Sine Wave Series
REGO Series
Renogy X Series
1.0.0 2024-12-31(planned)
Battery Lithium Series

High Capacity Series
1.0.0 2025-03-31(planned)
Power Management Renogy ONE Series
Power Station Series
Smart Bundle Series
1.0.0 2025-12-31(planning)

The SDK supports all Renogy energy products. This list may lag behind the actual code implementation. Please consult specific energy products if you have any questions.

Android Guide

Language: Kotlin/Java

Suggestion Android SDK:24 and above

Device Suppourt: Devices that support Android and support Bluetooth Low Energy

Notice

Renogy bluetooth module communication,Currently only some data of the controller is supported,other products are under development.Please refer to the Support Product List for more information.

FAQ

Before using our SDK, you need to understand the module bus protocol, Bluetooth interaction, and some basic Android development capabilities

Preliminary preparation

You need to finish installing your Android Studio and make sure it works!(Install the git plugin) If you don’t know how to install Android Studio, you need to go to Google Developer Center to learn how to install and use Android Studio Study Android Studio

Video introduction

How to use the app

How to use

  • 1.You first need to develop the code to implement the Bluetooth read and write function, or you can use the data provided in the demo to implement the Bluetooth read and write function, please refer to the demo for the specific code

  • 2.Add the following dependencies to your project
dependencies {

    implementation 'com.renogy.rdpsdk:android:1.0.0'
}
    maven { url = uri("https://raw.githubusercontent.com/121104115wyb/repository/master") }



  • 3.Generate command code • example:The total power generation of the controller
    /**
    * "DeviceType.CTRL"  the device type
    * "CtrlConsts.TOTAL_POWER_GENERATION" the parameter name of the device
    * "cmdEntity" Contents of the Directive
    */
    val cmdEntity = ProtocolsConsts.getReadCmd(DeviceType.CTRL, CtrlConsts.TOTAL_POWER_GENERATION)



  • 4.Send command
    • example:Use the “cmdEntity” obtained in the previous step
    /**
     * @param bleMac  MAC address of Bluetooth
     * @param hexStr  Command
     * @param tag    The unique identifier of the command
     */
    BtUtil.instance.send(bleMac, hexStr, tag)

    //send command 
    BtUtil.instance.send(bleMac, cmdEntity.cmd, cmdEntity.cmdTag)
    



  • 5.Parse the response
    • example:Where to receive the Bluetooth response value in your code,Let’s take the code in the demo as an example
    
    /**
     * @param mac Bluetooth MAC address
     * @param hexResp Response value
     * @param cmdTag The unique identifier of the command
     */
    @SuppressLint("SetTextI18n")
    override fun onCharChanged(mac: String, hexResp: String, cmdTag: String) {
        super.onCharChanged(mac, hexResp, cmdTag)
        
        //To verify the response value, here is a simple verification of the data bits, strictly speaking, the data bits and CRC need to be checked
        // ModBusUtils.checkCrc()  This method can be used to verify the CRC
        val rspCheck = ModBusUtils.simpleCheck(hexResp)
        if (!rspCheck) return
        
        //To parse the response value, it needs to be passed in"cmdTag"和"hexResp"
        val baseParseEntity = ProtocolsConsts.parseResp(cmdTag, hexResp)
        
        when (cmdTag) {
            //The total power generation of the controller
            CtrlConsts.TOTAL_POWER_GENERATION -> {
                //To display the parsed data, the organization needs to add it by itself
                vb.content.text = baseParseEntity.result() + UnitConsts.KWH
            }
        }
    }
    

• To get the parsed value, you only need to pass in the cmdTag and the response value, where the cmdTag cannot be customized, and must be the information carried by "cmdEntity", otherwise it will fail to parse or the resolution will fail
    //To parse the response value, it needs to be passed in"cmdTag"和"hexResp"
    val baseParseEntity = ProtocolsConsts.parseResp(cmdTag, hexResp)

• example:where baseParseEntity.result() can get a specific response value
• UnitConsts Commonly used units are listed, and of course you can define them yourself

iOS Guide

Language: Swift

OS Requirements iOS Deployment Target: iOS 11.0

Device Support: iPad,iPhone

import RNGBLE.framework

• Drag and drop the RNGBLE.framework file into your project

• Make sure RNGBLE.framework is listed under TARGETS -> General -> Frameworks, Libraries and Embedded Content. If not, click the + button to add RNGBLE.framework from the file

Using RNGBLE

Basic Configuration

Import header file

import RNGBLE
  • Create an RNGBLEManager instance bleManager
class ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        bleManager.delegate = self
    }
}
Scan Bluetooth
  • Create a scanPeripherals array to receive Bluetooth, and implement the scanDevice() method in viewDidAppear
class ViewController: UIViewController {
    private let bleManager = RNGBLEManager()
    private var scanPeripherals = [RNGPeripheral]()
    
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        scanDevice()
    }
    private func scanDevice() {
        scanPeripherals.removeAll() 
        bleManager.scanDevice()
    }
}
  • Implement RNGBLEManagerDelegate methods
extension ViewController: RNGBLEManagerDelegate {
    func centralManagerDidUpdateState(_ central: RNGCentralManager) {
        switch central.state {
        case .poweredOff: 
            scanPeripherals.removeAll()
            break
        default: break
        }
    }    func centralManager(_ central: RNGCentralManager, didDiscover peripheral: RNGPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
        if !scanPeripherals.contains(where: { $0.identifier.uuidString == peripheral.identifier.uuidString }) {
            scanPeripherals.append(peripheral)
        }
    }
Stop Bluetooth Scanning bleManager.centralManager.stopScan()
class ViewController: UIViewController {
    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
        bleManager.centralManager.stopScan()
    }
}

License

Copyright 2022 The RenogyRdpSdk authors

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Renogy API platform aims to provide all Renogy cloud service products. During the current beta phase, it primarily offers online API services paired with Renogy One products:

Python Guide

Language: Python

Version Requirements: >= 3.6

Requests: Bleak >= 0.22.3

RenogyBT for Python SDK

RenogyBT is a Python SDK designed for Modbus communication with Renogy products. This project provides functionality to communicate with Renogy devices via Bluetooth.

Installation

Ensure your Python version is 3.6 or above. You can install the required dependencies using the following command:

pip install renogy-modbus-lib-python

Usage

Initialization

First, initialize the EnhancedModbusClient class to scan and connect to devices:

from modbus_bt_pkg.src.renogy_lib_python import EnhancedModbusClient

async def main():
    client = EnhancedModbusClient(slave_address=0xFF)
    devices = await client.scan_devices()
    # Select and connect to a device
    success = await client.connect(selected_device['address'])

Data Retrieval

Once connected, you can use the following methods to retrieve battery raw data and status information:

response = await client.get_hole_original_data()

status = await client.get_status()

Example

import asyncio
import sys
import os

from renogy_lib_python.modbus_comm import EnhancedModbusClient
async def main():
    client = EnhancedModbusClient(slave_address=0xFF) 
    connected = False
    choices = ["battery","controller"]
    try:
        # start scanning for devices
        devices = await client.scan_devices()  
        if len(devices):
            print("\nList of available devices:")
        for i, dev in enumerate(devices, 1):
            print(f"{i}. {dev['name']} ({dev['address']})")
            
        if devices:
            # select a device to connect 
            choice = int(input("\nPlease select the device type to connect (1 battery- 2 controller):"))
            if 1 <= choice <= len(choices):
                selected_type = choices[choice - 1]
            else:
                print("Input out of range, please try again")
                return
            while True:         
                try:
                    choice = int(input("\nPlease enter the device number to connect (1-{}): ".format(len(devices))))
                    if 1 <= choice <= len(devices):
                        selected_device = devices[choice - 1]
                        break
                    else:
                        print("Input out of range, please try again")
                except ValueError:
                    print("Invalid input, please enter a number")
            
            success = await client.connect(selected_device['address'])
            connected = success
            print(f"\nconnect status: {'success' if success else 'failture'}")
            
            if success:
                while True:
                    # send read command: get data
                    print("get data")
                    response = await client.get_hole_original_data(DeviceType=selected_type)
                    print(response)

                    # send write command: set data
                    print("get status")
                    response = await client.get_status(DeviceType=selected_type)
                    print(response)
                    choice = int(input("continue or exit? 1.continue 2.exit\n"))
                    if choice==1:
                        continue
                    else:
                        break
    except Exception as e:
        print(f"catch exception:{str(e)}")
    finally:
            if connected:
                await client.disconnect()
    
if __name__ == "__main__":
    asyncio.run(main())

Features

  • Device Scanning : Use the scan_devices method to scan nearby Bluetooth devices.
  • Device Connection : Use the connect method to connect to the selected device.
  • Data Retrieval : Use the get_hole_original_data and get_status methods to obtain raw data and status information from the device.

License

This project is licensed under the Renogy License. For more details, please refer to the https://www.renogy.com.