Rhf76-052am - getting it working with OTAA

This timeout parameter works on my Node :slight_smile:

TY jturello

Anyone trying to get these modules working with the AU915 band and OTAA must update to firmware version V2.1.19 (25 May 2018) This can be downloaded from RisingHFā€™s wiki page once you have a login.

If you donā€™t upgrade, you will be able to send a join request to a gateway, the gateway will acknowledge with a join accept, but the RHF76-052 will never receive the join accept and fail. ABP will work if you never need to use the downlink.

There was a AU915 downlink issue fixed in V2.1.17 and also a DR6 issue fixed in V2.1.19.

As we use sub-band 2 in Australia, simply delete channels that are not used with AT+CH=ā€˜Channel to Delā€™, 0.
In most cases this is 0 to 7, 16 to 64, 66 to 71. It should then work first go!

1 Like

Could you post the firmware file somewhere for people without RisingHF wiki login?

Is there a changelog from 2.1.16 to this one?

Thanks!

Hi !

Is it possible to share the firmware release 2.1.19 or later I am stuck with 2.1.15 and having issues in joining to network, Thanks in advance

1 Like

This code I customized and I am sharing works perfectly for me.
Iā€™m using version 2.1.16
I use the default libraries of seeeduino.

#include <TheThingsNetwork.h>
#include <LoRaWan.h>
#include ā€œDHT.hā€

#define DHTPIN 8
#define DHTTYPE DHT22

DHT dht(DHTPIN, DHTTYPE);

unsigned char data[4];

char buffer[256];

void setup(void)
{
dht.begin();

SerialUSB.begin(115200);
while(!SerialUSB);

lora.init();
memset(buffer, 0, 256);
lora.getVersion(buffer, 256, 1);
SerialUSB.print(buffer); 

memset(buffer, 0, 256);
lora.getId(buffer, 256, 1);
SerialUSB.print(buffer);
lora.setId("XXXXXXXX", "XXXXXXXXXXX","XXXXXXXXXXX" );        
lora.setKey(NULL, NULL, "XXXXXXXXXXXXXXXXXXXXXXXXXXXX");

lora.setDeciveMode(LWOTAA);    

lora.setDataRate(DR5, EU868);

lora.setAdaptiveDataRate(true);    

lora.setChannel(0, 868.1);
lora.setChannel(1, 868.3);
lora.setChannel(2, 868.5);
lora.setChannel(3, 867.1);
lora.setChannel(4, 867.3);
lora.setChannel(5, 867.5);
lora.setChannel(6, 867.7);

lora.setReceiceWindowFirst(1, 868.3);
lora.setReceiceWindowSecond(869.525, DR0);

lora.setPower(14);

while(!lora.setOTAAJoin(JOIN));

}

void loop(void)
{

bool result = false;
delay(2000);
SerialUSB.println("-- LOOP");

uint32_t humidity = dht.readHumidity(false) * 100;

// float t = dht.readTemperature(false);
uint32_t temperature = dht.readTemperature(false) * 100;

byte payload[4];

payload[0] = highByte(temperature);
payload[1] = lowByte(temperature);
payload[2] = highByte(humidity);
payload[3] = lowByte(humidity);

SerialUSB.print("Temperatura: ");
SerialUSB.println(temperature);
SerialUSB.print("Umidade: ");
SerialUSB.println(humidity);

// SerialUSB.print("Temperatura: " + String(temperature));

// SerialUSB.print("Umidade: " + String(humidity));

//byte payload[4];
//data[0] = highByte(t);
//data[0] = lowByte(t);
//data[2] = highByte(h);
// data[1] = lowByte(h);

// data[1] = h;
// data[2] = t;

result = lora.transferPacket(payload, 4, 10);
//result = lora.transferPacket("Marcelo Balisteri!", 10);

if(result)
{
    short length;
    short rssi;
    
    memset(buffer, 0, 256);
    length = lora.receivePacket(buffer, 256, &rssi);
    
    if(length)
    {
        
        SerialUSB.print("Length is: ");
        SerialUSB.println(length);
        SerialUSB.print("RSSI is: ");
        SerialUSB.println(rssi);
        SerialUSB.print("Data is: ");
        for(unsigned char i = 0; i < length; i ++)
        {
            
            SerialUSB.print("0x");
            SerialUSB.print(buffer[i], HEX);
            SerialUSB.print(" ");
        }
        SerialUSB.println();
        
    }
}
delay(5000);

}

This is the TTN decoder Temp and Hum


// DecodificaĆ§Ć£o do payload no tttn

function Decoder(bytes, port) {
var humidity = (bytes[0]<< 8) | bytes[1];
var temperature = (bytes[2] <<8) | bytes[3];

return {
humidity: Umidade,
temperature: Temperatura
}
}

mensagem%20temp%20e%20umidade%20chegando

Hi, have you managed to solve the problem of unsuccessful update the firmware? I also encountered the same problem. I followed the steps in Seeeduino wiki and firmware version 2.1.19.

Iā€™m in Malaysia, asia region with frequency band AS920-923. My current firmware version is 2.0.10. On my first attempt, using extraputty to connect to the seeeduino lorawan board w/gps, the small window of the transferring file via Ymodem -> send have no progress as the packet# shown 0/58. After that, the small window disappeared and I assumed failed then proceed to the next attempt. But now the small window cannot read the file of the firmware with error file not found.

Hope get some insight to solve the problem. Anyone is welcome.

2 Likes

Hi, I have another question. I referred to the sample code, Seeeduino_LoRaWAN_for_hybrid_gateways provided by @brady_aiello. I get the following output in Arduino serial monitor:

+RESET: OK
+ID: DevAddr, XX:XX:XX:XX (My DevAddr from AT+ID in serial monitor)
+ID: DevEui, XX:XX:XX:XX:XX:XX:XX:XX (My DevEui from AT+ID in serial monitor)
+ID: AppEui, XX:XX:XX:XX:XX:XX:XX:XX (From the console of ttn)
+ID: DevEui, XX:XX:XX:XX:XX:XX:XX:XX (My DevEui from AT+ID in serial monitor)
+ID: AppEui, XX:XX:XX:XX:+KEY: APPKEY XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
//Both AppEui and AppKey are from the console of ttn
+MODE: LWOTAA
+DR: US915HYBRID
+DR: DR0
+DR: US915HYBRID DR0 SF10 BW125K
+CH: ERROR(-2)
+CH: ERROR(-2)
+CH: ERROR(-2)
+CH: ERROR(-2)
+CH: ERROR(-2)
+CH: ERROR(-2)
+CH: ERROR(-2)
+CH: ERROR(-2)
+RXWIN1: 0,923200000
+RXWIN2: 923300000,DR8
+LW: DC, OFF, 0
+LW: ERROR(-2)
+POWER: 10
+JOIN: Start
+JOIN: NORMAL
+JOIN: LoRaWAN modem is busy
+JOIN: Join failed
+JOIN: Done
+MSGHEX: Please join network first
+JOIN: Start
+JOIN: NORMAL
+MSGHEX: LoRaWAN modem is busy
+JOIN: Join failed
+JOIN: Done

I found that the are setting the DevEui and AppEui 2 times according to the output. (I wonder why?) But it not able to set the DevAddr to the one generated from the console of ttn, is set according to the one get from AT command, AT+ID. Therefore, the are different DevAddr between the console of ttn and the AT+ID command from the serial monitor. Iā€™m not able to change the DevAddr from the console.

There are also error in setting the 8 channels for AS1 region. Also, the join is failed.
Any idea?

Hello,
I had some problems with both OTAA and ABP with this module(firmware 2.1.15). So I decided to upgrade the firmware to version 2.1.19. But after the upgrade the modlule is locked in DFU mode, and I cannot return it to normal mode. Did anyone have this issue and solved is?
Thanks for all replies.

i did the same thing but i do not why i am having this problem

SEE - RHF76-052 (SEEEDUINO LORAWAN ) with DHT11

Hello,

I cannot upgrade firmware, I try to compile the skect to upgrade the firmware but receive this error below:

ā€œerror: ā€˜SerialDBGā€™ was not declared in this scopeā€ Any help are apprecied

https://forum.seeedstudio.com/viewtopic.php?f=72&t=33434&p=56598&hilit=serialdbg&sid=1bb218c2cb2c2aac96fd5016e91e0d37#p56598
image
so, this is what I ended up using:

#include "wiring_private.h" // pinPeripheral() function

// Instantiate the Serial2 class
Uart Serial2(&sercom1, 31ul, 30ul, SERCOM_RX_PAD_3, UART_TX_PAD_2);

void SERCOM1_Handler()
{
  Serial2.IrqHandler();
}

void setup()
{
  Serial.begin(115200); // FYI: I fixed this scope error in some WIO libraries with: #define SerialUSB Serial
  
  
  //getting Grove UART port on WIO GPS Tracker
  //Power the port
  pinMode(12, OUTPUT);
  digitalWrite(12, HIGH);

  // Assign pins 44 & 45 SERCOM functionality
  pinPeripheral(44, PIO_SERCOM_ALT);
  pinPeripheral(45, PIO_SERCOM_ALT);

  Serial2.begin(115200);
}

void loop()
{
while(Serial2.available())
    {
        SerialUSB.write(Serial2.read());
    }
    while(SerialUSB.available())
    {
        Serial2.write(SerialUSB.read());
    }
}

Hi everyone! I managed to get this board up and running using this code: https://github.com/NewieVentures/Smart-City-Engagement-Workshop/tree/master/LoRaWAN_AS923

My nodes can connect reliably to TTN in a single try, but Iā€™ve run into a slightly different problem:
Iā€™m trying to create a setup in which my node powers down in between sending sensor readings (Iā€™m using a TPL 5110 power timer to set this up) and stores the device Addr + session keys in an attached FRAM board.

The problem is, I donā€™t know how to get the board to send data without first doing an OTAA join. If I simply comment out the OTAA join lines in the Arduino sketch, the board complains that it needs to connect to the network before it can send data.

Does anyone have an idea on what I would need to do to make this work? Hereā€™s my sketch (I have created variables to store the devAddr and session keys but have not yet stored them in FRAM): https://1drv.ms/u/s!AkiygD5K1xshho9sj3pt1X_rf5Mp5g?e=9XB6HL

There is a lot more state information you need to safe. You will need to modify the stack to safe relevant information and on new startup restore it so the stack can continue where it left.

I am curious why you need to power down, do the components draw that much current? Looking at the modules components I think you should be able to sleep with minimal (tens of micro amps at most) power consumption. What is the current draw in your experience?

@iotprojectureca i know it has been a while since your post but i am having the same issues and i even tried using the link you shared. Can you tell me what is the firmware for your device?

hi brady i have a rhf76-052 module it seems to be connected to the ttn server but want to know how to send human readable data to the server