Dronekit-Python Error with Raspberrypi4-Ubuntu20.04 "dronekit.APIException" - python-2.7

I'm trying to run the script by python2-3 (alias).
This is for drone's flight so I'm using dronekit.
But I got this error as below.
Please help me to solve this error.
Ubuntu20.04
Raspberrypi 4 Board
Dronekit 2.9.2
Python2.7 & Python3.8
enter image description here

In the terminal output that you posted, there is a Timeout exception at the line which reads vehicle = connect('/dev/ttyAMA0', baud=921600, wait_ready=True) . More details about your setup would be useful, but I'm going to assume you are using a serial radio to communicate with your drone. If that's true, some troubleshooting steps may be:
Make sure the radio is being mounted to /dev/ttyAMA0.
Make sure the baud rate for the radio is 921600. If it's something different, pass this value in as the baud parameter in connect.
When asking questions, it's best to give as much detail as possible, and, as the above commenter said, please include code as text instead of linking to screenshots.

Related

How can i start the GDB server in stm32cubeide?

right now I am trying to program on the STM32G0-Disco-board with the program stm32cubeide on WIN10.
This worked fine until it didn't.
My problem right now is that I can't debug/run it anymore. This is the first day I used this program, which doesn't mean it didn't worked at the beginning. Building, Debugging and Running worked just fine.
But now I get this error message:
Error in final launch sequence:
Failed to start GDB server
Failed to start GDB server
Error in initializing ST-LINK device.
Reason: (4) No device found on target.
I already tried multiple usb-ports, the jumper on the board. I even looked in this Batchfile:
C:\ST\STM32CubeIDE_1.3.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_1.3.0.202002181050\tools\bin
ST_LINK_gdbserver because it was mentioned in other threads and i just got this:
ERROR: Couldn't locate STM32CubeProgrammer in '..\STM32CubeProgrammer\bin\', use -cp
GDB server exited.
And oh yeah i already looked into the device manager and everything looks good to me.
Help is much appreciated!
I had the same problem and i managed to solve it . It turns out that my antivirus software (avast) was preventing the debugger from starting by removing the file ST_LINK_gdb.exe from its place and putting it in the antivirus chest.
The solution was to open the virus chest and and restore the file and also add an exception. And this solved the problem.
Short BOOT0 (see the pinout of your board) to the 3.3 V, then power cycle, and program it
I had the same problem, thank you Chris for your suggestions!
To be clear, these are the steps I followed:
short BOOT0 to +3.3V (BOOT0 and 1 are pulled low via 1K on my board)
cycle power with the short in place
remove the short
cycle power again
good to go!

QT Terminal Example not sending data

Qt "Terminal Example" is not working as expected with RS232.
I am using this as a boilerplate for my serial GUI application but cannot get it to send data to my device. Using the same settings in PUTTY I get a perfect output. I have narrowed it down to the issue that it will only send a single message and then no more. Is there some loop in there? I've already put debug statements all over to check unknown actions with no luck.
I checked what functions are outputting but I cannot see anywhere that it closes the port.
I also thought that maybe it was just me not sending the \r command but even this did nothing. I simply send the first message and then it does nothing.
I have tried sending it manually, with commands like these:
m_serial->write("command");
m_serial->write("command\r");
I have also tried following a solution here: How to make QSerialPort from Qt5.13.1 work?
I tried to update to the newest version and the maintenance tool did not find repository so I just did a clean install with 5.12.5 and same problem persists.
In my image, the first set of open-close is the terminal example. The second set is Putty working. I am definitely connecting because the error checking and serial port info I get from Qt is correct.
EDIT
My port settings are:
Baud: 9600
Data bits: 8
Stop Bits: 1
Parity: None
Flow Control: None
Qt Version: 5.13.1, 5.12.5

Issue detecting / communicating with card reader using pcsc-lite on RHEL 6 linux using C++

I am trying to develop an application that would interface with a Smart Card Reader and read information from the smart card.
Let me give you the development environment and the hardware used.
OS: Red Hat Enterprise Linux 6
IDE: Eclipse Juno CDT
Language: C/C++
Hardware:
Smart Card Reader: Omnikey 5321 (https://www.hidglobal.com/products/readers/omnikey/5321)
I have installed the driver and can find the following directories / files:
/usr/lib64/pcsc/drivers/ifd-ccid.bundle
/usr/lib64/pcsc/drivers/ifdokrfid_lnx_x64-2.10.0.1.bundle/Contents
/usr/lib64/pcsc/drivers/ifdokrfid_lnx_x64-2.10.0.1.bundle/Contents/info.plist
/usr/lib64/pcsc/drivers/ifdokrfid_lnx_x64-2.10.0.1.bundle/Contents/Linux
Contents of info.plist clearly show the "OMNIKEY CardMan 5x21" string under "ifdFriendlyName" key.
I want to use the PC/SC standard. Hence I have downloaded and installed the PCSC-lite and I have the checked that the daemon (pcscd) is running and the service status is ok.
Now comes the interesting part...
In my code, I used the following APIs in sequence.
SCARDCONTEXT oSCardContext;
SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, & SCardContext);
SCardEstablishContext() returns SCARD_S_SUCCESS. Great!
SCARDCONTEXT oSCardContext;
DWORD dwReaders = SCARD_AUTOALLOCATE;
LPSTR mszReaders;
SCardListReaders(oSCardContext, NULL, (LPSTR) & mszReaders, & dwReaders);
SCardListReaders() returns SCARD_E_NO_READERS_AVAILABLE. Not good.
At this point I go and check that the reader is properly connected. Yes it is.
I verify if I can see any reader entries in the /etc/reader.conf but I find no readers listed in here.
I then go to /etc/reader.conf.d but find no files in here as well.
So the smart card context is empty, I presume and hence no readers are listed.
So the issue right now is that pcsc-lite cannot detect(?) my reader attached and for which driver has been installed?
Just to check I wrote a simple program using the udev library to read all the "usb" subsystem entries and am able to find the following info from udev about the card reader connected:
Device Node Path:(null)
Vendor ID:076b
Product ID:5321
Manufacturer:OMNIKEY
Product:Smart Card Reader USB
serial:(null)
So am sure the device is detectable. But why is it that PC/SC Resource Manager cannot create this context?
So, How do I resolve this?
I am new to Linux, and have been trying to solve this issue myself without asking for help. But then I see that when there is time constraint it is indeed wise to better seek help from experts and people who have worked and / or encountered such an issue.
I have been googling too much but have not seen any that have my issue. So I presume I am missing something really basic perhaps.
If there is something I need to provide, please let me know. I will do so ASAP.
I appreciate your time to read.
Regards.
EDIT :
I have updates...
I did the following:
1. I got a new card reader (SCM Microsystems) and still it was not detected.
2. The pcscd daemon was started at boot time by default. I stopped the service after I logged in, and then run in foreground mode using the command "pcscd -a -f -d" and the SCM reader was detected successfully.
3. I tried to plugin the reader in my question above, the OMNIKIEY 5321, and it was not detected.
Apprently, I arrived at the following conclusion:
1. For some reason until pcscd was stopped and run in foreground mode manually after I logged in, the readers were not detected.
2. The OMNIKEY reader / driver has a problem.
Regards.

Select Timeout error in Ubuntu - Opencv

I am trying to set OpenCv up for my final year project and have run into a couple of problems. I successfully got it set up in Ubuntu following this tutorial.
The problem I am having now is keeping this sample program running. The program is face detection using a webcam.
It runs fine for 3 or 4 seconds and then the capture gets stuck with a single frame in the window. The console displays the following output.
tom#ubuntu:~/College/opencv/faceDetect_sample$ make
./faceDetect --cascade="haarcascade_frontalface_alt.xml" --nested-cascade="haarcascade_eye_tree_eyeglasses.xml"
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
init done
opengl support available
select timeout
select timeout
select timeout
select timeout
select timeout
select timeout
^Cmake: *** [run] Interrupt
If anybody has an idea of where to go from here, I would really appreciate some help !
Try this:
modprobe uvcvideo nodrop=1 timeout=6000
and if that works, simply make the changes permanent by editing /etc/modprobe.d/modprobe.conf
Try increasing the timeout to a ridiculously large number. That should fix the issue, or at least it worked for me. It's just that the call to select returns no ready descriptors, and that may be caused by the video driver, or device one.
If that does not work,
Enable module traces:
sudo echo 0xffff > /sys/module/uvcvideo/parameters/trace
Run the program until the error is found, and stop it as soon as possible. Then disable the traces:
sudo echo 0 > /sys/module/uvcvideo/parameters/trace
Search with dmesg for error messages.
It can be resolved if we add the following lines to the code:
VideoCapture capture(<device id>);
capture.set(CV_CAP_PROP_FRAME_WIDTH , 352);
capture.set(CV_CAP_PROP_FRAME_HEIGHT , 288);
Following is a good link where the solution is explained in detail:
http://derekmolloy.ie/beaglebone/beaglebone-video-capture-and-image-processing-on-embedded-linux-using-opencv/
I had the same issue with my Logitech C920. I tried the following solutions without any success. However, it worked like a charm with the C930e webcam so I guess the V4L API has something to do with it.

Unable take input from USART - FreeRTOS - AT32UC3A0512

Just trying my hands on FreeRTOS. Following are my setup -
Micro-controller - AT32UC3A0512
Board - EVK1105
Using FreeRTOS
Environment - AVR Studio 5 with ASF latest 2.3 framework
I just created a new project from Example project FreeRTOS. I am checking the USART currently.
When run the example project, I am able to transmit characters from my development board to PC through USART but when I type or input something on my PC usart terminal program(using Putty), I am not able to see anything. Can anybody suggest what may be wrong? Or do I need to change the code in the current example code to get input and display on my terminal program for USART?
Thanks...
Off the top of my head, I'm thinking:
Is your putty character ending set right? Like probably utf-8 to send to your MCU?
Is your MCU receiving anything in its receive buffer?
Hope it helps (:
I figured out my problem too. It seemed that the task had an stackoverflow.
It didn't freeze but went into an infinite loop in the applicationstackoverflowhook function.
Giving the task more stack solved the problem.
I got the problem solved. I removed the ISR based code. Just I initialized the gpio module and then initialized the rs_232 mode for usart , rest I used the existing USART.h and usart.c file API to send or receive data in a FreeRTOS task. That solved my problem...