matthijskooijman / arduino-lmic

:warning: This library is deprecated, see the README for alternatives.
708 stars 649 forks source link

LMiC not processing MAC commands #136

Open pansofik opened 6 years ago

pansofik commented 6 years ago

Does LMiC v1.5 process MAC commands? I am using the stack against Actility NS and there is no processing of the downlink MAC commands that I see. Not sure if its a HAL or radio issue. lmic.c has the code to process MAC commands which looks correct. I do note that the readme states MAC processing has not been tested. Has this changed? Obviously ADR cannot work with this.

cyberman54 commented 6 years ago

I am using LMiC 1.5 on TTN and see ADR working on my nodes, so i assume MAC commands are executed.

matthijskooijman commented 6 years ago

Could it be downlink isn't working properly due to timing inaccuracies?

pansofik commented 6 years ago

Could be timing. I will check that. Thanks for the prompt response!

cyberman54 commented 6 years ago

try a downlink with ABP join. If this does not work, you found the reason why OTAA can't work.

cyberman54 commented 6 years ago

I checked this again with LMIC 1.5 ardunio-2 and TheThingsNetworks joined via OTAA. I can confirm that ADR setting works, the node's spreadfactor is remotely controlled by the network. So, MAC commands work.

pansofik commented 6 years ago

Thanks. I keep getting rxtimeout so maybe something with timing or how i access the radio. I am using a Modtronix inair9 and a 3.3v 8mhz arduino mini pro. I have SPI connected to correct pins and set up the dio pins as follows:

// Pin mapping const lmic_pinmap lmic_pins = { .nss = 10, .rxtx = LMIC_UNUSED_PIN, .rst = LMIC_UNUSED_PIN, .dio = {2, 5, LMIC_UNUSED_PIN}, };

I am also using a clock offset (this is definitely needed as OTAA will not work unless I use the offset:

// Deal with clock inaccuracies affecting Rx Window timing (NEED THIS for MINI PRO!) LMIC_setClockError(MAX_CLOCK_ERROR * 1 / 100);

Any ideas welcome.

Thanks

On Thu, Feb 15, 2018 at 4:41 PM, Verkehrsrot notifications@github.com wrote:

I checked this again with LMIC 1.5 ardunio-2 and TheThingsNetworks joined via OTAA. I can confirm that ADR setting works, the node's spreasfactor is remotely controled by the network. So, MAC commands work.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/matthijskooijman/arduino-lmic/issues/136#issuecomment-366070753, or mute the thread https://github.com/notifications/unsubscribe-auth/AVj3hzM_T2sCh_GNNYuxnBIFT3Gs4H_wks5tVKR1gaJpZM4RwCZC .

pansofik commented 6 years ago

Did not send to all first time

Thanks. I keep getting rxtimeout so maybe something with timing or how i access the radio. I am using a Modtronix inair9 and a 3.3v 8mhz arduino mini pro. I have SPI connected to correct pins and set up the dio pins as follows:

// Pin mapping const lmic_pinmap lmic_pins = { .nss = 10, .rxtx = LMIC_UNUSED_PIN, .rst = LMIC_UNUSED_PIN, .dio = {2, 5, LMIC_UNUSED_PIN}, };

I am also using a clock offset (this is definitely needed as OTAA will not work unless I use the offset:

// Deal with clock inaccuracies affecting Rx Window timing (NEED THIS for MINI PRO!) LMIC_setClockError(MAX_CLOCK_ERROR * 1 / 100);

Any ideas welcome.

Thanks

On Thu, Feb 15, 2018 at 4:41 PM, Verkehrsrot notifications@github.com wrote:

I checked this again with LMIC 1.5 ardunio-2 and TheThingsNetworks joined via OTAA. I can confirm that ADR setting works, the node's spreasfactor is remotely controled by the network. So, MAC commands work.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/matthijskooijman/arduino-lmic/issues/136#issuecomment-366070753, or mute the thread https://github.com/notifications/unsubscribe-auth/AVj3hzM_T2sCh_GNNYuxnBIFT3Gs4H_wks5tVKR1gaJpZM4RwCZC .