Help needed with Loading the default fixture


#1

Hello,

I successfully installed the install.sh script, now I’m trying to load the Load the default fixture with rosrun to begin using the default software modules and Arduino firmware and I’m getting the below error:

pi@raspberrypi:~ rosrun Usage: rosrun [--prefix cmd] [--debug] PACKAGE EXECUTABLE [ARGS] rosrun will locate PACKAGE and try to find an executable named EXECUTABLE in the PACKAGE tree. If it finds it, it will run it with ARGS. pi@raspberrypi:~ rosrun openag_brain load_fixture default
Applying fixture /home/pi/catkin_ws/src/openag_brain/fixtures/default.json
Error: No local server selected. Run openag db init to select one
Traceback (most recent call last):
File “/home/pi/catkin_ws/src/openag_brain/scripts/load_fixture”, line 31, in
“Failed to load fixture {}”.format(fixture_path)
RuntimeError: Failed to load fixture /home/pi/catkin_ws/src/openag_brain/fixtures/default.json

Any help would be greatly appreciated!


#2

Ok, I just ran the following and it worked!

pi@raspberrypi:~ openag db init Applying CouchDB configuration [####################################] 100% Creating databases [####################################] 100% Pushing design documents pi@raspberrypi:~ rosrun openag_brain load_fixture default
Applying fixture /home/pi/catkin_ws/src/openag_brain/fixtures/default.json
environment [####################################] 100%
software_module_type [####################################] 100%
firmware_module_type [####################################] 100%
software_module [####################################] 100%
pi@raspberrypi:~ $

Let’s see if I can continue :grinning:


#3

Hi I am having an issue at the same stage of the program, although it gives a different error.

First of all I’m using this guide: https://gist.github.com/wsnook/24ea657cf600a3802b262a2798f8894b

And am on step 5 and have so far followed all of the instructions to the word.

I typed in this:

rosrun openag_brain load_fixture default

And the Error was this:

[rosrun] Couldn’t find executable named load_fixture below /home/pi/catkin_ws/src/openag_brain

Do you have any idea what could be going on here?


#4

@Alex4EVR, I wrote that guide, and it’s very out of date now. I had a message at the top of the guide explaining that it probably wouldn’t work, but the warning was easy to miss. I just edited the guide to make it more obvious that it’s out of date.

@gordonb has changed a lot of stuff about ROS lately to make the installation process simpler, but I’m not sure if there’s a current guide for that yet. He’s still making changes.


More Docs: I wrote a PFC2 step-by-step software install guide (edit: these instructions are out of date now)
Brain_box build for Research
#5

It’s true! A lot of stuff is being simplified, and that means a few small changes in the way things run. I’ll be working on updated instructions here http://wiki.openag.media.mit.edu/contributors/gordonb/openag_brain/running_openag_brain. As they get fleshed out in the next few days, I’ll move this page and archive the old fixtures page.

One other note: if you’re running openag_brain in Docker, nothing has change. Docker runs the new config automatically.

Thanks and pardon the dust, etc, etc!


More Docs: I wrote a PFC2 step-by-step software install guide (edit: these instructions are out of date now)
#6

Thanks @gordonb! THere’s not much on the page you linked to and the link on it to the docker instructions is the same as the README. It’s a start, right?

I’d add the following steps to the docker instructions after

docker-compose up -d

Run this command:

docker exec -it openagbraindockerrpi_brain_1 bash

then this command:

source catkin_ws/devel/setup.bash

p.s. you need to do this everytime you restart the docker container, should probably be written into a .bashrc file or something

Then unplug the usb cable between the pi and arduino and plug in another port then immediately run:

rosrun openag_brain flash

That should work successfully and then when you restart the container and tail the logs the “groovy” error will be gone. And you can start playing with ROS topics. What is the “groovy” error? It shows up here and there on the forum.

[ERROR] [WallTime: 1492142142.507275] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

You can now run:

rostopic list

I would think you could see sensor data by using

rostopic echo

but I haven’t gotten any to work. I think I don’t have my fixtures or the correct sensors installed which leads to the beginning of this post. How does one configure fixtures? I have a PFC1 running the V2 software. I am running the RPI docker images

thanks,

J


#7

and then of course it dawned on him (me) that it’s a Wiki!!! hahah. I’ll add it!


#8

Have you had success with getting rosrun openag_brain flash to work?

I’ve been using openag firmware flash -t upload -p ros -f fixture.yaml after installing .[flash] in openag_python

The USB/Serial problem is usually when there is an instance of openag_brain running on the system, so there are conflicts in different processes trying to take up the port.


#9

I did! I recorded my steps here: http://wiki.openag.media.mit.edu/openag_brain/installing/installing_with_docker

Do I need to configure/edit the fixture.yaml file? Where is that?


#10

Hey I was able to follow your steps and seem to be in a working state with the software one issue I encountered was after running this:

pi@raspberrypi:~/openag_brain_docker_rpi $ docker-compose up -d

The error message I saw was this:

ERROR: for brain  Cannot start service brain: linux runtime spec devices: error gathering device information while adding custom device "/dev/ttyACM0": lstat /dev/ttyACM0: no such file or directory

ERROR: Encountered errors while bringing up the project.

To Fix this I edited the line in the file docker-compose.yml

That had /dev/ttyACM0 and changed it to /dev/ttyUSB0 which is what was showing up when I plugged in the arduino.

After re-running pi@raspberrypi:~/openag_brain_docker_rpi $ docker-compose up -d There were no errors.

My Current Concern is connecting to the UI. I’ve tried connecting both when inside docker (After typing this docker exec -it openagbraindockerrpi_brain_1 bash) as well as when not in docker.

When I type in the name and Ip address it says its connected, but nothing happens. When I inspect elements and go to console in google chrome I see this output:

main.js:29337 Uncaught (in promise) TypeError: Cannot read property 'value' of undefined
at Object.readValue (main.js:29337)
at setOptions (main.js:29751)
at update (main.js:29727)
at main.js:28328
at update (main.js:33825)
at batch (main.js:29412)
at restoredEnvironmentsOk (main.js:33996)
at update (main.js:33828)
at main.js:28328
at Object.update (main.js:27526)

#11

which UI are you using? The http://openaginitiative.github.io/openag_ui/ is old and deprecated.

You have to build the UI on the RPi.

https://gist.github.com/Spaghet/6e22529721398d06593748bd74d50c2c


#12

Thanks! That worked perfectly.

Now I just have to get the sensors working which I believe @juhnke is having an issue with.

When I got to http://raspberrypi.local:5984/_utils/

This is what I see:

When comparing to another post from @wsnook depreciated software guide I saw he has this:

Basically mine is missing the firmware_modle_type and some other stuff. I definitely have the am2315 plugged in the arduino at the very least so that should be appearing if everything else is running correctly.

@juhnke I just want to see if this is a similar issue you are having. I will definately look into it and see if I can figure something out if you haven’t already. Thanks for contributing to the Wiki btw.


#13

Hi @Alex4EVR! Thanks for the Kudos! I’m glad to help and will be doing more once we get the firmware thing resolved.

Here’s my _utils view.

I bumped my firmware version once so that’s a little different. As you suspected, we both have no documents in firmware_module_type, software_module, and software_module_type. How do we get those in there?

I need to inventory my sensors too. Which sensor is the am2315?

Cheers!


#14

@spaghet That UI install is a great GIST! Can you add it to the wiki? I can link to the Gist if that is better. Thanks for sharing it!!!

Here’s what mine says.

Does the Dashboard supposed to have my camera view (my cam is not working)?


The ‘ WILDCARD ‘ Gro-Bot Organeec 1
#15

Oh SNAP! I started a recipe from here and my air temp works! It’s in celcius, but it’s working!


#16

@juhnke Thats actually really cool that you have that recipe. I put it in and got the same output as you. The 24 is hardcoded so it makes sense, and the other sensors still aren’t showing up.

The AM2315 is THIS sensor.

So it seems that we are in the same place. I’m also having issues with the camera and getting things to be connected and recognized. I will look a bit more into this and if I figure anything out, will let you know.


#17

@Alex4EVR yep! After waving a hairdryer at my air temp sensor for too long I came to the same conclusion. I found another post where @JohnB had success getting PFC1 sensors (some of them) up in November. I’ve been reviewing the fixture pages on the wiki trying to piece together a step-by-step plan to get one sensor and one actuator up.

The camera is a lost cause with docker for now. Docker by design isn’t exposed to the entire host OS/hardware including the camera port. There’s a post that someone is working on it, but I think the only way to get the camera to work is to run native on the Pi instead of a docker container. For fun you can install FSWebCam on the Pi and take pictures. Mine works great.

I look forward to hearing what you find!


#18

@Alex4EVR I made a little bit more progress this evening.

Log into the openag_brain docker image and run this command:

openag db load_fixture ~/catkin_ws/src/openag_brain/fixtures/default.json

Now look at my db!

The default fixtures file comes with the following sensors from the PFC1 rig.

  • dht22 - air temp / humidity
  • gc0011 - co2
  • ds18b20 - water temp

Then I added a firmware_module by copying the following into the firmware_module collection.

     {
        "id": "dht221",
        "type": "dht22",
        "environment": "environment_1",
        "arguments": [
            0
        ],
        "outputs": {
            "air_temperature": {
                "variable": "air_temperature"
            }
        },
        "air_humidity": {
            "variable": "air_humidity"
        }
    }

My DHT22 sensor is on analog pins 0 and 1 <-- goes into arguments

I then reran the flash command.

rosrun openag_brain flash

After the obligatory remove and replug of the USB cord. It appears to have cloned the DHT22 repo during that flash.

I am not, however seeing data appear. I’m missing one step. Maybe more, but I’m close!

I’ll try again this weekend. Man, I CAN TASTE IT!

Night!


#19

I took a look at the log files and I’m getting this error message. The sensor is plugged into Analog 0 on the Grove board. I think I’m going to try a digital port.

[ERROR] [WallTime: 1492226166.956629] bad callback: <bound method DiagnosticsExpander.callback of <__main__.DiagnosticsExpander instance at 0x7633a6e8>>
Traceback (most recent call last):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/topics.py", line 720, in _invoke_callback
    cb(msg)
  File "/home/pi/catkin_ws/src/openag_brain/src/openag_brain/software_modules/expand_diagnostics.py", line 50, in callback
    status.message = self.status_codes_by_module[_status.name].get(
KeyError: '_5db9279fe44463a5c77d402fbc0037e3'

#20

@Alex4EVR I couldn’t sleep with this not working. So…

I GOT IT TO WORK!!!

My problem was my DHT22 was connected to an analog port 0 and the firmware module couldn’t take “A0” as a pin. So I moved it to D2 and changed the DB to this:

{
   "_id": "dht22_1",
   "type": "dht22",
   "environment": "environment_1",
   "arguments": [
       2
   ],
   "outputs": {
       "air_temperature": {
           "variable": "air_temperature"
       }
   },
   "air_humidity": {
       "variable": "air_humidity"
   }
}

and a flash and docker-compose restart later I get this!!!

pi@fe84a8283527:~$ rostopic echo /sensors/_5db9279fe44463a5c77d402fbc0037e3/air_humidity/raw
data: 53.5
---
data: 53.5
---
data: 53.4000015259
---
data: 53.4000015259
---
data: 53.4000015259
---
data: 53.4000015259
---
data: 53.4000015259
---
data: 53.4000015259
---
data: 53.4000015259
---
data: 53.5
---
pi@fe84a8283527:~$ rostopic echo /sensors/_5db9279fe44463a5c77d402fbc0037e3/air_temperature/raw
data: 23.6000003815
---
data: 23.6000003815
---
data: 23.6000003815
---
data: 23.6000003815
---
data: 23.6000003815

The data is not showing up in the UI yet, but I’ll figure that out later. I suspect it has to do with the _id value being a unique hash and not the required string.