-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
parsing works sometimes and crashes others #752
Comments
It wouldn't affect the crash issue, but you don't need the |
Do you have the |
Hi thanks for reply, I added that as I thought it would help :) I will remove it, I will try get that for you now, but the strings being sent are exactly the same, I have an interface that sends the above string on click of a button and that is all it is receiving at the moment, I have a feeling that is to do with the pointer not being completely populated by the time it gets to json::parse ?, I have posted in Paho also. Not sure whether it is on this side or Paho. |
OK so this is happening, which explains the e error. This is 100% not sent with the message:
One thing I notice is that I have FFMPEG running on the same console. The output from that sometimes get split up in between the print outs of the response, and I doubt that would be it but I checked and there is nothing with et.c in it, but checked anyway to see if it was conflicting, so somewhere it appears that text is getting added to the response. In addition the interface with the button also receives its own publishes and this is totally fine every time, looks like something in my code or an issue with Paho, cannot see anything doing it from the code above though. |
:O It is coming from the output of FFMPEG I disabled it and it works everytime, no idea how that is possible. |
Anyway this appears to be issue between Paho and FFMPEG, thanks for the time to help. I have removed the output of FFMPEG but it is still crashing, there is some sort of conflict between paho and FFMPEG, FFMPEG is activated in a pipe in this program. If I disable this, the error does not happen:
UPDATE: No it has just happened with it disabled, this is getting annoying lol |
New output:
|
{"Sensor":"CCTV","SensorID":130,"Command":"Capture","CommandValue":"Face"}etOut.êêêêc�å(��{"Sensor":"CCTV","SensorID":130,"Command":"Capture","CommandValue":"Face"}etOut.êêêêc�å(�� |
Solved with:
|
Hi guys I am using this with paho c, both installed using VCPKG and used in a C++ console app. I attempting to convert message->payload to json so I can access the elements of the response. This works sometimes but in others I get errors such as:
"parse error - unexpected 's'; expected end of input"
Exactly the same response is work and not working randomly. This is the code which is the on message arrived callback from paho:
Example response:
{"Sensor":"CCTV","SensorID":130,"Command":"Capture","CommandValue":"Face"}
The text was updated successfully, but these errors were encountered: