two solid red LEDs
two solid red LEDs
Whenever I flash my code to my crazyflie, when it gets done and restarts in firmware mode, the two front red LEDs go solid and nothing else happens. Crazyflie Client won't connect.
I was able to get it to not do this and to reboot into firmware mode as normal by removing some lines of code, and I've been trying to pinpoint the problem by slowing adding my code back in line by line. What I have discovered by doing this is that it seems to be random. at one point it rebooted as normal, and then I cleaned, built, and reflashed (using radio) AFTER MAKING NO CHANGES TO CODE WHATSOEVER, and then it did the two solid red LEDs thing again.
Please help! What is wrong with my Crazyflie? I am nearing assignment deadline and can't make any progress on my project!
I was able to get it to not do this and to reboot into firmware mode as normal by removing some lines of code, and I've been trying to pinpoint the problem by slowing adding my code back in line by line. What I have discovered by doing this is that it seems to be random. at one point it rebooted as normal, and then I cleaned, built, and reflashed (using radio) AFTER MAKING NO CHANGES TO CODE WHATSOEVER, and then it did the two solid red LEDs thing again.
Please help! What is wrong with my Crazyflie? I am nearing assignment deadline and can't make any progress on my project!
Re: two solid red LEDs
UPDATE:
When I try to connect to Crazyflie Client while two red LEDs are solid, I get this on the console:
SYS: Assert failed src/modules/src/log.c:165
When I try to connect to Crazyflie Client while two red LEDs are solid, I get this on the console:
SYS: Assert failed src/modules/src/log.c:165
Re: two solid red LEDs
UPDATE 2:
So removing my deck driver file and all references to it in Makefile and config.mk seems to have permanently solved the problem. Now I'm trying to add my stuff back in line-by-line again, but I would really like to know what the two solid red LEDs and the error message mean so I may be able to avoid problems in the future.
So removing my deck driver file and all references to it in Makefile and config.mk seems to have permanently solved the problem. Now I'm trying to add my stuff back in line-by-line again, but I would really like to know what the two solid red LEDs and the error message mean so I may be able to avoid problems in the future.
Re: two solid red LEDs
The two solid red LEDs means you hit an assert. Looking in the file "src/modules/src/log.c:165" I can see it asserted because of a too long name. The log group + log name cannot exceed 25 characters combined.
Re: two solid red LEDs
What does that mean? I'm not doing anything to log group or log name in my code.
I've changed some things since initially posting this, and now I'm getting the two red LEDs again, and this time the assert that is failing is:
src/modules/src/param.c:98
Looking at the file it is param group or name too big. What am I doing wrong?
I've changed some things since initially posting this, and now I'm getting the two red LEDs again, and this time the assert that is failing is:
src/modules/src/param.c:98
Looking at the file it is param group or name too big. What am I doing wrong?
Re: two solid red LEDs
That is strange. Can you share your code so we can replicate the problem here?
Re: two solid red LEDs
Well, now I'm not getting the error message when I try to connect anymore!
Okay, so here's what I'm doing: I've got an IR emitter on the back of another robot, and I want to put two IR sensors on the front of my CF to allow it to locate and follow the robot. This is my first project with the CF and I feel like I must be reinventing the wheel a bit, but that is how I learn.
I'm still in the testing phase, so I've got my IR circuits breadboarded and I'm using the Breakout deck to test them. What I'm trying to do is put a DEBUG_PRINT line into the method that I'm passing into the timer in order to see what values I am getting from the sensors.
It compiles fine with or without that DEBUG_PRINT, and it flashes to the CF no problem, but when it restarts in firmware mode immediately after flashing, if the DEBUG_PRINT line is included, the two front LEDs go solid red. then when I try to connect to the CF through the client the console gives me no information, but the terminal window shows:
...and it just goes on like that forever.
I've read some stuff about using the log to monitor variables but I haven't figured out how to do that.
Another problem I've been having is that I want to write other methods and call them from my Loop() method so that I can compartmentalize my code better, but I get errors when I try to do that. I have tried to read up on freeRTOS to figure out a way to do this. There is SO MUCH documentation on freeRTOS and I don't understand it well enough yet to figure this issue out.
Any pointers or help you guys have would be great. Thanks.
Okay, so here's what I'm doing: I've got an IR emitter on the back of another robot, and I want to put two IR sensors on the front of my CF to allow it to locate and follow the robot. This is my first project with the CF and I feel like I must be reinventing the wheel a bit, but that is how I learn.
I'm still in the testing phase, so I've got my IR circuits breadboarded and I'm using the Breakout deck to test them. What I'm trying to do is put a DEBUG_PRINT line into the method that I'm passing into the timer in order to see what values I am getting from the sensors.
Code: Select all
/* debug mode */
#define DEBUG_MODULE "ir"
#include "debug.h"
/* end debug */
#include <stdint.h>
#include <stdlib.h>
#include "stm32fxxx.h"
#include "FreeRTOS.h"
#include "timers.h"
#include "deck.h"
#include "log.h"
/* Define expansion deck IOs */
#define IR_L DECK_GPIO_RX2 // left IR sensor
#define IR_R DECK_GPIO_TX2 // right IR sensor
static float IR[2][7]; // array for holding some sensor data
static xTimerHandle T;
static void Loop() {
IR[0][0] = analogRead(IR_L);
IR[1][0] = analogRead(IR_R);
DEBUG_PRINT("%f\n", IRsensor[0][0]); // this is how I'm trying to see what values I'm getting from the sensor(s)
}
/* main initialization */
static void irInit() {
pinMode(IR_L, INPUT);
pinMode(IR_R, INPUT);
T = xTimerCreate("Loop", M2T(10), pdTRUE, NULL, Loop);
xTimerStart(T, 100);
}
static bool irTest() {
return true;
}
static const DeckDriver irDriver =
{
.name = "ir",
.usedGpio = DECK_USING_RX2 | DECK_USING_TX2,
.init = irInit,
.test = irTest,
};
DECK_DRIVER(irDriver);
Code: Select all
INFO:cflib.crazyflie:Callback->Connection initialized[radio://0/80/250K]
INFO:cflib.crazyflie:We are connected[radio://0/80/250K], request connection setup
INFO:cflib.crazyflie:Callback->Connected to [radio://0/80/250K]
INFO:cflib.crazyflie:Resending for pattern (93,5)
INFO:cflib.crazyflie:Resending for pattern (93,5)
INFO:cflib.crazyflie:Resending for pattern (93,5)
INFO:cflib.crazyflie:Resending for pattern (93,5)
.
.
.
I've read some stuff about using the log to monitor variables but I haven't figured out how to do that.
Another problem I've been having is that I want to write other methods and call them from my Loop() method so that I can compartmentalize my code better, but I get errors when I try to do that. I have tried to read up on freeRTOS to figure out a way to do this. There is SO MUCH documentation on freeRTOS and I don't understand it well enough yet to figure this issue out.
Any pointers or help you guys have would be great. Thanks.
Re: two solid red LEDs
Great to get some information around the project. Much easier to help then. Sound like you have a good approach.
What kind of IR sensors are you using?
You are probably flooding the communication with the DEBUG_PRINT as the loop is running 100 times per second. Or might be a stack overflow problem. Instead you should use the logging framework for that. Have a look at the wiki for some basic documentation and also check other source files for examples. It is fairly simple to use. Let me know how it goes.
What kind of IR sensors are you using?
You are probably flooding the communication with the DEBUG_PRINT as the loop is running 100 times per second. Or might be a stack overflow problem. Instead you should use the logging framework for that. Have a look at the wiki for some basic documentation and also check other source files for examples. It is fairly simple to use. Let me know how it goes.
Re: two solid red LEDs
Thank you,
I've got this:
And then I get an "InfraRed" line in my Log TOC that has:
ID: 107
Unpack: <f
Storage: float
but there is nothing in the Log Blocks tab.
So how to I actually monitor the value of the variable?
I've got this:
Code: Select all
LOG_GROUP_START(InfraRed)
LOG_ADD(LOG_FLOAT, InfraRed, &IR)
LOG_GROUP_STOP(InfraRed)
ID: 107
Unpack: <f
Storage: float
but there is nothing in the Log Blocks tab.
So how to I actually monitor the value of the variable?
Re: two solid red LEDs
If you want to log your variable you need to create a log block with this variable in it using setting/logging configuration. You can add up to about 6 floats in each log block and chose the logging rate. The block can then be plotted in the plotter and you can start it and save it to an csv file in the log block tab.
Note that if plotting does not work, you can try to disable some log block in the log block tab. We are currently setting up the maximum amount of log block with the latest client and we need to increase the max number of log block in the Crazyflie.
Note that if plotting does not work, you can try to disable some log block in the log block tab. We are currently setting up the maximum amount of log block with the latest client and we need to increase the max number of log block in the Crazyflie.