New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LMIC ASSERT on line 1875: "ASSERT((LMIC.opmode & OP_TXRXPEND)!=0)" #91
Comments
Double check connection of D0, D1 and D2 - if works only once it is problem in conection with those pins in most cases. Here is more info: #40 |
We fixed the issue by connecting D2 to fit the mapping. |
@Bertramp, hm then my analysis of the code is incorrect. Your understanding of the documentation is how I had intended it, but apparently I misunderstood something. |
@matthijskooijman It's plausible your analysis is wrong, but it seems to me a lot more people should've run into the issue then. It's a very essential part of using the library after all. |
I had this issue initially, also. I found that the issue was specifying the D2 pin (4) when it wasn't connected. The first entry is always needed (2). The second entry (3) is required for LoRa. The third entry (4) is required for FSK. If you're not using the FSK modes, then specify that as LMIC_UNUSED_PIN. |
@jcwren We'll test that on occasion, it would make a lot more sense than the case that D2 is actually being used for something. |
Here's the problem, I believe. In hal.c, dio_states is initialized to 0's. Pins specified for DIO are configured as inputs, which turns on the internal pull-up. When they're unconnected, they will read back as a 1. In hal_io_check(), it's testing dio_state [x] against the pin for x. In this case, 'x' is 2, the pin is not connected so reads back as 1. If the two values are not equal, it inverts dio_state [x]. Next, if dio_state [x] != 0, it calls radio_irq_handler (x). Basically, because the pin is high, it believes there's a packet to be processed and calls the FSK handler. The rest of the code isn't in the correct state for a received packet at that point, so the assert() occurs. |
So the problem is caused by not using DIO2 but not specifying it as LMIC_UNUSED_PIN either? If so, the docs should probably be updated to make this more explicit. |
@matthijskooijman, yes, I believe so. |
@jcwren We have also got it working using specifying DIO2 as LMIC_UNUSED_PIN, and we believe your location of the problem is correct. |
Fix matthijskooijman#91: && was incorrectly used instead of &
Hi
We have a setup using an RFM95 module with a builtin level shifter and an Arduino Uno with the pin mapping below.
Data is being transmitted and we have verified it's arrival on the receiving end just fine using the "hello world" example, but this only works once. After transmitting the data it fails the
ASSERT((LMIC.opmode & OP_TXRXPEND)!=0)
in LMIC.c line 1875 getting the following output in the terminal:LMIC.c lines 1874 and 1875:
We tried to figure out where the LMIC.opmode changed or possibly failed to change correctly, but couldn't. We have also checked the pin connections, changed the wires and switched to different pins on the arduino without any luck.
Has anybody had this problem or got a hunch about what we're doing wrong?
Thanks!
The text was updated successfully, but these errors were encountered: