@@ -483,7 +483,15 @@ bool TheThingsNetwork::provision(const char *appEui, const char *appKey)
483
483
sendMacSet (MAC_DEVEUI, buffer);
484
484
sendMacSet (MAC_APPEUI, appEui);
485
485
sendMacSet (MAC_APPKEY, appKey);
486
- saveState ();
486
+ switch (fp)
487
+ {
488
+ case TTN_FP_AS920_923:
489
+ // TODO: temporarily removed 'mac save' because RN2903AS crashes on this command!
490
+ break ;
491
+ default :
492
+ saveState ();
493
+ break ;
494
+ }
487
495
return true ;
488
496
}
489
497
@@ -603,7 +611,7 @@ void TheThingsNetwork::configureEU868(uint8_t sf)
603
611
sendChSet (MAC_CHANNEL_DCYCLE, ch, " 799" );
604
612
if (ch > 2 )
605
613
{
606
- sprintf (buf, " %d " , freq);
614
+ sprintf (buf, " %lu " , freq);
607
615
sendChSet (MAC_CHANNEL_FREQ, ch, buf);
608
616
sendChSet (MAC_CHANNEL_DRRANGE, ch, " 0 5" );
609
617
sendChSet (MAC_CHANNEL_STATUS, ch, " on" );
@@ -653,9 +661,8 @@ void TheThingsNetwork::configureUS915(uint8_t sf, uint8_t fsb)
653
661
654
662
void TheThingsNetwork::configureAS920_923 (uint8_t sf)
655
663
{
656
- // TODO: Check if this is necessary and a valid command. RX2 is SF10 at 923.2
664
+ sendMacSet (MAC_ADR, " off " ); // TODO: remove when ADR is implemented for this plan
657
665
sendMacSet (MAC_RX2, " 2 923200000" );
658
- sendChSet (MAC_CHANNEL_DRRANGE, 1 , " 0 6" );
659
666
660
667
char buf[10 ];
661
668
uint32_t freq = 922000000 ;
@@ -665,13 +672,19 @@ void TheThingsNetwork::configureAS920_923(uint8_t sf)
665
672
sendChSet (MAC_CHANNEL_DCYCLE, ch, " 799" );
666
673
if (ch > 1 )
667
674
{
668
- sprintf (buf, " %d " , freq);
675
+ sprintf (buf, " %lu " , freq);
669
676
sendChSet (MAC_CHANNEL_FREQ, ch, buf);
670
677
sendChSet (MAC_CHANNEL_DRRANGE, ch, " 0 5" );
671
678
sendChSet (MAC_CHANNEL_STATUS, ch, " on" );
672
679
freq = freq + 200000 ;
673
680
}
674
681
}
682
+ // TODO: SF7BW250/DR6 channel, not properly supported by RN2903AS yet
683
+ // sendChSet(MAC_CHANNEL_DCYCLE, 8, "799");
684
+ // sendChSet(MAC_CHANNEL_FREQ, 8, "922100000");
685
+ // sendChSet(MAC_CHANNEL_DRRANGE, 8, "6 6");
686
+ // sendChSet(MAC_CHANNEL_STATUS, 8, "on");
687
+ // TODO: Add FSK channel
675
688
sendMacSet (MAC_PWRIDX, TTN_PWRIDX_AS920_923);
676
689
if (sf >= 7 && sf <= 12 )
677
690
{
0 commit comments