SX1268Library 1.0.5

dotnet add package SX1268Library --version 1.0.5
                    
NuGet\Install-Package SX1268Library -Version 1.0.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SX1268Library" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SX1268Library" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="SX1268Library" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SX1268Library --version 1.0.5
                    
#r "nuget: SX1268Library, 1.0.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SX1268Library@1.0.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SX1268Library&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=SX1268Library&version=1.0.5
                    
Install as a Cake Tool

SX1268Library

This library simplifies control of SX1268 LoRa HAT module in C#. The library is designed and configured to run on a Raspberry Pi 4.

Usage

All samples below assume that LoRa HAT is exposed on /dev/serial0 on a Raspberry Pi 4. Please visit SX1268 Wiki for details about configuring the module for Raspberry Pi.

  • Below is a short snippet to send data over LoRa using Raspberry Pi 4, without modifying module configuration.

    var module = SX1268.CreateRaspberryPi("/dev/serial0");
    var bytes = Encoding.ASCII.GetBytes("Hello World!");
    module.SendData(bytes);
    
    • Similarly, one can create an instance for Jetson by calling SX1268.CreateJetsonOrinNano("/dev/serial0") or SX1268.CreateJetsonAlternative("/dev/serial0"), depending on how Jetson is setup.
  • It is possible to modify various properties of the module on initialization, by passing a SX1268Configuration instance to the constructor. This method requires one to explicitly state all GPIO pins to be used (for M0 and M1 pins of SX126x module)

    var config = new SX1268Configuration()
    {
        AirSpeed = RATE_9K6,
        BufferSize = SIZE_128B,
        Power = POWER_22DBM
    };
    
    var module = new SX1268("/dev/serial0", 22, 27, config);
    var bytes = Encoding.ASCII.GetBytes("Hello World!");
    module.SendData(bytes);
    
  • Changing module properties can also be done after the class is initialized.

    var config = new SX1268Configuration()
    {
        AirSpeed = RATE_9K6,
        BufferSize = SIZE_128B,
        Power = POWER_22DBM
    };
    
    var module = SX1268.CreateRaspberryPi("/dev/serial0");
    var bytes = Encoding.ASCII.GetBytes("Old configuration");
    
    // Send with the old configuration.
    module.SendData(bytes);
    
    // Modify some of the properties.
    module.SetConfiguration(config);
    
    // Send with the new configuration.
    bytes = Encoding.ASCII.GetBytes("New configuration");
    module.SendData(bytes);
    
  • To receive data from the module, one can use the DataReceived event.

    var config = new SX1268Configuration()
    {
        AirSpeed = RATE_9K6,
        BufferSize = SIZE_128B,
        Power = POWER_22DBM
    };
    
    var module = SX1268.CreateRaspberryPi("/dev/serial0");
    module.DataAvailable += (sender, args) => 
    {
        Console.WriteLine($"Received {args.Payload.Length} bytes: {Encoding.ASCII.GetString(args.Payload)}");
    }
    

Credits

This project is solely based on SX126x binaries & source code package provided in SX1268 Wiki page.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5 116 4/20/2026
1.0.4 137 4/17/2026
1.0.3 226 10/22/2025
1.0.2 214 10/16/2025
1.0.1 202 10/12/2025