# Arduino nano and RFM95 basic test - EV\_JOIN\_TXCOMPLETE: no JoinAccept

**URL:** <https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058>\
**Category:** LMIC\
**Created:** [September 21, 2020, 7:08pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058 "2020-09-21T19:08:50Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [October 13, 2020, 3:09pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/62 "2020-10-13T15:09:44Z")

</div>

Thanks for adding to the confusion for an already confused situation.

I’m old but not yet senile, so no, I hadn’t forgotten.

Bitrot has not yet set in and the deprecate button does not cause electrons around the world to suddenly stop the software working. I know, my devices are still happily sending …

---

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [October 13, 2020, 3:11pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/63 "2020-10-13T15:11:05Z")

</div>

> [@descartes](#):
>
> Bitrot has not yet set in and the deprecate button does not cause electrons around the world to suddenly stop the software working

Perhaps it would be worth reviewing the author’s deprecation message, where he explains that he wasn’t able to keep up with the bugfixes that were being made in the maintained ones.

So no, it’s not about bitrot, it’s about bits that were never right to begin with.

It may work after a fashion, but you’re locking yourself into a backwater that is unmaintained.

---

<div class="post-metadata">

**Author:** ![lorauser](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/lorauser/32/25844_2.png) [@lorauser](https://www.thethingsnetwork.org/forum/u/lorauser)\
**Post date:** [October 13, 2020, 3:11pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/64 "2020-10-13T15:11:48Z")

</div>

> [@descartes](#):
>
> swap the LMIC over to

What the swap the LMIC over means?

I use this library [https://github.com/matthijskooijman/arduino-lmic](https://github.com/matthijskooijman/arduino-lmic)

library.properties:  
name=IBM LMIC framework  
version=1.5.1  
author=IBM  
maintainer=Matthijs Kooijman [matthijs@stdin.nl](mailto:matthijs@stdin.nl)

Sketch uses 20402 bytes (66%) of program storage space. Maximum is 30720 bytes.  
Global variables use 901 bytes (43%) of dynamic memory, leaving 1147 bytes for local variables. Maximum is 2048 bytes.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [October 13, 2020, 3:13pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/65 "2020-10-13T15:13:13Z")

</div>

Locking myself in, I think not, all we want is for the OP to get his device working in the first instance.

Nothing stops any of us moving on when we choose and the last I checked the MCCI had 128 issues so that’s not exactly perfect.

Baby steps.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [October 13, 2020, 3:15pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/66 "2020-10-13T15:15:23Z")

</div>

You previously said you were using the MCCI one when I asked you use Matt’s one.

So we have arrived at the same place and you say you have ABP working but no join accept arriving for OTAA?

---

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [October 13, 2020, 3:15pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/67 "2020-10-13T15:15:27Z")

</div>

> [@descartes](#):
>
> Nothing stops any of us moving on when we choose

Actually, code size pretty much does…

> [@](#):
>
> and the last I checked the MCCI had 128 issues so that’s not exactly perfect.

Most of those exist in the deprecated project too, along with the many shared ones that the maintained branch has fixed. They’re just not being _tracked_ over there.

Basically, the MCCI effort is exposing how deep the fundamental issues in _all_ LMiC’s really run.

(That said, no small number of those issues have to do with the effort towards achieving actual LoRaWAN certification, which may be beyond the needs of most.  
And another set are really _user_ and _platform_ problems more than LMiC ones, but get created because it’s code people are actively trying to integrate)

---

<div class="post-metadata">

**Author:** ![lorauser](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/lorauser/32/25844_2.png) [@lorauser](https://www.thethingsnetwork.org/forum/u/lorauser)\
**Post date:** [October 13, 2020, 3:18pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/68 "2020-10-13T15:18:02Z")

</div>

> [@descartes](#):
>
> So we have arrived at the same place and you say you have ABP working but no join accept arriving for OTAA?

Yes. I bought arduino pro mini 3.3v version, because with nano 5v + rfm95 3.3v is not a good idea. But nothing changed.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [October 13, 2020, 3:19pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/69 "2020-10-13T15:19:26Z")

</div>

Give me a short while and I’ll have a look at what extra debug we can add in.

But ideally you need to get in touch with someone who can show you their gateway logs so we can get more details on what is happening.

---

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [October 13, 2020, 3:21pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/70 "2020-10-13T15:21:55Z")

</div>

Does “ABP working” include downlinks such as the MAC commands for channel configuration and ADR?

Historically speaking, if the TTN console is showing join accepts being generated, then most _alleged_ “ABP but not OTAA” have tracked back to being failures to receive downlinks, and many of those turn out to be timing issues, or bandplan misconfiguration ones.

A possible cause of timing issues is not detecting the end of the uplink transmission, eg, with the appropriate DIO, which gets back to the pinmap… only I’d expect some sort of error or lockup if it was never seen, unless perhaps it was falsely seen the instant the code started looking for it.

My stock debug approach to all of that is to blip a GPIO when starting and ending both transmit and receive, and look at the time in between with a scope…

---

<div class="post-metadata">

**Author:** ![lorauser](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/lorauser/32/25844_2.png) [@lorauser](https://www.thethingsnetwork.org/forum/u/lorauser)\
**Post date:** [October 13, 2020, 3:41pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/71 "2020-10-13T15:41:09Z")

</div>

> [@cslorabox](#):
>
> My stock debug approach to all of that is to blip a GPIO when starting and ending both transmit and receive, and look at the time in between with a scope…

Tell me more about that. I’m using the simplest ttn-abp sketch example. Should I add this in my example? Taken [from tutorial](https://www.mobilefish.com/developer/lorawan/lorawan_quickguide_build_lora_node_rfm95_arduino_pro_mini.html)  
// Use with Arduino Pro Mini ATmega328P 3.3V 8 MHz  
// Let LMIC compensate for +/- 1% clock error  
LMIC\_setClockError(MAX\_CLOCK\_ERROR \* 1 / 100);

On which GPIO should I measure signals to see timings? I can measure only transmit (sending hello world), I’m not receiving anything.

---

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [October 13, 2020, 3:46pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/72 "2020-10-13T15:46:22Z")

</div>

The clock error thing has been poorly understand by many for a long time, and often causes as many problems as it solves. In some cases it may be useful, but needs to be used with a much more detailed understanding of specifics than the usual blindly hopeful “try this…” and may also require adjustment to the _duration_ of the receive window in symbols.

To use a GPIO for checking timing, you’d need a storage scope (or USB logic analyzer) and pick an unused digital pin. Given LMiC is C code, you’d either need to figure out the actual AVR port pin involved and set/clear it by direct access to the appropriate PORTx register, or perhaps better create an `extern "C"` function in your Arduino code which the LMiC code could call to blip or toggle it. Then you need to find the code that detects the end of transmission, and the code that starts reception, and put the manipulation of the test GPIO there.

Capturing all of the SPI traffic and relevant end-of-transmit DIO with a USB logic analyzer could be another approach, not requiring software changes to support.

_(If this sounds complicated and not what one bargained for in choosing an Arduino approach, that’s because it is. If one is going to use LMiC, especially under Arduino, then it really makes sense to chose a board supported by and used for regression tests of a maintained LMiC. Otherwise you’re basically in the complexity territory of a professional embedded development project, with the added complication of a project/library interaction which makes things even harder to work on than usual…)_

---

<div class="post-metadata">

**Author:** ![lorauser](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/lorauser/32/25844_2.png) [@lorauser](https://www.thethingsnetwork.org/forum/u/lorauser)\
**Post date:** [October 13, 2020, 5:20pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/73 "2020-10-13T17:20:59Z")

</div>

> [@cslorabox](#):
>
> Capturing all of the SPI traffic and relevant end-of-transmit DIO with a USB logic analyzer could be another approach, not requiring software changes to support.

No problem. I have a logic analyser. One clock pulse width is 0,125us. Is that normal?

---

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [October 13, 2020, 8:13pm UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/74 "2020-10-13T20:13:58Z")

</div>

It’s unclear if you mean the SPI clock or the analyzer sampling rate. What sampling rate did you use? 1/8 of a uS would suggest you might be looking at the period of 8 MHz sampling, if the SPI clock is really that fast you’d need to run the analyzer faster.

Anyway, what you’d really want to be seeing is a sequence such as:

- Chip select framed SPI operations to configure radio for transmission
- tens to hundreds of milliseconds of nothing (matching calculated packet duration)
- DIO change indicating end of transmission
- just under 5000 uS of delay for 5 second RX1
- Chip select framed sequence of SPI operations to set up receive
- the above completing just before 5000 uS has elapsed from the end of transmit
- DIO indicating reception… or else failure

One thing you need to make sure is that there’s some electrical activity to mark when the attempt at receiving ends in the case of getting nothing. I forget exactly how LMiC does this - maybe a DIO, maybe polling?

One of the historic issues with the clock error stuff for example is that it sometimes causes the receive attempt to begin early enough, that it then actually gives up _before_ the preamble of the packet is actually due.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [October 14, 2020, 8:31am UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/75 "2020-10-14T08:31:14Z")

</div>

Looking at my notes from other support cases on here and elsewhere, the simpler quick things to check are:

1. The pin map - if you can take some photos that show the Arduino & the RFM95 we can check it for you
2. The soldering - at least one case the soldering looked OK but it all burst in to life after a quick touch up

This is my first test node:

![IMG_5020](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/9/4/94ff0ccfb67d59c8ec06455c24657828da8ac05d.jpeg)

This is what I’d suggest for a first node:

![45a4710c8d6871b4fd6dc9c0b0fb8cb8359b5c62](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/e/6/e63e8bd683be90dd700a249586525728a4d73f35.jpeg)

The small white PCB is actually an ESP mounting board - a convenient way to making an RFM95 breadboard friendly.

This is the PCB I now use:

![P1040726](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/6/0/60b471e0ed69d6727efa7af6b88b769c49e91fbd.jpeg)  
 ![P1040728](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/c/0/c0f94383eebf0c850f934e6e158d78da2ddf0507.jpeg)

Stick in there, I absolutely know this can work, as you can see, I’ve at least three form factors working.

---

<div class="post-metadata">

**Author:** ![lorauser](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/lorauser/32/25844_2.png) [@lorauser](https://www.thethingsnetwork.org/forum/u/lorauser)\
**Post date:** [October 14, 2020, 9:31am UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/76 "2020-10-14T09:31:09Z")

</div>

Pin Map I used:

> **Table**
>
> ![pinmap2](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/a/1/a1ca675c9f9a0307303fbde3ae3dffce9059ba41.jpeg)

> **Schematic**
>
> ![](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/c/d/cd502d53a0e57d4d0b420c2ddb16b69d0bc43a21.jpeg)

> **My board**
>
> ![cropboard2](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/e/8/e8281a34cc7dff5e74ddd3a28796cda9eb3542ab.jpeg)

> **Sketch pinmap**
>
> ![arduinocodepinmap](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/8/1/814776452f8ccc1d02885dd9008b5d94ea9e515a.jpeg)

I know it’s better to use a breadboard, but I don’t have one, so I use my soldering iron.  
I checked connections, there is no bad contact or short.

I had an idea to simulate not working rfm module. I unsoldered VCC wire, RFM95 was not powered. In the console I saw:

> Starting  
> FAILURE  
> C:\Users\lorauser\Documents\Arduino\libraries\arduino-lmic-matthijskooijman\src\lmic\radio.c:545

The message changed. RFM module is working. I soldered the VCC back. I’m back to initial message

> Starting  
> Packet queued  
> 132006: EV\_TXCOMPLETE (includes waiting for RX windows)

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [October 14, 2020, 10:07am UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/77 "2020-10-14T10:07:07Z")

</div>

Really good answer - thanks. All seems in order to me.

The simulation tells us that the library errors correctly when the radio is not connected, but not if there is an issue with it.

I’m presuming you have an appropriate length piece of wire on the antenna that’s cropped top right in the picture - 82mm or 164mm.

Can you try sending a downlink from the TTN console to see if your ABP sketch is receiving as well as sending?

---

<div class="post-metadata">

**Author:** ![lorauser](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/lorauser/32/25844_2.png) [@lorauser](https://www.thethingsnetwork.org/forum/u/lorauser)\
**Post date:** [October 14, 2020, 10:19am UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/78 "2020-10-14T10:19:44Z")

</div>

> [@descartes](#):
>
> I’m presuming you have an appropriate length piece of wire on the antenna

I’m using the antenna that I received with this module.

 ![antena](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/4/9/49d563b14eeb84e64aa0e0c4d0bb8de8e52f2e30.jpeg)

I sent downlink message. The sketch don’t see nothing.  
The packet is queued.

 ![downlink](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/6/2/62c2b934bd015846f2975892a5c1ed71d41fab5f.jpeg)

#### Frames up 0

#### Frames down 0

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [October 14, 2020, 10:23am UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/79 "2020-10-14T10:23:33Z")

</div>

Did you tell the node to send an uplink? It will only get it when it uplinks …

---

<div class="post-metadata">

**Author:** ![lorauser](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/lorauser/32/25844_2.png) [@lorauser](https://www.thethingsnetwork.org/forum/u/lorauser)\
**Post date:** [October 14, 2020, 10:25am UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/80 "2020-10-14T10:25:17Z")

</div>

> [@descartes](#):
>
> Did you tell the node to send an uplink?

How to do that? Upload raw sketch for listening?

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [October 14, 2020, 10:37am UTC](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058/81 "2020-10-14T10:37:03Z")

</div>

The ABP sketch is just fine - hit the reset button on the Arduino.

Hopefully just after you get the `EV_TXCOMPLETE` you’ll get a `Received x bytes of payload` message

[Previous page](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058.md?page=3)

[Next page](https://www.thethingsnetwork.org/forum/t/arduino-nano-and-rfm95-basic-test-ev-join-txcomplete-no-joinaccept/40058.md?page=5)
