Strange ofHttpResponse response codes on Raspberry Pi 2


#1

Hi - I’m having some trouble transferring a project over from Raspberry Pi (where it worked well) to a Raspberry Pi 2 (of_v0.8.4_linuxarmv7l_release).

I’m getting some very strange http response codes when I do a ofLoadURLAsync(), with values like: 34404164, 34453844 etc, rather than anything sensible like 200. The request is making it through to my server, so it should be 200.

Here’s the basic structure of what I have:

void ofApp::setup(){    
    ofRegisterURLNotification(this); 
}

void ofApp::sendAction(string action){
    ofLog() << "sendAction: " << action << endl;
    ofLoadURLAsync(remoteHttpServerScript+std::string("action=")+action,"async_req");
}

void ofApp::urlResponse(ofHttpResponse & response) {
    if (response.status==200 && response.request.name == "async_req") {
        lastOnline=ofGetElapsedTimeMillis();
    }
    else {
        ofRemoveAllURLRequests();
    }
}

I would be very grateful for any pointers. A memory allocation problem and I’m just reading junk?

Cheers,
Dave


#2

I think my problem is related to this: Raspberry Pi2 problems with HTTP requests - but I don’t follow how to do the Poco update.

Dave


#3

OK, I solved the problem by updating Poco with Apothecary. I didn’t know about Apothecary before now, very useful.

I was confused if I’d be able to drop the Apothecary script into my existing distribution, but that wasn’t a problem.

I downloaded it from here: https://github.com/danomatika/apothecary and then ran ./apothecary update poco from $OF_ROOT/scripts/apothecary

I did a make clean, then a make on my project and it worked great.

Dave


#4

I don’t have time to dig into it now, but I think there is a bad interaction between ofxOSC and the new Poco build - make seemed to end up in a recursive state and kernel panic

D


#5

Hi - that’s not the problem - it’s something broader - when I have time to investigate I will document it properly.

[Hope this monologue will be of some use to someone]

D