QtMqtt error: TransportInvalid when connect - qt

When I use QtMqttClient source code (download from officcal git repository) in my program On Windows PC, I got a error.
QMqttClient client;
client.setPort(1883);
client.setHostname("192.168.100.3");
client.connectToHost();
I received the following error message:
ClientState:Disconnected, ClientError:TransportInvalid
From the qt documentations, it said:
The underlying transport caused an error. For example, the connection might have been interrupted unexpectedly.
Then I copy the code to another pc with Windows, it worked fine. And worked fine on a Linux PC.
Is there somethings wrong on my computer or the Settings of Windows OS ?

After set breakpoint and add some debug code in my program , I found that the error was in QTcpSocket, the error was occured in the Qt network model lib.
As we know, Mqtt was baed Tcp,and in my program, the tcp can not establish connection,and err is QAbstractSocket::UnsupportedSocketOperationError, this confused me.
Then I search on google, I found a that someone encountered the same situation as me. And I found the solution here.
So, just add the code to the program before connect to server, the program worked well.
/* call before connecting to network. Easiest way is, just call somewhere at the beginning of the program */
QNetworkProxy::setApplicationProxy(QNetworkProxy::NoProxy);

Related

STM32: Unable to successfully load BLE firmware because of FUS_IMAGE_NOT_AUTHENTIC so my code is failing in SHCI_C2_BLE_Init()

I have a custom board with an STM32WB55CEU (512K Flash) that is failing to start the BLE stack on CPU2 in the function SHCI_C2_BLE_Init(). I believe it's failing this function because it failed to load the BLE firmware (stm32wb5x_BLE_Stack_full_fw v1.13.0) correctly. Whenever I try to load the firmware I get an error at the end saying FUS_IMAGE_NOT_AUTHENTIC or FUS_STAE_IMG_NOT_AUTHENTIC depending on whether I try it from the command line over USB or through the GUI over SWD. I can delete the firmware image without error and my FUS appears to be up to date and running before I attempt the update.
Firmware Update Screen from STM32CubeProgrammer
Security Configuration Option bytes
I've also tried deleting the firmware by changing the RDP register from AA to BB and back. I still get the authentication error. This only happens on about half of the boards that I've loaded (13 out of 25). I feel like there is an address of setting somewhere that I'm not setting correctly and since all of the other posts I can find on this issue use the Nucleo with the 1MB flash part I'm not sure if my parts settings should be different. I am putting the FUS and BLE firmware at the correct address for my part according the v1.13 release notes.
Any help to get past this authentication issue would be appreciated. Thanks.

Problem with my block diagram: Error 5002 occurred at Init.vi

I'm making a heart rate analyze, but I'm having a real problem with that. When I'm press to start the programm doesn't work, so, I've press to stop the running program and it shows me in the section where it's ready to close or finish the connection:
Error 5002 occurred at Init.vi. Unable to establish connection with
Arduino. Please ensure that you have selected the correct COM port
and that you have flashed the Arduino with the correct firmware.
This error code is undefined. Undefined errors might occur for a
number of reasons. For example, no one has provided a description for
the code, or you might have wired a number that is not an error code
to the error code input.
Additionally, undefined error codes might occur because the error
relates to a third-party object, such as the operating system or
ActiveX. For these third-party errors, you might be able to obtain a
description of the error by searching the Web for the error code
(5002) or for its hexadecimal representation (0x0000138A).
This is my VI diagram:
And this is my control panel:
And the connections to my arduino:
So:
how can I solve this problem?
Where can I find more information to get this
Thanks for your help, but I'm new on this world (Arduino and Labview)
Follow the suggestion given in error message. First of all, make sure that you could communicate with Arduino using some simple serial line terminal, like RealTerm, or HTerm. In case if you couldn't send any command using serial line terminal, check out which firmware do you have on Arduino.
This is the way, how you could troubleshoot this issue...
You can ignore the second and third paragraphs of that error message; they're generated because the Arduino VI's you're using are generating a custom error code that they haven't registered with the LabVIEW development environment, so its automated error handling doesn't know what they mean. The information you need is in the first paragraph though.
As kosist's answer says, the first thing to check is that you can communicate with the Arduino at all. Before you even start with LabVIEW, have you tried using the Arduino IDE to program your device with a simple program like the 'blink' example?
If that works, then the next step is to make sure you've programmed your Arduino with the firmware it needs to communicate with the LabVIEW VIs you're using (can you link to where you got them from?) and then try a much simpler test program in LabVIEW - again, just get the Arduino to do something simple like turn the buzzer on and off. If you hit a problem with any of those, I suggest asking a new question with details of exactly what you tried and what errors you saw.

Using TcpClient with VPN connection

I'm writing a proprietary Telnet class and use TcpClient. Everything works well in the console and data transmission generates no issue with devices (sockets) in the same IP group. I tested also a new WPF project using this class again and the functionality is given as well.
Today I tried the identical WPF project again using a VPN connection, but TcpClient generates an exception. At the beginning it looks like the first console version was still working as expected, but during several tests, I noticed that even the console version generates sporadically an exception.
I checked the VPN connection and the availability of the IP/port. Everything should be fine. I used Wireshark (I’m not familiar with) and it looks like in the case, the connection fails, there is no request to the IP in the VPN network.
After a restart of the computer, connecting seems to work several times, but after a view tests, it ends with an exception again.
For sure, I have to handle the exception but first of all, I try to solve this connection issue.
Did anybody have experience using TcpClient and VPN? I read, that it’s sometimes recommended to use a bind, but till now, I don't have a solution.
This is a link to the console version I used as a starting point.

Serial communication in Qt creator

I came across the following error described below, how can I rectify this sort of error and why does this error is generated?
QIODEVICE::write:device not open
( the com port are also not visible in device manager)
Is this some sort of system error ?
If you have using just Qt then use QSerialPort otherwise you can use windows API createfile(), readfile() ,writefile() in Windows Platform.
You can take other information in:
http://support.microsoft.com/KB/115831
or this post in Stackoverflow:
Open a COM port in C++ with number higher that 9

Can't connect to XenServer with libvirt Java bindings

I'm helping to write a program that manages VMs remotely. When I try to connect to a XenServer machine to discover the hypervisor, I get a "Unable to connect: Cannot read CA certificate '/etc/pki/CA/cacert.pem': No such file or directory" error. I've tried creating the cacert.pem file that it's looking for, but that doesn't fix anything. I've read that this certain error isn't accurately showing what's wrong.
This only happens when I use the Java bindings - I can successfully connect to the machine with virsh. I turned on debug mode for libvirt and tried to connect with both the bindings and virsh. The only major difference that I saw is virsh calling several virEvent type methods that libvirt doesn't do. (As I think about it, this may just be libvirt using my custom ConnectAuth class that doesn't prompt for a password)
Using:
libvirt 0.9.12 --with-xenapi
libvirt-java 0.4.7
I can't seem to find anybody else who has had this problem. Any help would be appreciated!
We ended up having to modify the Connect object in libvirt-java. The object was still valid, but somehow an error was being thrown. It's a messy hack, but we just ignore the certain error that is thrown and pass up the Connect object and are able to connect.

Resources