We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serial.read(serialBuffer,TIMEOUT) worked well on stand alone application ,
but size = Serial.read(serialBuffer,TIMEOUT) always return 0 under lorawan example (disable AT command)
For example : Lorawan
void processCmd() { size = Serial.read(serialBuffer,TIMEOUT); if(size) { Serial.printf("rev data size %d : ",size); Serial.write(serialBuffer,size); } }
void loop() {
processCmd(); switch( deviceState ) { case DEVICE_STATE_INIT: {
#if(LORAWAN_DEVEUI_AUTO) LoRaWAN.generateDeveuiByChipID(); #endif #if(AT_SUPPORT) getDevParam(); #endif printDevParam(); LoRaWAN.init(loraWanClass,loraWanRegion); deviceState = DEVICE_STATE_JOIN; break; } case DEVICE_STATE_JOIN: { LoRaWAN.join(); break; } case DEVICE_STATE_SEND: { prepareTxFrame( appPort ); LoRaWAN.send(); deviceState = DEVICE_STATE_CYCLE; break; } case DEVICE_STATE_CYCLE: { // Schedule next packet transmission txDutyCycleTime = appTxDutyCycle + randr( 0, APP_TX_DUTYCYCLE_RND ); LoRaWAN.cycle(txDutyCycleTime); deviceState = DEVICE_STATE_SLEEP; break; } case DEVICE_STATE_SLEEP: { LoRaWAN.sleep(); break; } default: { deviceState = DEVICE_STATE_INIT; break; } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Serial.read(serialBuffer,TIMEOUT) worked well on stand alone application ,
but size = Serial.read(serialBuffer,TIMEOUT) always return 0 under lorawan example (disable AT command)
For example : Lorawan
void processCmd()
{
size = Serial.read(serialBuffer,TIMEOUT);
if(size)
{
Serial.printf("rev data size %d : ",size);
Serial.write(serialBuffer,size);
}
}
void loop()
{
#if(LORAWAN_DEVEUI_AUTO)
LoRaWAN.generateDeveuiByChipID();
#endif
#if(AT_SUPPORT)
getDevParam();
#endif
printDevParam();
LoRaWAN.init(loraWanClass,loraWanRegion);
deviceState = DEVICE_STATE_JOIN;
break;
}
case DEVICE_STATE_JOIN:
{
LoRaWAN.join();
break;
}
case DEVICE_STATE_SEND:
{
prepareTxFrame( appPort );
LoRaWAN.send();
deviceState = DEVICE_STATE_CYCLE;
break;
}
case DEVICE_STATE_CYCLE:
{
// Schedule next packet transmission
txDutyCycleTime = appTxDutyCycle + randr( 0, APP_TX_DUTYCYCLE_RND );
LoRaWAN.cycle(txDutyCycleTime);
deviceState = DEVICE_STATE_SLEEP;
break;
}
case DEVICE_STATE_SLEEP:
{
LoRaWAN.sleep();
break;
}
default:
{
deviceState = DEVICE_STATE_INIT;
break;
}
}
}
The text was updated successfully, but these errors were encountered: