Library Error Message

@descartes The message “Unknown event” appearing in the Serial Console only appears once in the code in the section which starts.

“// Next TX is scheduled after TX_COMPLETE event.”

Where it is the last line and is the default. This doesn’t solve the problem of course but I guess it points to where to start looking. :slight_smile:

I did look to see if I could compile it using an LMIC library from 2017 but I couldn’t find one.

I read all the source code for the LMIC 2.x series - it won’t take me long to track down the culprit.

Forgot to to answer this question, I am using ABP as the activation method.

@descartes I think I may found the problem. :slight_smile: It is transmitting on US frequencies!

Here’s a screenshot and they are definitely coming from my device as the timing corresponds exactly to the activity on the serial console plus if I disconnect it they stop.

airspy-scnshot1

There are two lines:

#if defined(CFG_eu868)

and then later:

#elif defined(CFG_us915)

So it isn’t picking up the eu868 and is defaulting to US. The problem is I can’t see where it is supposed to be defined…

Ah, yeah, one of those Arduino library things where in theory the library is self-contained but in practise, you’ll need to go in to your Arduino folder, in to Libraries, in to MCCI_LoRaWAN_LMIC, in to src, in to lmic, open the config.h file and make sure that line 23 reads:

# define CFG_eu868 1

although it is set to that in GitHub.

I see that the tutorial code also patches out five channels that TTN uses - so where in the main code it has that #if defined(CFG_eu868), underneath it would be useful to uncomment channels 3 to 8.

I’m just casting about for the right bits and then I’ll be able to flash an Arduino with the same code base as you for more efficient debugging purposes.

Thank you. :slight_smile:

Sadly, line 23 reads as it should. I’ve tried a few bodges including putting all the EU channels in the elif section in the hope it might default to that but it didn’t.

I’m fully smoked after a fire pit BBQ and will be able to pick the code apart in the morning.

I’m very grateful for your help. Hopefully, this can be resolved with a bit of code tweaking. I was relieved to discover I don’t seem to have killed the thing and it is working, albeit with an American accent. :smile:

I’ve broken the shackles of domestic bondage for a couple of hours in exchange for cooking Sunday Dinner but this is a head scratcher.

I grabbed the nearest machine, in this case a clean Windows 7, put the right versions on as per my recipe, and whilst it says it’s doing things, it doesn’t transmit. PANIC!

So after a clean out of the Arduino cruft on my iMac, put IDE 1.8.9 & LMIC 2.2.2 on and hey presto, it just works.

Now to find a random Linux machine to try this on and then see if I can pick through the Windows issue.

Thank you, that is weird. I thought I had found something in the config.h file as the radio is not defined, specifically line #50 is commented out but removing the // makes no difference.

A very common cause of this is a new event code in MCCI LMiC which indicates part of the join cycle. Unless someone’s Arduino sketch has a message for that event code, it ends up as “uknown”

If MCCI LMiC is being used I believe they have examples on how to do things for different regions (they not only do non-radiating instrumented testing on various bands distinct from where they are sitting, but their own on-air efforts also span a number of countries with different bandplans). The code, er mis-management philosophy of the Arduino IDE does make it challenging, but it’s not a new or novel challenge but essentially something faced by anyone who uses it.

From what I have discovered the “Unknown event” message isn’t a problem. It is written in the code at the end of a list of “Case” options which cover specific errors. If none of these errors occur then it prints the message but it also means the message is printed when no error was found. That’s my understanding so far anyway.

The case statement attempts to interpret codes representing events, only some of those events are “errors” of any sort.

At least EV_RXSTART and EV_JOIN_TXCOMPLETE are recent additions to the MCCI repo; EV_TXCANCELED may(?) also be but is a little older than the others.

1 Like

A rather long winded testing of multiple combinations, but progress! The not-published release of an alternative implementation (or wrapper, as most are getting the original IBM code suitable for the Arduino) works on both Windows & macOS using the latest Arduino IDE:

Download as a zip, unzip and put it in your libraries folder and remove the other library.

I would strongly recommend using the TTN-ABP example (in the LMIC-Arduino folder), pop in your keys and the pins for your board and cross your fingers. Once that’s running you MAY find the original code from the TTN story works, it may not, but we can move this along once we’ve got your radio transmitting.

This is the test rig I built yesterday so it wasn’t tainted by the numerous PCB’s I’ve got:

ProMini and RFM95

The unknown event is irrelevant if we are moving over to a different implementation of LMIC. I did look at what it actually was but the issues with Windows have pushed that out of my memory. However as cslorabox says, we still need to pay attention to events as that’s what tells what the stack is up to.

1 Like

Many thanks yet again.

You’ll see on the small white board that I’ve removed the resistors so they don’t interfere with the Hope board. They are required if you are using an ESP8266 or similar WiFi board which is what it was originally designed for.

Underneath there is a place where a voltage reg would go for the ESP module - to allow use of the bottom left pin we need to put a small link in. On my picture this is one of ground pins for the RFM, if the RFM is the other way round, it would be DIO2 which isn’t vital but can be useful. Here’s a picture showing how it needs to be bridged:

IMG_4952

No problem - I find it easier to do useful things if they have a recipient / tester.

The small Arduino’s are filled up rather too quickly if you have a sophisticated sensor, multiple sensors or need more ‘intelligence’ but they are a low cost quick build and there is a wealth of support info on things you can attach to them on the inter webs, so I’m motivated to support them for adhoc pieces of work.

It’s clear as mud that bit - if you DON’T choose either one or the other, the next set of lines then choose the SX1276 and then checks you haven’t uncommented both line 47 & 50.

If you use WordPress, you’ll recognise that this is a similar build up of cruft & conflicting additions.

I’m being dim again but I’m struggling to download that LMIC library. There is no download zip button (I believe they have removed it) and because, I assume, it isn’t published I can’t load it from within the IDE as it only shows up to version 2.

Edit: I’m downloading the GitHub Desktop now so will give that a try.