QT Terminal Example not sending data - c++

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

Related

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

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.

"X11 wrong authorisation protocol attempted" with opengl and sdl over ssh

I've followed a few tutorials on setting up Xming and putty, and also trying with cygwin but there is one particular C progam from a raspberry pi I'm having issues with over ssh to my windows machine. I've been somewhat successful as I can get Pygame and a few other small things to show up on my desktop. I'm now trying to do the same thing with the C program that uses SDL and OpenGL packages. When I try to run the program through ssh I get init_sdl() PuTTY X11 proxy: wrong authorisation protocol attempted
I also get the same error when trying to run it with MobaXterm.
at one point I did get init_sdl() without the error, but there should be two more lines that follow after that and then a GUI appear, and it isn't happening. So I think it's hanging on trying to initialize sdl? I'm not really sure. Are there any other resources I need for my windows side client?
If needed, here's the program I'm trying to run. It does work on the pi, just not over ssh. https://github.com/bear24rw/rgb_table/tree/master/code/table_drivers/beat_finder
Update: I can get init_sdl() to show every time now without the error following in cygwin, but still not getting a GUI to show or get the the full readout of
init_sdl()
init_gl()
init_fft()
init_serial() which is what should show.
EDIT2: There is a use_gui = TRUE/FALSE; option in the code, when I set this to false, I get init_fft() and init_serial() and the code works, but I would still like to have what's missing with SDL or GL to get the GUI part to work over SSH.

iTerm2 Coprocess Debugging

I'm attempting to develop a coprocess plugin in python for iTerm2 but am running into some issues. I have a script that takes input from STDIN and sends it across the network to a listening daemon. This works fine when run from the command line, however when I activate the coprocess either via the menu or a trigger I just see a brief flash of the coprocess icon in the upper right corner. Googling does not reveal whether or not iTerm2 sends output anywhere that I can examine. I have looked at all of the system logs in Console.app but there is nothing there. I've also tried Toggling the Debug Logging in iTerm but I do not see any coprocess data in there. Anyone know if/where to find the STDOUT/STDERR of a coprocess script?
Stdin and stdout are hooked up to the tty as described in copresses documentation (and may be silent or visible depending on how it is set up). As for stderr, (judging by the lack of any redirect of fd 2 in Coprocess.m source) it is the same as stderr of iTerm2 itself. In order to see the error of copresseses, you can launch iTerm2 from Terminal in the foreground (open /Applications/iTerm.app/Contents/MacOS/iTerm2), interact with iTerm2, and view the stderr within Terminal.

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...