app4mc-rover / rover-telemetry-service-old

Apache License 2.0
0 stars 1 forks source link

AGL-Error when starting Service #1

Closed phil-hei closed 5 years ago

phil-hei commented 5 years ago

While the installation of the Rover-Telemetry-Service (https://github.com/app4mc-rover/rover-telemetry-service-old) on a fresh AGL-Kuksa-Rover Image (https://owncloud.idial.institute/s/qWKjDdAXbfxd6qo) works, starting the telemetry service leads to the following error related to htdocs:

`-- Logs begin at Mon 2018-06-04 16:51:20 UTC, end at Tue 2018-10-23 08:01:17 UTC. -- raspberrypi3 afb-daemon[6622]: ERROR: can't connect to directory htdocs: No such file or directory [/usr/src/debug/af-binder/dab+gitAUTOINC+6af240ddd3-r0/git/src/afb-hsrv.c

Oct 23 08:01:04 raspberrypi3 afb-daemon[6622]: ERROR: initialisation of httpd failed [/usr/src/debug/af-binder/dab+gitAUTOINC+6af240ddd3-r0/git/src/main.c:266,start_http_server] `

pjcuadra commented 5 years ago

Could you check if the required API (services) are installed? Please run afm-util list and check if the services listed within the <feature name="urn:AGL:widget:required-api"> tag/section in conf.d/wgt/config.xml.in.

phil-hei commented 5 years ago

Hi Pedro,

thanks for your help. The listed services are all installed. The complete log (I shortened it for the sake of clarity) shows this if I'm right:

-- Logs begin at Mon 2018-06-04 16:51:20 UTC, end at Tue 2018-10-23 08:01:17 UTC. -- Oct 23 08:01:04 raspberrypi3 afb-daemon[6622]: NOTICE: API monitor started [/usr/src/debug/af-binder/dab+gitAUTOINC+6af240ddd3-r0/git/src/afb-apiset.c:377,start_api] Oct 23 08:01:04 raspberrypi3 afb-daemon[6622]: NOTICE: API roverconfig started [/usr/src/debug/af-binder/dab+gitAUTOINC+6af240ddd3-r0/git/src/afb-apiset.c:377,start_api] Oct 23 08:01:04 raspberrypi3 afb-daemon[6622]: NOTICE: API roverdht22 started [/usr/src/debug/af-binder/dab+gitAUTOINC+6af240ddd3-r0/git/src/afb-apiset.c:377,start_api] Oct 23 08:01:04 raspberrypi3 afb-daemon[6622]: NOTICE: API roverdriving started [/usr/src/debug/af-binder/dab+gitAUTOINC+6af240ddd3-r0/git/src/afb-apiset.c:377,start_api] Oct 23 08:01:04 raspberrypi3 afb-daemon[6622]: NOTICE: API rovergrooveultrasonicsensor started [/usr/src/debug/af-binder/dab+gitAUTOINC+6af240ddd3-r0/git/src/afb-apiset.c:377,start_api] Oct 23 08:01:04 raspberrypi3 afb-daemon[6622]: NOTICE: API rovergy521 started [/usr/src/debug/af-binder/dab+gitAUTOINC+6af240ddd3-r0/git/src/afb-apiset.c:377,start_api] Oct 23 08:01:04 raspberrypi3 afb-daemon[6622]: NOTICE: API roverhmc5883l started [/usr/src/debug/af-binder/dab+gitAUTOINC+6af240ddd3-r0/git/src/afb-apiset.c:377,start_api] Oct 23 08:01:04 raspberrypi3 afb-daemon[6622]: NOTICE: API roverinfraredsensor started [/usr/src/debug/af-binder/dab+gitAUTOINC+6af240ddd3-r0/git/src/afb-apiset.c:377,start_api] Oct 23 08:01:04 raspberrypi3 afb-daemon[6622]: NOTICE: API roverutils started [/usr/src/debug/af-binder/dab+gitAUTOINC+6af240ddd3-r0/git/src/afb-apiset.c:377,start_api] Oct 23 08:01:04 raspberrypi3 afb-daemon[6622]: ERROR: can't connect to directory htdocs: No such file or directory [/usr/src/debug/af-binder/dab+gitAUTOINC+6af240ddd3-r0/git/src/afb-hsrv.c Oct 23 08:01:04 raspberrypi3 afb-daemon[6622]: ERROR: initialisation of httpd failed [/usr/src/debug/af-binder/dab+gitAUTOINC+6af240ddd3-r0/git/src/main.c:266,start_http_server]

pjcuadra commented 5 years ago

Hi Philipp, I'm trying to reproduce the issue from my side using a qemu image (being built).

pjcuadra commented 5 years ago

Hi Philipp,

I haven't been lucky building the qemu image. It will take longer. However, I was reviewing the service's code and I have another question. Does the rover you are using have front and rear groove sensor? Or you have the mixed version? I'm not sure if this is related and don't know your setup but the service is wired to use groove for both sensor. Let me know if this information is use full.

phil-hei commented 5 years ago

Hi Pedro,

thanks so much for your effort so far! The rover I'm using (it's the first one we had) has the groove sensors on it, which work so far. I also thought that it may be the reason, but didn't have the time yet to test it on another Rover. However, I also commented out all the lines in the main method and just wanted to write some messages to the log via "AFB_...". This also leads to the errors above.

pjcuadra commented 5 years ago

Thanks for the input. Then something else must be broken. I'll continue trying to reproduce it.

pjcuadra commented 5 years ago

Could you post the config.xml from your build directory? I want to check its content during build-time.

phil-hei commented 5 years ago

Ok, the one generated in Eclipse Che within the build/target/config.xml ?: `<?xml version="1.0" encoding="UTF-8"?>

rover-telemetry-old Rover Telementry Service FH Dortmund <example.man@example.com> EPL-1

`

pjcuadra commented 5 years ago

I see a possible source of the error. The version value is empty. Could you try what I just committed to the issue/1/debug branch.

phil-hei commented 5 years ago

Big thanks, that helped to get rid of the htdocs error (I remember that we had this issue before)! But I observed some things:

Importing the debug branch works in Che, but compiling gives me the following error then:

/projects/rover-telemetry-service-old/rover-telemetry-old/src/main.cpp:269:32: error: ‘get_sensor_data’ was not declared in this scope get_sensor_data(sensor_data); ^ make[3]: *** [rover-telemetry-old/CMakeFiles/rover-telemetry-old.dir/src/main.cpp.o] Error 1 make[2]: *** [rover-telemetry-old/CMakeFiles/rover-telemetry-old.dir/all] Error 2 rover-telemetry-old/CMakeFiles/rover-telemetry-old.dir/build.make:62: recipe for target 'rover-telemetry-old/CMakeFiles/rover-telemetry-old.dir/src/main.cpp.o' failed

So, I used the master branch and added the version line to config.cmake. For some reasons this compiles with Che without any errors. Starting the service then on the Rover don't give the htdocs error anymore. Nevertheless, it throws a new error:

Jun 04 17:57:49 raspberrypi3 afb-daemon[31726]: terminate called after throwing an instance of 'std::invalid_argument' Jun 04 17:57:49 raspberrypi3 afb-daemon[31726]: what(): stoi Jun 04 17:57:49 raspberrypi3 afb-daemon[31726]: INFO: Verb 'get' sending { "key": "MQTT_BROKER_C" } Jun 04 17:57:49 raspberrypi3 afb-daemon[31726]: ERROR: Posting error or timeout while waiting for reply Jun 04 17:57:49 raspberrypi3 afb-daemon[31726]: INFO: Verb 'get' sending { "key": "MQTT_USERNAME_C" } Jun 04 17:57:49 raspberrypi3 afb-daemon[31726]: ERROR: Posting error or timeout while waiting for reply Jun 04 17:57:49 raspberrypi3 afb-daemon[31726]: INFO: Verb 'get' sending { "key": "MQTT_PASSWORD_C" } Jun 04 17:57:49 raspberrypi3 afb-daemon[31726]: ERROR: Posting error or timeout while waiting for reply Jun 04 17:57:49 raspberrypi3 afb-daemon[31726]: INFO: Verb 'get' sending { "key": "MQTT_BROKER_PORT_C" } Jun 04 17:57:49 raspberrypi3 afb-daemon[31726]: ERROR: Posting error or timeout while waiting for reply

But this seems related to the code in the service, so I'll start debugging that.

phil-hei commented 5 years ago

Ok, I just realized that you based the branch on an older commit of the master branch, which causes the error. Is there any reason for?

The 'std::invalid_argument' error seems to be related with the roverconfig service, whcih throws this exeption for some reasons. A quick workaround is to comment out all 'config.get' lines and directly provide the configuration parameter to the constructor of RoverMQTTCommand