Turns out the RE866 has an internal RF switch that is controlled by
the nRF micro. If unconfigured, the switch passes the transmit side,
which explains why the Join Requests messages were coming through but
the Join Accept messages were rarely being detected. Once I enabled
SX1272_HAS_ANT_SW and set the RXTX pin, it works fine now.

On Sun, 6 Jan 2019 at 14:38, Amr Bekhit <[email protected]> wrote:
>
> Hi Will,
>
> Thanks for your response. In this case, both the end node and gateway
> are configured as a public network
> (https://github.com/amrbekhit/mynewt-lora-sandbox/blob/master/apps/lora_sandbox/syscfg.yml),
> but it's still not working. The network is successfully receiving the
> Join Request from the device, processing it and sending the Join
> Accept back. On the gateway side, I can see this exchange happening in
> the logs, so it appears that the packets are being sent and received.
> With the end-device, however, it seems hit and miss as to whether or
> not it receives the Join Accept message or not.
>
> Amr
>
>
> On Fri, 4 Jan 2019 at 23:41, will sanfilippo <[email protected]> wrote:
> >
> > One thing you might want to check out is the lora public/private network 
> > setting. This uses different start words and occasionally the wrong start 
> > word will still work.
> >
> > The syscfg value for this is: LORA_NODE_PUBLIC_NWK and the default is 0 
> > (meaning it is default to private network)
> >
> >
> > > On Jan 4, 2019, at 11:46 AM, Amr Bekhit <[email protected]> wrote:
> > >
> > > Hello all,
> > >
> > > I'm trying to use mynewt to develop a small LoRa end device using the
> > > Telit RE866 module, which is basically an nRF52832 embedded with an
> > > SX1272 radio. Unfortunately, I'm having a lot of trouble getting the
> > > LoRa stack to consistently join the network successfully. I have my
> > > own gateway and network server setup and have it working well with
> > > another end device that I have, so I'm pretty confident the problem is
> > > not in the backend.
> > >
> > > I've put together a simple mynewt application that attempts to join
> > > the network. You can find it on github at
> > > https://github.com/amrbekhit/mynewt-lora-sandbox.
> > >
> > > Most of the time, the device fails to join the network, but on rare
> > > occasions will succeed. Here is the output of the ln_log command when
> > > it fails:
> > >
> > > 001118 index=0 TX_SETUP phytxpwr=13 sf=12 bw=0 freq=868100000 
> > > cputime=40927
> > > 001120 index=1 TX_START pwr=0 dr=0 chan=0 airtime=1483 cputime=41119
> > > 001122 index=2 TX_DONE chan=0 done_time=1524076 cputime=1524104
> > > 001124 index=3 RX_WIN1_SETUP dr=0 chan=0 timeout=7 cputime=6523114
> > > 001125 index=4 RX_CFG bw=0 dr=0 sf=12 freq=868100000 cputime=6523118
> > > 001127 index=5 RX_TIMEOUT chan=0 rxslot=0 cputime=6753310
> > > 001128 index=6 RX_WIN2 rxslot=1 cont=0 freq=869525000 cputime=7523112
> > > 001130 index=7 RX_CFG bw=0 dr=0 sf=12 freq=869525000 cputime=7523116
> > > 001132 index=8 RX_TIMEOUT chan=0 rxslot=1 cputime=7753308
> > >
> > > Here it is when it succeeds:
> > >
> > > 002722 index=0 TX_SETUP phytxpwr=13 sf=12 bw=0 freq=868100000 
> > > cputime=40926
> > > 002725 index=1 TX_START pwr=0 dr=0 chan=0 airtime=1483 cputime=41118
> > > 002726 index=2 TX_DONE chan=0 done_time=1524073 cputime=1524101
> > > 002728 index=3 RX_WIN1_SETUP dr=0 chan=0 timeout=7 cputime=6523111
> > > 002730 index=4 RX_CFG bw=0 dr=0 sf=12 freq=868100000 cputime=6523115
> > > 002731 index=5 RX_DONE chan=0 size=17 slot=0 machdr=20 cputime=7870616
> > >
> > > I recorded quite a few logs of success and failures, and I've pasted
> > > them at the end of this email in case anyone wants to have a look. I
> > > was examining them thinking that there might be an issue with the
> > > timing of the RX Window1, but couldn't see any significant difference.
> > >
> > > Does anyone have this library working well? Are there perhaps any
> > > configuration options that I missed?
> > >
> > > Thanks,
> > >
> > > Amr
> > >
> > >
> > > --------------------------------------------
> > > ln_log outputs below:
> > > ==========WORKING LOGS==========
> > > 002722 index=0 TX_SETUP phytxpwr=13 sf=12 bw=0 freq=868100000 
> > > cputime=40926
> > > 002725 index=1 TX_START pwr=0 dr=0 chan=0 airtime=1483 cputime=41118
> > > 002726 index=2 TX_DONE chan=0 done_time=1524073 cputime=1524101
> > > 002728 index=3 RX_WIN1_SETUP dr=0 chan=0 timeout=7 cputime=6523111
> > > 002730 index=4 RX_CFG bw=0 dr=0 sf=12 freq=868100000 cputime=6523115
> > > 002731 index=5 RX_DONE chan=0 size=17 slot=0 machdr=20 cputime=7870616
> > >
> > > 008055 index=0 TX_SETUP phytxpwr=13 sf=12 bw=0 freq=868100000 
> > > cputime=40927
> > > 008057 index=1 TX_START pwr=0 dr=0 chan=0 airtime=1483 cputime=41118
> > > 008059 index=2 TX_DONE chan=0 done_time=1524073 cputime=1524101
> > > 008061 index=3 RX_WIN1_SETUP dr=0 chan=0 timeout=7 cputime=6523111
> > > 008062 index=4 RX_CFG bw=0 dr=0 sf=12 freq=868100000 cputime=6523115
> > > 008064 index=5 RX_DONE chan=0 size=17 slot=0 machdr=20 cputime=7870607
> > >
> > > 002378 index=0 TX_SETUP phytxpwr=13 sf=12 bw=0 freq=868100000 
> > > cputime=40927
> > > 002381 index=1 TX_START pwr=0 dr=0 chan=0 airtime=1483 cputime=41118
> > > 002383 index=2 TX_DONE chan=0 done_time=1524073 cputime=1524101
> > > 002384 index=3 RX_WIN1_SETUP dr=0 chan=0 timeout=7 cputime=6523111
> > > 002386 index=4 RX_CFG bw=0 dr=0 sf=12 freq=868100000 cputime=6523115
> > > 002388 index=5 RX_DONE chan=0 size=17 slot=0 machdr=20 cputime=7870608
> > >
> > > 002148 index=0 TX_SETUP phytxpwr=13 sf=12 bw=0 freq=868100000 
> > > cputime=40926
> > > 002150 index=1 TX_START pwr=0 dr=0 chan=0 airtime=1483 cputime=41118
> > > 002152 index=2 TX_DONE chan=0 done_time=1524073 cputime=1524101
> > > 002154 index=3 RX_WIN1_SETUP dr=0 chan=0 timeout=7 cputime=6523111
> > > 002155 index=4 RX_CFG bw=0 dr=0 sf=12 freq=868100000 cputime=6523115
> > > 002157 index=5 RX_DONE chan=0 size=17 slot=0 machdr=20 cputime=7870615
> > >
> > > ==========NON WORKING LOGS==========
> > > 001118 index=0 TX_SETUP phytxpwr=13 sf=12 bw=0 freq=868100000 
> > > cputime=40927
> > > 001120 index=1 TX_START pwr=0 dr=0 chan=0 airtime=1483 cputime=41119
> > > 001122 index=2 TX_DONE chan=0 done_time=1524076 cputime=1524104
> > > 001124 index=3 RX_WIN1_SETUP dr=0 chan=0 timeout=7 cputime=6523114
> > > 001125 index=4 RX_CFG bw=0 dr=0 sf=12 freq=868100000 cputime=6523118
> > > 001127 index=5 RX_TIMEOUT chan=0 rxslot=0 cputime=6753310
> > > 001128 index=6 RX_WIN2 rxslot=1 cont=0 freq=869525000 cputime=7523112
> > > 001130 index=7 RX_CFG bw=0 dr=0 sf=12 freq=869525000 cputime=7523116
> > > 001132 index=8 RX_TIMEOUT chan=0 rxslot=1 cputime=7753308
> > >
> > > 001462 index=0 TX_SETUP phytxpwr=13 sf=12 bw=0 freq=868100000 
> > > cputime=40925
> > > 001464 index=1 TX_START pwr=0 dr=0 chan=0 airtime=1483 cputime=41117
> > > 001466 index=2 TX_DONE chan=0 done_time=1524072 cputime=1524099
> > > 001468 index=3 RX_WIN1_SETUP dr=0 chan=0 timeout=7 cputime=6523110
> > > 001469 index=4 RX_CFG bw=0 dr=0 sf=12 freq=868100000 cputime=6523114
> > > 001471 index=5 RX_TIMEOUT chan=0 rxslot=0 cputime=6753306
> > > 001472 index=6 RX_WIN2 rxslot=1 cont=0 freq=869525000 cputime=7523108
> > > 001474 index=7 RX_CFG bw=0 dr=0 sf=12 freq=869525000 cputime=7523112
> > > 001476 index=8 RX_TIMEOUT chan=0 rxslot=1 cputime=7753306
> > >
> > > 001467 index=0 TX_SETUP phytxpwr=13 sf=12 bw=0 freq=868100000 
> > > cputime=40926
> > > 001470 index=1 TX_START pwr=0 dr=0 chan=0 airtime=1483 cputime=41118
> > > 001471 index=2 TX_DONE chan=0 done_time=1524072 cputime=1524100
> > > 001473 index=3 RX_WIN1_SETUP dr=0 chan=0 timeout=7 cputime=6523110
> > > 001475 index=4 RX_CFG bw=0 dr=0 sf=12 freq=868100000 cputime=6523114
> > > 001476 index=5 RX_TIMEOUT chan=0 rxslot=0 cputime=6753307
> > > 001478 index=6 RX_WIN2 rxslot=1 cont=0 freq=869525000 cputime=7523108
> > > 001480 index=7 RX_CFG bw=0 dr=0 sf=12 freq=869525000 cputime=7523112
> > > 001481 index=8 RX_TIMEOUT chan=0 rxslot=1 cputime=7753306
> > >
> > > 001420 index=0 TX_SETUP phytxpwr=13 sf=12 bw=0 freq=868100000 
> > > cputime=40924
> > > 001422 index=1 TX_START pwr=0 dr=0 chan=0 airtime=1483 cputime=41115
> > > 001424 index=2 TX_DONE chan=0 done_time=1524070 cputime=1524098
> > > 001425 index=3 RX_WIN1_SETUP dr=0 chan=0 timeout=7 cputime=6523108
> > > 001427 index=4 RX_CFG bw=0 dr=0 sf=12 freq=868100000 cputime=6523112
> > > 001429 index=5 RX_TIMEOUT chan=0 rxslot=0 cputime=6753304
> > > 001430 index=6 RX_WIN2 rxslot=1 cont=0 freq=869525000 cputime=7523106
> > > 001432 index=7 RX_CFG bw=0 dr=0 sf=12 freq=869525000 cputime=7523110
> > > 001434 index=8 RX_TIMEOUT chan=0 rxslot=1 cputime=7753304
> > >
> > > 001306 index=0 TX_SETUP phytxpwr=13 sf=12 bw=0 freq=868100000 
> > > cputime=40926
> > > 001309 index=1 TX_START pwr=0 dr=0 chan=0 airtime=1483 cputime=41118
> > > 001311 index=2 TX_DONE chan=0 done_time=1524075 cputime=1524103
> > > 001312 index=3 RX_WIN1_SETUP dr=0 chan=0 timeout=7 cputime=6523113
> > > 001314 index=4 RX_CFG bw=0 dr=0 sf=12 freq=868100000 cputime=6523117
> > > 001316 index=5 RX_TIMEOUT chan=0 rxslot=0 cputime=6753310
> > > 001317 index=6 RX_WIN2 rxslot=1 cont=0 freq=869525000 cputime=7523111
> > > 001319 index=7 RX_CFG bw=0 dr=0 sf=12 freq=869525000 cputime=7523115
> > > 001321 index=8 RX_TIMEOUT chan=0 rxslot=1 cputime=7753309
> > >
> > > 001202 index=0 TX_SETUP phytxpwr=13 sf=12 bw=0 freq=868100000 
> > > cputime=40924
> > > 001204 index=1 TX_START pwr=0 dr=0 chan=0 airtime=1483 cputime=41116
> > > 001206 index=2 TX_DONE chan=0 done_time=1524071 cputime=1524098
> > > 001208 index=3 RX_WIN1_SETUP dr=0 chan=0 timeout=7 cputime=6523109
> > > 001209 index=4 RX_CFG bw=0 dr=0 sf=12 freq=868100000 cputime=6523113
> > > 001211 index=5 RX_TIMEOUT chan=0 rxslot=0 cputime=6753305
> > > 001212 index=6 RX_WIN2 rxslot=1 cont=0 freq=869525000 cputime=7523107
> > > 001214 index=7 RX_CFG bw=0 dr=0 sf=12 freq=869525000 cputime=7523111
> > > 001216 index=8 RX_TIMEOUT chan=0 rxslot=1 cputime=7753304
> > >
> > > 001049 index=0 TX_SETUP phytxpwr=13 sf=12 bw=0 freq=868100000 
> > > cputime=40926
> > > 001051 index=1 TX_START pwr=0 dr=0 chan=0 airtime=1483 cputime=41118
> > > 001053 index=2 TX_DONE chan=0 done_time=1524075 cputime=1524102
> > > 001055 index=3 RX_WIN1_SETUP dr=0 chan=0 timeout=7 cputime=6523113
> > > 001056 index=4 RX_CFG bw=0 dr=0 sf=12 freq=868100000 cputime=6523117
> > > 001058 index=5 RX_TIMEOUT chan=0 rxslot=0 cputime=6753311
> > > 001060 index=6 RX_WIN2 rxslot=1 cont=0 freq=869525000 cputime=7523111
> > > 001061 index=7 RX_CFG bw=0 dr=0 sf=12 freq=869525000 cputime=7523115
> > > 001063 index=8 RX_TIMEOUT chan=0 rxslot=1 cputime=7753308
> >

Reply via email to