PDA

View Full Version : No answer from http get



Archimede
17th August 2017, 10:55
Hi
I have a problem with my code to control the go pro camera. To do that I have a wifi command that normally I send with a get. Now (with the new hero5) the answer is more complicated, instead of 30 bytes like the previous one, there is a Json answer. The problem is that with the new command I have no answer at all (while use a terminal or a browser I obtain it).

with a terminal (the same with a browser):

COMMAND: curl -X GET http://10.5.5.9/gp/gpControl/status

ANSWER:
{"status":{
"1":1,"2":4,"3":0,"4":0,"6":0,"8":0,"9":1,"10":0,"11":0,"13":0,"14":0,"15":0,"16":0,"17":1,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"26":0,"27":0,"28":0,"29":"","30":"Bieffe74","31":0,"32":0,"33":0,"34":11265,"35":12420,"36":0,"37":0,"38":2,"39":96,"40":"%11%08%11%00%15%25","41":0,"42":0,"43":0,"44":0,"45":0,"46":1,"47":0,"48":0,"49":0,"54":40398618624,"55":1,"56":4,"57":214881,"58":0,"59":0,"60":500,"61":2,"62":0,"63":0,"64":5632},
"settings":{"1":0,"2":9,"3":8,"4":0,"5":0,"6":1,"7":0,"8":1,"9":0,"10":0,"11":0,"12":0,"13":1,"14":4,"15":4,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":2,"30":0,"31":0,"32":10,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"49":0,"50":0,"51":1,"52":0,"53":0,"54":0,"55":1,"56":0,"57":0,"58":0,"59":0,"60":8,"61":1,"62":700000,"63":4,"64":2,"68":0,"69":0,"70":1,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0}}

this is the code that I use (and I used with the old commands):



void ChromeNetworkManagerHero4::request (){
qDebug("Ask for the status");
string stringaUrl="http://10.5.5.9/gp/gpControl/status";
QUrl url = QUrl::fromEncoded(stringaUrl.c_str()) ;
reply2= manager->head(QNetworkRequest(url));
connect(reply2, SIGNAL(finished()), this, SLOT(slotReadyRead()));
}

void ChromeNetworkManagerHero4::slotReadyRead(){
qDebug("Answer received");
QByteArray dati=reply2->readAll();
qDebug("dimension=%d",dati.size());
}


if I use a "head" instead of a "get" at least I have finished signal (and a dimension=0), otherwise I never have an answer.
If with the same code I use the command:"http://10.5.5.9/camera/se" I have 31 bytes as answer..

do you have any Idea of what I'm doing wrong?

high_flyer
17th August 2017, 13:07
This is not a Qt issue.
You probably will get more help if you post on GoPro related forums.