Results 1 to 2 of 2

Thread: No answer from http get

  1. #1
    Join Date
    Aug 2017
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default No answer from http get

    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,"2 0":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":403986 18624,"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,"5 2":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):

    Qt Code:
    1. void ChromeNetworkManagerHero4::request (){
    2. qDebug("Ask for the status");
    3. string stringaUrl="http://10.5.5.9/gp/gpControl/status";
    4. QUrl url = QUrl::fromEncoded(stringaUrl.c_str()) ;
    5. reply2= manager->head(QNetworkRequest(url));
    6. connect(reply2, SIGNAL(finished()), this, SLOT(slotReadyRead()));
    7. }
    8.  
    9. void ChromeNetworkManagerHero4::slotReadyRead(){
    10. qDebug("Answer received");
    11. QByteArray dati=reply2->readAll();
    12. qDebug("dimension=%d",dati.size());
    13. }
    To copy to clipboard, switch view to plain text mode 

    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?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,708
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: No answer from http get

    This is not a Qt issue.
    You probably will get more help if you post on GoPro related forums.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Answer Android Calls
    By dspelt in forum General Programming
    Replies: 0
    Last Post: 24th February 2017, 19:02
  2. Is the answer to always build your own?
    By CandL in forum Qt Programming
    Replies: 3
    Last Post: 4th October 2014, 00:35
  3. Replies: 0
    Last Post: 4th April 2011, 12:18
  4. Replies: 2
    Last Post: 21st June 2010, 07:02
  5. will someone plz answer my queries on touch functionality/tslib
    By rishiraj in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 10th January 2009, 15:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.