Has anyone used a LowRa module eg talking to the Semtech SX1276

Started by TimB, Jul 03, 2026, 07:55 PM

Previous topic - Next topic

TimB


Hi All

I'm looking to start a project using LowRa and the Semtech SX1276 chip.

Just checking in if anyone has any code?

Thanks

Tim

trastikata

Are you looking for LoRa WAN or custom LoRa? I have a lot of projects with custom LoRa comms at 433 MHz, manufacturing my own (not FCC approved  :) ) modules too for hobby projects.

Example of one of my early LoRa projects here: http://www.blog.exrockets.com/blog/100-mw-433-mhz-long-range-30-km-gps-tracker-kit/


TimB


The aim is to build a custom Type K temperature transmitter network. It will be used in an industrial plant room setting.

The coms will be bursts of TX only every 30 seconds around 35 bytes at a time. Its a broadcast system. If the signal of 1 or 2 nodes is not getting through then they either buy another RX unit or a repeater.

I will need to get full compliance certification EC FCC etc.

Looking to use the Wio-SX1262 LoRa Wireless Module by seed studios.

Custom coms protocol is expected.

433 is probably ideal. 

Is the module you used still available?


trastikata

Hi Tim,

I designed my own modules and ordered small batch, because the ones sold either don't have a TCXO and LNA or they are too expensive.

I can help with the code, but if FCC certification is required, then I guess you'd need certified LoRa modules?




top204

I created some code for the SX126x transceivers last year, with the help of trastikata, but never used it in anything.

It may give you some ideas how to implement it further, so I have attached it below, and I think it is actually already on the forum, along with posts on it.

They are complex critters, and rather difficult to set up.

I also have a simplistic library that I created for the SX1278 transceiver, back in 2022, if that will help.

However, maybe the Ebyte E220 modules would be better for you Tim, as they have a simple serial interface, and can run at very low current (approx 150uA), and are very simple to operate. I have a library for them as well that I have used in a few applications and they are rather good. Simplistic, but good, and have an excellent range.

Regards
Les

TimB


Thanks Les

The Ebyte E220 modules sound great. I'm flitting from one to the other at this time. Its very handy to get a serious recommendation.
My aim is to have 10+ year Broadcast of the temp data every 30 mins. All controlled by a XLP pic. Going to serial would be fantastic. It would save so much development time.

I will have to be careful on the power but at least I'm going in the right direction now

Thanks Tim

shantanu@india

The most difficult part of LoRa @865/868 MHz is not software but the antenna choice. Drastic attenuation can take place if LOS is not maintained.
Regards
Shantanu

TimB


Hi shantanu

I need to make the antenna choice. I'm not really restricted apart from price. Any recommendations? I can have an external with no issues.

BTW I'm going to use a Ebyte E220 module, the antenna choice will dictate the module used.

Thanks

Tim

top204

With the E220 devices, I used two curly pieces of wire as a dipole aerial, and it still had a large range.

I did measure the wire so it was a harmonic measure of the frequency, but I found it was not too critical. And I also measured the current drawn in transmit mode, to make sure it was not overloading, and it wasn't.

Regards
Les

trastikata

Quote from: top204 on Today at 03:19 PMAnd I also measured the current drawn in transmit mode, to make sure it was not overloading, and it wasn't.

Hi Les,

the SX1278 has a nice future - built in PA current limiting register, one can set it to a safe value, just have to make sure it is sufficient for the desired power output.

top204

The E220 uses the SX1262 or SX1268 devices, and they also have a PA that can be set.

Also, the E220 has a simple set of registers for setting it up, and the value in my E220 library file for them are:

'
' Mode Types
'
$define cE220_MODE_0_NORMAL       0
$define cE220_MODE_1_WAKE_UP      1
$define cE220_MODE_2_POWER_SAVING 2
$define cE220_MODE_3_SLEEP        3
$define cE220_MODE_3_PROGRAM      3
$define cE220_MODE_INIT           $FF
'
' Reg0 values to be ORed together
'
' Serial Baud rate (bits 5 to 7 of Reg0)
'
$define cE220_SERIAL_BAUD_1200      %00000000
$define cE220_SERIAL_BAUD_2400      %00100000
$define cE220_SERIAL_BAUD_4800      %01000000
$define cE220_SERIAL_BAUD_9600      %01100000       ' Default value
$define cE220_SERIAL_BAUD_19200     %10000000
$define cE220_SERIAL_BAUD_38400     %10100000
$define cE220_SERIAL_BAUD_57600     %11000000
$define cE220_SERIAL_BAUD_115200    %11100000
'
' Serial Mode (bits 3 and 4 of Reg0)
'
$define cE220_SERIAL_MODE_8N1       %00000000       ' Default value
$define cE220_SERIAL_MODE_8O1       %00001000
$define cE220_SERIAL_MODE_8E1       %00010000
'
' Air Data Rate (bps) (bits 0 to 2 of Reg0)
'
$define cE220_2_4K                  %00000010       ' Default value
$define cE220_4_8K                  %00000011
$define cE220_9_6K                  %00000100
$define cE220_19_2K                 %00000101
$define cE220_38_4K                 %00000110
$define cE220_62_5K                 %00000111
'
' Reg1 values to be ORed together
'
' Sub Packet (bytes) (bits 6 and 7 of Reg1)
'
$define cE220_SUB_PACKET_200        %00000000       ' Default value
$define cE220_SUB_PACKET_128        %01000000
$define cE220_SUB_PACKET_64         %10000000
$define cE220_SUB_PACKET_32         %11000000
'
' RSSI Ambient Noise Enable/Disable (bit 5 of Reg1)
'
$define cE220_RSSI_AMBIENT_ON       %00100000
$define cE220_RSSI_AMBIENT_OFF      %00000000       ' Default value
'
' Transmit Power (dBm) (bits 0 and 1 of Reg1)
'
$ifndef _E220_90022D    ' This set of defines for an E220_900T30D module
    $define cE220_TRANSMIT_POWER_30     %00000000       ' Default value
    $define cE220_TRANSMIT_POWER_27     %00000001
    $define cE220_TRANSMIT_POWER_24     %00000010
    $define cE220_TRANSMIT_POWER_21     %00000011
$else                   ' This set of defines for an E220_900T22D module
    $define cE220_TRANSMIT_POWER_22     %00000000       ' Default value
    $define cE220_TRANSMIT_POWER_17     %00000001
    $define cE220_TRANSMIT_POWER_13     %00000010
    $define cE220_TRANSMIT_POWER_10     %00000011
$endif
'
' Reg2 value
' Channel Control (0 to 255) (bits 0 to 7 of reg2)
'
' Reg3 values to be ORed together
'
$define cE220_RSSI_ON               %10000000
$define cE220_RSSI_OFF              %00000000       ' Default value

$define cE220_TRANSPARENT_MODE      %00000000       ' Default value
$define cE220_FIXED_MODE            %01000000

$define cE220_LBT_ON                %00010000
$define cE220_LBT_OFF               %00000000       ' Default value

$define cE220_WOR_500MS             %00000000
$define cE220_WOR_1000MS            %00000001
$define cE220_WOR_1500MS            %00000010
$define cE220_WOR_2000MS            %00000011
$define cE220_WOR_2500MS            %00000100
$define cE220_WOR_3000MS            %00000101
$define cE220_WOR_3500MS            %00000110
$define cE220_WOR_4000MS            %00000111

Notice the "cE220_TRANSMIT_POWER_xx" constant values?

If the lower power is used, it still has quite a bit of range, and the transmit current goes down.

To configure the E220, it uses simple async serial, and in operation, it acts like a full duplex serial interface, with a bit of lag because of the LoRA and when not in close range:

' Configure the E220 module
' Input     : E220_bChannel
'           : E220_wAddress
'           : E220_bReg0
'           : E220_bReg1
'           : E220_bReg3
' Output    : Returns false if a problem occurred
'           : Fills the array "E220_ConfigArray" with the config values received
' Notes     : Sets the mode back to normal when complete
'
Proc E220_SetConfigure(), Bit
    Dim bIndex As PRODL
   
    E220_SetMode(cE220_MODE_3_SLEEP)                ' Place the E220 module into Sleep/Config mode before writing

    HRSOut2 $C0, $00, $08,                          ' Send the command for a write and 8 bytes to write
            E220_wAddress.Byte1,                    ' Send the high byte of the address
            E220_wAddress.Byte0,                    ' Send the low byte of the address
            E220_bReg0,                             ' Send the Reg0 value
            E220_bReg1,                             ' Send the Reg1 value
            E220_bChannel,                          ' Send the Channel value (Reg2)
            E220_bReg3,                             ' Send the Reg3 value
            E220_wCrypt.Byte1,                      ' Send the CRYPT high byte
            E220_wCrypt.Byte0                       ' Send the CRYPT low byte
'
' Wait for the 11 values for the configuration
'
    For bIndex = 0 To 10
        HSerIn2 1000, TimedOut, [E220_ConfigArray[bIndex]]
    Next
    E220_SetMode(cE220_MODE_0_NORMAL)
    Result = True
    ExitProc
'
' Jump here if a time out occurs while waiting for the data
'
TimedOut:
    'HRSOut1Ln "E220_SetConfigure Timed Out"
    E220_SetMode(cE220_MODE_0_NORMAL)
    Result = False                                  ' Return a false result
EndProc

Regards
Les