-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
1272 uno and error radio.c:659 #40
Comments
Did you set the radio type in config.h to 1272? What version are you using exactly, since git master does not have an assert on that line... |
I am seeing the same error. It definitely worked last week. Since then I had some updates to the Arduino IDE Software. I am using Arduino 1.6.11 from AUR on Arch. Maybe this could be related? Edit:
|
This issue could be related to the recently updated AVR board definitions. If you are running AVR board defs > 1.6.11, downgrade to 1.6.11 Try downgrading this (tools->board->board manager, Arduino AVC Board, install 1.6.11) There have been no code changes since more then 3 weeks, so i suspect the above |
I tried with 1.6.11. Same error. |
I have seen this error before! It happened to me (also with a UNO) when my CS pin came loose. You might also want to check your lmic_pinmap to make sure you're specifying the correct pins. HTH |
Note that the error is just a failed assertion, so it can mean various things depending on the filename and line number shown. Unless anyone seeing this error actually looks up the line mentioned in their version of the source (or at least says what version they are using), I can't really start to provide any advice on fixing this. |
@matthijskooijman is right, unless you show here what's on line 689 of Did you changed the LMIC pins definition in your sketch to conform to Dragino shield wiring? |
I use the latest version(90bc049) from this git repo. Currently the line is https://github.com/matthijskooijman/arduino-lmic/blob/master/src/lmic/radio.c#L689 I am somewhat sure this is related to an update with either the arduino ide or the avr boards as the same sketch worked last week. I also tried another board. It has the same issue |
@ubergesundheit, it is possible your error is different from the one of the original reporter. In your case, the hardware is not detected as a 1276, which likely means that the SPI communication is failing. Regarding the Arduino update, 1.6.10 upgraded the compiler version, so it might very well be caused by that. I don't have any hardware handy to test now, though. |
@ubergesundheit, it might be good to download an older copy of the Arduino IDE (1.6.9 for example) and see if it does work with that one now. If you download the zip version, there is no need to install anything, just run them side-by-side. |
I got the same Error Message with identical Line number in Radio.c when trying to join by OTAA, using an Ideetron Nexus Board with ATmega328p. ABP with the same Code works. So the Error probably has some context with OTAA joining. |
@cyberman54
to
An report here the value read, if it's 0x00 or 0xFF it's a Wiring problem or pin definition problem. That said the problem is one of :
Another issue could be that SPI is going to fast to your device, try switching to 4MHz by changing this line in
|
Looking at the schematics For Ideetron Nexus Board wiring should be in example sketch :
|
Looking at the schematics For Dragino Lora Shield V1.2+ wiring should be in example sketch :
If using Dragino Shield Version V1.1 DIO1 and DIO2 are not connected you need to
|
It came out, it was as simple pin mapping problem. I did not tailor the pin mappings in the example to the nexus board pin mapping properly. Sorry for issuing that here, my fault. Thank you for your support. Here are my settings which are working: // Pin mapping for Nexus with HopeRFM95 |
I was wrong as I though. I have found a better schema in which I have connected:
Unfortunately, I have the same problem still as in this thread. |
Since the original reporter has not provided any additional information, and the comments have possibly strayed very far from the original issue (I suspect we have been talking about two different failed assertions here), I'm closing this issue. For future reference, note that two assertion error messages might be completely different issues if they refer to different lines. Hence saying "I also have an assert failure" does not really mean anything - be sure to include the line number and the contents of that line in any issue you create. |
I use module sx1276 on uno and i get failure Starting |
Check your pinout and pin definitions. |
i use lora gps hat for arduino uno and i get the same error |
I use http://www.dragino.com/products/lora/item/109-lora-bee.html with AT328 CPU (not UNO board, only CPU with minimum components). |
The error is because of the pin on the IC is not configured correctly. Can
you share your code for Pin configuration a in the method of programming
your using? either is it Arduino or Atmel Studio?!
Regards,
Ashish M Mahendra
Ph No: +91 99868 85788.
Skype: ashi.mahe@hotmail.com
…On Wed, Mar 15, 2017 at 4:11 PM, Roberto6969 ***@***.***> wrote:
I use http://www.dragino.com/products/lora/item/109-lora-bee.html with
AT328 CPU (not UNO board, only CPU with minimum components).
When i send message for the first time it goes through, but in the second
attempt get error FAILURE \Arduino\libraries\arduino-
lmic-master\src\lmic\radio.c:660.
Resources of the AT328 are on the limit but i believe this is not the
problem because Dragino sends first message.
Any idea how to send more messages than single one?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD7r_8UtOHdnw6AvDqhikcA7Kv26HaI6ks5rl8BegaJpZM4JygA6>
.
|
again: Check your DIO Pin mapping and ensure that pins needed for lmic are properly connected on your shield to RFM95 module. |
@cattvm Do you mean this part: @cyberman54 What does it mean "properly" connected? Is there any particular advice? Should be - for example - reset pin connected or not? |
yes, this is the relevant part. The pin mappings in table must match pin mappings of used hardware. You should check if your LoRa shield has appropriate pin mapping and if it features all DIO pins which are needed by lmic. Consult IBM lmic 1.5 documentation pdf to find out which pins are needed. Note: there is no standard to map the RFM95 pins to I/O ports of your CPU. Nearly every shield with RFM95 uses different pin mappings, and some (e.g. Adaptive Dragino shield) do not connect all pins which are necessary for using lmic. In this case you either need to tinker your hardware, or use another LoRaWAN software stack. |
addendum: if you tinker your hardware to add pin mappings, be aware of different voltage levels of Arduino board (mostly 5V) and RFM95 LoRa shield (often 3,3V). If voltages do not match, you may want to use level shifter to protect your RFM95 from damage. |
extract from IBM lmic 1.5 documentation: 3.1 HAL Interface
|
What type/brand of LoRa Module are you using?
|
I am using a RFM95W 868Mhz RF Transceiver Module. I communicate in SPI between the module and the Arduino Uno. |
SPI is not sufficient for using LMIC. You need additional interrupt/signalling wiring (at least D0, D1, D2). You to ensure that these connections between your RFM95 board and your Arduino are present, correctly annotated in LMIC code and that 3,3v/5v level shifting is installed. |
I am using D0,D1, D2, nss and rst on my wiring, this is my pin mapping |
Looks like a pin mapping issue, double-check your wiring. |
Use correct names of pins! On CPU ATmega328 is D5 (pin 11), D6 (pin 12) and D7 (pin 13). So in case you connect D0 of RFM95 to D5, D1 to D6 and D2 to D7 you should use: .dio = { 5, 6, 7} // pin names and not numbers. With other words: physical pin on Atmel328P no. 11 is D5 on Arduino UNO and if you connect this D5 from UNO to D0 on RFM95 you should use .dio = { 5, ... and so on. |
Ok so I replace the pin mapping by the physical pin number but now I got this error Failure : /Arduino/libraries/arduino-lmic-master/src/lmic/radio.c:689 |
If I remember correctly, D0 needed to be connected to a pin that supports interrupt... i.e.: pin 2
~~ _/) ~~~~ _/) ~~~~ _/) ~~~~ _/) ~~
Tom Lafleur
… On Apr 25, 2017, at 3:58 AM, yotha ***@***.***> wrote:
Ok so I replace the pin mapping by the physical pin number but now I got this error Failure : /Arduino/libraries/arduino-lmic-master/src/lmic/radio.c:689
This is my new pin mapping =>
// Pin mapping
const lmic_pinmap lmic_pins = {
.nss = 16,
.rxtx = LMIC_UNUSED_PIN,
.rst = 13,
.dio = {4, 5, 6},
};
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Here is working config: |
If you look at the code at 659, you can see that it's trying to read a version register on the chip to make sure it's the correct radio.... it fails, so your not connected correctly to the radio yet...
#ifdef CFG_sx1276_radio
ASSERT( v == 0x12 );
#elif CFG_sx1272_radio
ASSERT(v == 0x22);
Here is my mapping I use with a different processor, I'm using a Moteino Mega LoRa with radio attach to the board. ( rst and d3 are not needed for LoRa if your using RFM95, but it's ok to connect them...) I stoped using 328 processor a few years back... too small, flash, ram ect, most everything now is SAMD21G18A, 32 bits, faster, more flash, ram, lower power, cheaper device..
Look at using a 32 bit RocketScream M0 pro or Adafruit Feather LoRa M0, or the MoteinoMega LoRa, you won't go back to using the 328 CPU
Hope this helps...
#ifdef __AVR_ATmega1284P__ // MoteinoMega LoRa
// Pin mapping
lmic_pinmap pins =
{
.nss = 4,
.rxtx = 0, // Not connected on RFM92/RFM95
.rst = 0, // Needed on RFM92/RFM95 ??
.dio = {2, 22, 0},
};
#define myLED 15
#define MyFlashCS 23
#elif __SAMD21G18A__ // RocketScream
// Pin mapping
lmic_pinmap pins =
{
.nss = 5,
.rxtx = 0, // Not connected on RFM92/RFM95
.rst = 0, // Needed on RFM92/RFM95 ??
.dio = {2, 6, 0},
};
#define myLED 13 // Is 13 on M0
#define MyFlashCS 4
#else
#error Wrong Processor defined
#endif
~~ _/) ~~~~ _/) ~~~~ _/) ~~~~ _/) ~~
Tom Lafleur
… On Apr 25, 2017, at 3:58 AM, yotha ***@***.***> wrote:
Ok so I replace the pin mapping by the physical pin number but now I got this error Failure : /Arduino/libraries/arduino-lmic-master/src/lmic/radio.c:689
This is my new pin mapping =>
// Pin mapping
const lmic_pinmap lmic_pins = {
.nss = 16,
.rxtx = LMIC_UNUSED_PIN,
.rst = 13,
.dio = {4, 5, 6},
};
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@trlafleur Would you be so kind and post link to CPU or development board you use? 328P is a little bit short for use LMIC library with some other sensor libraries |
As I pointed out, I stopped using ATMega328 processor a few years back...
too small, flash, ram ect, most everything now is M0, SAMD21G18A, 32 bits,
faster, more flash, ram, lower power, cheaper device..
My favorite 32 bit processor board:
RocketScream M0 ultra pro Ver2, RFM69 or RFM95 radio, battery connector,
EUI64 chip, large external flash, great support...
http://www.rocketscream.com/blog/product/mini-ultra-pro-v2-with-radio/
Other 32 Bit:
Adafruit Feather LoRa M0, NO EUI64, No External flash, battery connector, RFM69
or RFM95
https://www.adafruit.com/product/3178
https://www.adafruit.com/product/3176
Non 32 bit processors:
MoteinoMega LoRa, ATmega1284P, RFM69 or RFM95, EUI64 chip, large external
flash
https://lowpowerlab.com/shop/product/119
Moteino LoRa, ATmega328P, RFM69 or RFM95, large external flash, NO EUI64
chip
https://lowpowerlab.com/shop/product/99
Adafruit Feather LoRa, ATmega32U4 CPU, NO EUI64, No External flash, battery
connector, RFM69 or RFM95
https://www.adafruit.com/product/3078
~~ _/) ~~~~ _/) ~~~~ _/) ~~~~ _/) ~~
Tom Lafleur
…On Tue, Apr 25, 2017 at 4:48 AM, Roberto6969 ***@***.***> wrote:
@trlafleur <https://github.com/trlafleur> Would you be so kind and post
link to CPU or development board you use? 328P is a little bit short for
use LMIC library with some other sensor libraries
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEXCKx9EhrlLcTqycE_UhPYlZIY8t7yqks5rzd2bgaJpZM4JygA6>
.
|
All it's working now, I send a message and the gateway receive it. Thx all of you, my problem was about of a bad welding.. |
i told you: double-check you wirings... |
I confirmed, I solved the problem by correcting the lmic_pinmap |
Hello, I use an RFM95 module. I also get an error in the serial monitor:
line 686 ... 694 in radio.c:
Hardware:
Software: Config.h line 8... 15
Other Any ideas? |
Hello necessaryevil86 This can be the error
I did as the following with an Adafruit Feather MO
That works since a while. I hope it can help. |
Hello pierrot10, |
Hi all, The difference between the two board is that in the working one I use 4 level shifter from 5V to 3v3V for the lines MOSI, NSS, RESET, SCK, as the link below: Instead, in the not working board I adapt this voltage using 4 simple resistor divider, with 1K in series from the arduino pin and 1k8 to ground, so I obtain (5V * 1K8) / 2K8 = 3.14V on the radio module. In this board (with resistor divider) I have the error: FAILURE but not in the first one, with level shifter, that work fine. This error means SPI failure on reading the RegVersion register, at least in my case.
and add the follow line to continuosly send packed over SPI interface and check the lines with an oscilloscope:
Result: The MOSI, NSS; SCK signals are identical on the 2 boards (except for little difference in the shape of the resistor divider board, but not important at 4 Mhz), but there isn't any signal on the I investigate in the code, and I found a line (in radio.c)I not understand:
My question is, why just before to perform a readReg operation the RST pin is set floating? I modified the code above by commenting out the line where RST pin is configured floating and driving the RST pin high before perform the SPI operation, as follow:
And now all work fine on both the boards, and solved the error. I hope this can help someone! bye! |
The idea is that the RST pin has an internal pullup, so you just let the pullup set the right state. I guess manually driving the RST pin could also work (though it would need to be inverted for 1276), not sure why the original authors chose to do it like this. |
This is intentionally, since hardware datasheet of SX127x says pins shall left floating. Look here: mcci-catena#579 |
Hi all and thanks for your help. |
Yes, I confirm you that by removing the 1K8 resistor to ground in the resistive divider and left only the 1K serie resistor in the RST line from arduino to radio all work fine with the original code. |
Hi, I hope you are doing good. I fixed this issue. Please replace this: with this: in radio.c line 688. |
@guljanjua I tried this but I get an error on line 737. Do you know how can I solve it? |
Hi @KaiserFels , I hope you are doing good. Well I solved this error but still library was not working and was not uploading data to the thingsnetwork. So I ended up using this library: https://github.com/mcci-catena/arduino-lmic One more thing, if you are using Uno and adding GPS or any extra library that will use memory so a stability problem may occur and Arduino will send 2-3 LoRa packets and than it stop sending data. You may need to go for arduino with more memory. I hope it will be helpful for you. |
I am using TTGO v2.1 module. I used the library you posted and after selecting EU868 as the Region, I got the following error. "Error: MCCI_LoRaWAN_LMIC_library-3.0.99\src\lmic\oslmic.c:53" |
Well I am sorry I have not tried this library on esp32. Maybe try changing pin to another pin and see if it works. |
Thank for your time. |
I use module sx1272 on uno and i get failure
The text was updated successfully, but these errors were encountered: