NEW! - Recipes not starting/stopping


#1

Hi @gordonb @spaghet @rbaynes @bob.davis

I’m seeing an errant problem in my PFC1 running openag_brain. A bit ago (like a week) the UI stopped showing the current recipe and now I can’t start or stop recipes.

I suspect it has to do with me pulling in the most recent master revisions with the new recipe changes. Here are a couple of other clues:

When I hit http://tangerine.local:5984/_openag/api/0.0.1/service/environments/environment_1/stop_recipe I get "error": "No such service exists"

If I enter rosservice call /environment_1/start_recipe pfc1-potted-tomatoes-72days i get ERROR: Service [/environment_1/start_recipe] is not available.

So, I’m feeling like I am getting cut by the cutting edge of development progress. :smiley:

Can you share some documentation on the new recipe system? I may be able to post ui fixes based on it.

Thanks!

J


V2 Food Computer Kit Build
#2

Another clue:

When I hit: http://tangerine.local:5984/_openag/api/0.0.1/service

I get:

{
    "results": [
        "/environments/environment_1/air_flush_on_controller_1/get_loggers",
        "/sensor_info_publisher/get_loggers",
        "/api/get_loggers",
        "/environments/environment_1/image_persistence_1/set_logger_level",
        "/environments/environment_1/air_temperature_controller_1/set_logger_level",
        "/environments/environment_1/aerial_saver/save",
        "/environments/environment_1/aerial_image/set_camera_info",
        "/environments/environment_1/air_humidity_controller_1/get_loggers",
        "/environments/environment_1/aerial_saver/set_logger_level",
        "/environments/environment_1/video_writer_1/get_loggers",
        "/environments/environment_1/air_flush_on_controller_1/set_logger_level",
        "/expand_diagnostics/set_logger_level",
        "/expand_diagnostics/get_loggers",
        "/environments/environment_1/air_temperature_controller_1/get_loggers",
        "/environments/environment_1/aerial_image/set_logger_level",
        "/environments/environment_1/light_controller/set_logger_level",
        "/arduino_handler/set_logger_level",
        "/rosout/set_logger_level",
        "/environments/environment_1/topic_filter_1/set_logger_level",
        "/environments/environment_1/aerial_saver/start",
        "/sensor_info_publisher/set_logger_level",
        "/environments/environment_1/sensor_persistence_1/set_logger_level",
        "/environments/environment_1/light_controller/get_loggers",
        "/environments/environment_1/aerial_image/get_loggers",
        "/serial_node/set_logger_level",
        "/topic_connector/set_logger_level",
        "/arduino_handler/get_loggers",
        "/topic_connector/get_loggers",
        "/environments/environment_1/video_writer_1/set_logger_level",
        "/environments/environment_1/sensor_persistence_1/get_loggers",
        "/environments/environment_1/topic_filter_1/get_loggers",
        "/environments/environment_1/air_humidity_controller_1/set_logger_level",
        "/rosout/get_loggers",
        "/api/set_logger_level",
        "/environments/environment_1/image_persistence_1/get_loggers",
        "/serial_node/get_loggers",
        "/environments/environment_1/aerial_saver/end",
        "/environments/environment_1/aerial_saver/get_loggers"
    ]
}

No recipe anythings?

Do I need to specify a recipe handler in yaml?


#3

I did a complete rebuild overnight of the build starting on May 24 (earlier release) and am still not able to get it to run.

Traceback (most recent call last):
  File "/opt/ros/indigo/lib/openag_brain/recipe_handler.py", line 53, in <module>
    for variable in VALID_VARIABLES
  File "/opt/ros/indigo/lib/openag_brain/recipe_handler.py", line 53, in <dictcomp>
    for variable in VALID_VARIABLES
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/topics.py", line 812, in __init__
    super(Publisher, self).__init__(name, data_class, Registration.PUB)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/topics.py", line 136, in __init__
    raise ValueError("topic parameter 'data_class' is not initialized")
ValueError: topic parameter 'data_class' is not initialized
[ INFO] [1496404025.965949055]: Saved image /var/www/html/img.jpg
[environments/environment_1/recipe_handler_1-5] process has died [pid 5993, exit code 1, cmd /opt/ros/indigo/lib/openag_brain/recipe_handler.py __name:=recipe_handler_1 __log:=/home/pi/.ros/log/2e920210-4789-11e7-92f5-b827eb13f57f/environments-environment_1-recipe_handler_1-5.log].
log file: /home/pi/.ros/log/2e920210-4789-11e7-92f5-b827eb13f57f/environments-environment_1-recipe_handler_1-5*.log
 [ INFO] [1496404026.938380311]: Saved image /var/www/html/img.jpg
Traceback (most recent call last):
  File "/opt/ros/indigo/lib/openag_brain/video_writer.py", line 281, in <module>
    server, environment, camera_var, timelapse_scaling_factor
  File "/opt/ros/indigo/lib/openag_brain/video_writer.py", line 126, in __init__
    self.append_video(row.value)
  File "/opt/ros/indigo/lib/openag_brain/video_writer.py", line 235, in append_video
    self.image_filepath, self.snippet_filepath, snippet_duration
  File "/opt/ros/indigo/lib/python2.7/dist-packages/openag_brain/video_helpers.py", line 47, in create_video_from_image
    str(duration), "-pix_fmt", "yuv420p", video_path
  File "/usr/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
[ INFO] [1496404027.943474464]: Saved image /var/www/html/img.jpg

You can see the recipe writer is dying.


#4

Sorry @juhnke that would be my fault. We are rewriting the recipe handler
now. I am currently adding ros tests for it. I will try to reproduce the
problem you are seeing.

Thanks for the heads up (and testing)!
-rob

Thanks,
Rob Baynes


#5

It’s cool @rbaynes. I rolled back the repo and it’s up and running again.

git checkout 9bd7bd6b870a833c4c0cc52d3b0eff7a551716d6

Please let me know when the recipe handler is stable again and I’ll test it for you.

J


#6

Will do. Sorry for the hassle.

Thanks,
Rob Baynes


#7

Hi @juhnke,

In your rosservice call, you need to start the path with /environments

Below you can see I stop and start a recipe (using the code on the master
branch):

curl -X POST -H “Content-Type:application/json” http:/
192.168.1.50:5984/_openag/api/0.0.1/service*/environments*
/environment_1/stop_recipe
{
“message”: “There is no recipe running”,
“success”: false
}

rosservice call /environments/environment_1/stop_recie
success: False
message: There is no recipe running

rosservice call /environments/environment_1/start_recipe blue_on_15_sec
success: True
message: Success

Thanks,
Rob Baynes


#8

One other thing I forgot to mention: we are changing the format of recipes. Currently on the master branch, only the “simple” format is supported. The “phased” format (e.g. what is used in general_greens.json) has been removed. We are creating a new, better, more flexible format to replace phased.


V2 Food Computer Kit Build
#9

Cool! That’s great to know.

Hey do you have a slack channel or something that we can talk less publicly? I’m thinking it’s time to start a develop/dev branch on openag_brain and do releases to master when testing is complete. Maybe it doesn’t make sense if there are only a few units running it, but if more adopt, we’ll (the consuming public) get pinched by breaking changes.

Food for thought.

Cheers,

J


#10

Hi Joe @juhnke,

I posted the ways we can communicate here: New Resources! Contributing to OpenAg

If you go to the wiki page linked in that post about communications, it has a link to our public gitter channel you can join.

I like your plan of a release branch. That is on my plate to do also. I was just sticking with master for dev/releases now because what is on master still has some issues that prevent the PFC 2.0 from working. Also in that forum post you will find our software roadmap for this summer, and the critical issues we are working on.

Thanks!
-rob