Getting the software up and running


#1

Hello all,

We’ve been trying to get the FC V2 beta up and running in our spare hours for about a year now. Being a beta, we expected there to be some bumps along the way, but we weren’t really expecting the numerous metaphorical road closures. I’ll refrain from venting all my frustrations here, and hope you folks could help me out with our current road closure.

We are stuck following the “documentation” located here link removed due to new user limits. Specifically with the npm install command:

`pi@foodcomputer:~/openag_ui $ npm install
npm WARN package.json lodash@4.17.5 No README data
npm WARN package.json couchapp@0.11.0 No repository field.
npm WARN engine pbkdf2@3.0.14: wanted: {“node”:">=0.12"} (current: {“node”:“0.10.29”,“npm”:“1.4.21”})
npm WARN engine hash-base@3.0.4: wanted: {“node”:">=4"} (current: {“node”:“0.10.29”,“npm”:“1.4.21”})
npm WARN engine hash-base@3.0.4: wanted: {“node”:">=4"} (current: {“node”:“0.10.29”,“npm”:“1.4.21”})
npm WARN engine hash-base@3.0.4: wanted: {“node”:">=4"} (current: {“node”:“0.10.29”,“npm”:“1.4.21”})
npm WARN optional dep failed, continuing fsevents@1.1.3
npm WARN engine pbkdf2@3.0.14: wanted: {“node”:">=0.12"} (current: {“node”:“0.10.29”,“npm”:“1.4.21”})
npm WARN engine hash-base@3.0.4: wanted: {“node”:">=4"} (current: {“node”:“0.10.29”,“npm”:“1.4.21”})
npm WARN engine hash-base@3.0.4: wanted: {“node”:">=4"} (current: {“node”:“0.10.29”,“npm”:“1.4.21”})
npm WARN engine hash-base@3.0.4: wanted: {“node”:">=4"} (current: {“node”:“0.10.29”,“npm”:“1.4.21”})
npm ERR! Error: ENOENT, lstat '/home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/insert-module-globals/node_modules/combine-source-map/node_modules/source-map/dist/source-map.min.js’
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:

npm ERR! System Linux 4.9.35-v7+
npm ERR! command “/usr/bin/nodejs” “/usr/bin/npm” "install"
npm ERR! cwd /home/pi/openag_ui
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/insert-module-globals/node_modules/combine-source-map/node_modules/source-map/dist/source-map.min.js
npm ERR! fstream_path /home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/insert-module-globals/node_modules/combine-source-map/node_modules/source-map/dist/source-map.min.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.:107:15)
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/crypto-browserify/node_modules/create-hmac/node_modules’
npm ERR! error rolling back browserify@15.2.0 { [Error: ENOTEMPTY, rmdir ‘/home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/crypto-browserify/node_modules/create-hmac/node_modules’]
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: ‘ENOTEMPTY’,
npm ERR! error rolling back path: ‘/home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/crypto-browserify/node_modules/create-hmac/node_modules’ }
npm ERR! Error: ENOENT, open '/home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/crypto-browserify/node_modules/public-encrypt/node_modules/parse-asn1/node_modules/browserify-aes/node_modules/buffer-xor/README.md’
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 4.9.35-v7+
npm ERR! command “/usr/bin/nodejs” “/usr/bin/npm” "install"
npm ERR! cwd /home/pi/openag_ui
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/crypto-browserify/node_modules/public-encrypt/node_modules/parse-asn1/node_modules/browserify-aes/node_modules/buffer-xor/README.md
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! Error: ENOENT, lstat '/home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/crypto-browserify/node_modules/create-hmac/node_modules/safe-buffer/README.md’
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:

npm ERR! System Linux 4.9.35-v7+
npm ERR! command “/usr/bin/nodejs” “/usr/bin/npm” "install"
npm ERR! cwd /home/pi/openag_ui
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/crypto-browserify/node_modules/create-hmac/node_modules/safe-buffer/README.md
npm ERR! fstream_path /home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/crypto-browserify/node_modules/create-hmac/node_modules/safe-buffer/README.md
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.:107:15)
npm ERR! Error: ENOENT, lstat '/home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/crypto-browserify/node_modules/public-encrypt/node_modules/parse-asn1/node_modules/browserify-aes/node_modules/cipher-base/.eslintrc’
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:

npm ERR! System Linux 4.9.35-v7+
npm ERR! command “/usr/bin/nodejs” “/usr/bin/npm” "install"
npm ERR! cwd /home/pi/openag_ui
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/crypto-browserify/node_modules/public-encrypt/node_modules/parse-asn1/node_modules/browserify-aes/node_modules/cipher-base/.eslintrc
npm ERR! fstream_path /home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/crypto-browserify/node_modules/public-encrypt/node_modules/parse-asn1/node_modules/browserify-aes/node_modules/cipher-base/.eslintrc
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.:107:15)
npm ERR! Error: ENOENT, lstat '/home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/browserify-zlib/node_modules/pako/dist/pako_inflate.js’
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:

npm ERR! System Linux 4.9.35-v7+
npm ERR! command “/usr/bin/nodejs” “/usr/bin/npm” "install"
npm ERR! cwd /home/pi/openag_ui
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/browserify-zlib/node_modules/pako/dist/pako_inflate.js
npm ERR! fstream_path /home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/browserify-zlib/node_modules/pako/dist/pako_inflate.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.:107:15)
npm ERR! Error: ENOENT, lstat '/home/pi/openag_ui/node_modules/grunt-browserify/node_modules/browserify/node_modules/insert-module-globals/node_modules/combine-source-map/node_modules/source-map/lib/binary-search.js’
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:

npm ERR! System Linux 4.9.35-v7+
npm ERR! command “/usr/bin/nodejs” “/usr/bin/npm” "install"
npm ERR! cwd /home/pi/openag_ui
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /home/pi/openag_ui/node_modules/grunt-browserify/node_modules/browserify/node_modules/insert-module-globals/node_modules/combine-source-map/node_modules/source-map/lib/binary-search.js
npm ERR! fstream_path /home/pi/openag_ui/node_modules/grunt-browserify/node_modules/browserify/node_modules/insert-module-globals/node_modules/combine-source-map/node_modules/source-map/lib/binary-search.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.:107:15)
npm ERR! Error: ENOENT, lstat '/home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/insert-module-globals/node_modules/lexical-scope/node_modules/astw/node_modules/acorn/dist/acorn.js’
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:

npm ERR! System Linux 4.9.35-v7+
npm ERR! command “/usr/bin/nodejs” “/usr/bin/npm” "install"
npm ERR! cwd /home/pi/openag_ui
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/insert-module-globals/node_modules/lexical-scope/node_modules/astw/node_modules/acorn/dist/acorn.js
npm ERR! fstream_path /home/pi/openag_ui/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify/node_modules/insert-module-globals/node_modules/lexical-scope/node_modules/astw/node_modules/acorn/dist/acorn.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.:107:15)
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 ‘browserify/acorn5-object-spread’ is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'detective’
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Linux 4.9.35-v7+
npm ERR! command “/usr/bin/nodejs” “/usr/bin/npm” "install"
npm ERR! cwd /home/pi/openag_ui
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code E404
`

We’ve already followed the instructions for the brain, and believe the docker is up and running, although with no documentation it’s hard to actually verify that. Can anyone lend us an assist? Or if you by chance have any actual documentation or getting started guides you could point me towards?

-Than


I am creating a wiring schematic diagram for the PFC v2
Openag_lib.config module not found
Signal Board for PFC v.2
OpenAG in South Korea
Where are you building your Food Computer?
Food Server in Guadalajara, by MIT Enterprise Forum Mexico
OpenAg in Panama!
#2

[edit: All the stuff I said below still applies, but after I did some more googling from your error log and looking at the node install instructions given in openag_ui, I’m pretty sure you need to upgrade node and npm. You’ve apparently got npm 1.4.21, and there are npm github issues like this one and this one that say old versions of npm before v2.1.5 have some major problems that can result in similar ENOENT, lstat ... errors.

I’m no node.js expert, but it looks like the openag_ui readme gives instructions for installing an old version of node (granted, it’s possible there might be some undocumented reason why an old version is necessary–possibly involving CouchDB weirdness):



end edit]

Hi @ThanNewell,

For whatever it’s worth, you ought to know that the PFC v2.x software stack is effectively unsupported at this point. Most of the community activity here on the forum has shifted towards the MVP design. Caleb’s software team at MIT is small, and this winter they have been in dark mode, working on software for their food server container farm and–I think–also on some other stuff that hasn’t been announced yet.

I don’t know if Caleb’s team plans to update the PFC v2.x software, but I’ve seen no sign of that on github. On the other hand, the hardware guys on Caleb’s team have been active on github designing a new iteration of the pfc hardware (pfc-edu, nervous system, etc.) that is looking really good so far. Perhaps I’m wrong, but my guess is that the OpenAg software folks will be focusing their efforts on moving forward with the new hardware iteration rather than trying to support PFC v2.

As I understand it from looking at github commits and reading forum posts, development activity on the PFC v2.x software gradually stopped last year between September and November. Before that, there were many big changes in the late summer. Lots of code got consolidated into the https://github.com/OpenAgInitiative/openag_brain repository, and there were big changes to installation procedures. You may have been trying to use instructions that refer to how things worked before the consolidation.

My perhaps incorrect impression is that the install procedures never made it to the point where everything was version-pinned to specific packages and code releases. There may be scripts or manifests that just pull the most recent package or try to check code out from HEAD of a github repo. It’s possible that your problem relates to version dependency mismatches. You might also be trying to use instructions from before all the big changes last fall.

If you want to try sorting out the discrepancies on your own, here are the sources I’d recommend reading carefully and comparing against each other (look at revision dates):

  1. The openag_brain commit history, release history, and open issues. In particular, look for references to documentation and install procedures for anything that happened between June and November of 2017.

  2. The openag_brain Getting Started documentation page at https://github.com/OpenAgInitiative/openag_brain/blob/master/doc/getting_started.rst Note that this doesn’t mention anything about npm. The openag_ui repo mentions npm stuff, but the last commits to openag_ui were in July 2017 before many big changes in openag_brain.

  3. Main PFC wiki page: https://wiki.openag.media.mit.edu/personal_food_computers

  4. PFC v2.1 wiki page: https://wiki.openag.media.mit.edu/pfc_2.1

  5. PFC v2.0 wiki page: https://wiki.openag.media.mit.edu/food_computer_2

  6. MVP 1.0 wiki page: https://wiki.openag.media.mit.edu/mvp_1 (this might give you ideas if you want to try writing your own software for your PFC v2 hardware)

  7. Rob’s PFC v2.1 announcement here on the forum: OpenAg™ PFC v2.1 & openag_brain v1.0.0 Release

  8. If you’re feeling desperate or ambitious, you might also try reading everything from now back to February 2017 or so in the forum’s software category: http://forum.openag.media.mit.edu/c/software

With all that said, if you just want to see the lights come on, grow some food, and collect a bit of data, you might try firing up the Arduino IDE, getting sample code from Adafruit, Sparkfun, etc., and making something simple on your own. A good strategy for some instant gratification might be:

  1. Re-wire your lights to use a regular power plug with a programmable timer of the sort sold by Hydrofarm or the kind that are used for Christmas lights in the US (or whatever the local equivalent is if you live somewhere else).

  2. Plug the air pump into a power strip so it’s always on.

  3. Disconnect all the pH adjustment pumps and tubing and prepare your nutrient solution manually according to the instructions on the bottles. Consider buying a cheap handheld pH & EC meter to help you until you have Arduino code working for the Atlas Sensors.

  4. Use the Arduino IDE to program your Arduino to collect data from the sensors. You don’t need ROS for this–it’s massive overkill. You could make something as simple as a loop that delays for a minute, reads all the sensors, then prints the data to the serial port (you’d need something on a laptop or Raspberry Pi to receive the serial data). There are many blog posts and tutorials about Arduino garden watering and data logging projects that you might be able to take inspiration from or perhaps use their code.

    On the hardware side, there are details on Arduino to sensor pin wiring in this thread: Signal Board for PFC v.2. This thread has info on the recurring issue of making sure the Atlas sensor boards are in I2C mode: EZO pH and EC Sensors in UART Mode. And, this one explains how to make sure that your Arduino isn’t shorting out against the signal board: Arduino_handler: serial_connection.readline() broken

  5. Once you have the data logging working for your initial test crop, maybe think about improving your Arduino code to control your relays for the lights.

If you get something working–either on your own or with OpenAg’s openag_brain code–I’m sure there are other people here on the forum who would like to hear about it.


More Docs: I wrote a PFC2 step-by-step software install guide (edit: these instructions are out of date now)
Help needed with Loading the default fixture
#3

@iancollmceachern Does this sound at all like the problems you mentioned in your comment last week over at More Docs: I wrote a PFC2 step-by-step software install guide (edit: these instructions are out of date now) ?

Also, @adrianlu, I think you mentioned recently that you were going to be testing PFC v2 software soon. Any luck with that?


#4

Great helpful reply @wsnook! It is true that we did a big PFCv2.1 push last summer and got it to the stage where my personal PFC2 was able to do two test grows.

FWIW, here are the two recipes and procedures I used:
https://wiki.openag.media.mit.edu/contributors/recipes

Here are the test grows:
https://wiki.openag.media.mit.edu/contributors/test_grows

I (as the software team leader) have been working closely (and in dark mode as you suggest) with the hardware team on new systems that Caleb has hinted at. When we have the first version stable and tested, there will be a community announcement with all the details, docs and repos. Until that time, we are a very small team and need to focus to get this done.

-rob


OpenAg for Outreachy and Google Summer of Code (GSoC) projects
#5

We are working from Johnson County Community College in Overland Park, KS, also for over a year. We have version 1 hardware but have never been able to get it running with either version 1 or version 2 software. Any advice on the following options??? Thank you!

  1. go back to version 1 software
  2. debug why version 2 software is not working
  3. wait for an update to version 2 software
  4. upgrade to version 2 hardware – if so, is there a list of the upgrades somewhere?

Thank you!!!


#6

I’m sorry to hear that. You may not have many options at this point. Did you look at this thread from last week: PFC V1 Software ?


#7

Hi Rob

Thank you for this information. My friend @Bataleon7 and I are Students from HTW Chur in Switzerland. We wanted to build a PFCv2 for our Bachelor-Thesis, so we’ve organized all the products from the BOM and spent a lot of money and time for it. What we have to say is, that we’re not very advanced in a deeper technical area like you guys :wink: , so we’re a little bit scared after reading this Post.

Now our question is, if you can say when and if you’re bringing a stable software update for the PFCv2 or if you’re going to build a complete new one (because of the design and software issues)?

If you are building a new one, could we still use the products we’ve bought?

Or is there a way where we could build an MVP, out of the sensors we’ve already bought, which will work with the MVP code?

We’re looking thankfully forward to your answer.

Greetings from Switzerland
Simon and Luca


#8

@seybling I am also curious about the answer to your questions. But, based on what Rob has said so far, I don’t think his responsibilities at the Media Lab leave him much time for discussions here on the forum.

Here’s what we know: Over the past year, people who try to build the PFCv2 hardware have reported many problems. Some parts from the BOM, like the chiller and LEDs, are not available to purchase on the open market. The software worked last fall, but recently, at least two people have reported they are not able to get it installed and running. For the last four months, there haven’t been any changes made to the PFCv2 design or software. If I remember right, no one on the OpenAg team at MIT has made any mention recently of plans to resume work on the v2 design. It appears that they have moved on.

During the last four months, OpenAg’s small software and hardware team has been working on the new designs. The recent OpenAg newsletter spoke of “new forms of food computing” that they “hope to share very soon”, and Caleb hinted on instagram at upcoming announcements. When people talk about “soon”, that implies they don’t know precisely when it will happen because there are things left to be determined. That fits with what Jake and Dan have said in the github repo about the status of the new designs and Rob’s comments above about the software. The progress is very good, but they are still in alpha. It will take more time to be ready.

My guess is that some time in April is the earliest that beta versions of the hardware and software might be ready for a public announcement. But, and this is important, the designs are based on PCB modules which would need to be manufactured. In order for OpenAg to manufacture a run of boards and make them available for people in the community to purchase, they would have to spend a lot of money up front to purchase parts. The manufacturing process might take weeks or months. That’s all speculation though. I don’t know if OpenAg has the kind of money they would need to make a run of boards. Perhaps the reason they say “soon” is that they are trying to raise funds for making kits. Again, that’s just speculation.

From what I can see, it looks like OpenAg’s new designs will be a big step forward when they’re ready. But, if you’re in a hurry, you should probably start working on a backup plan now. When you look at what would need to happen in order for you to use the new hardware designs for your school project, it seems reasonable to expect that you might have to wait months to know if it will be possible.

If you want to post a list of the sensors you’ve purchased, I might be able to help you come up with ideas for alternate ways of using them. [edit: It might be best to start a new topic if you want to discuss sensors]


#9

Hi Will

Thank you very much for your answer. It’s great to hear that the new Design and Software are going to take a big step forward. But as we have to be finished with our project by July/August, we also thought about making a backup plan and than later we can still concentrate on the real PFC. So we will use the PFC design (which we have now) and build the brain of the MVP into it, so that we can upgrade it later.

Until that, we’ll try to sell some of the hardware we won’t use in Switzerland. We’ll keep you updated about our progress.

Thank you again for your time and your very helpful advises.
Cheers
Simon & Luca


#10

Hi @seybling and @LisaF
Great to hear you’re moving forward with the brain design. In case you didn’t see, I wanted to mention OpenAg is moving full steam on upgrading the PFC design, check it out here. If you purchased parts for the PFC v.1, V.2, or V.2.1, please let us know here. The team is considering a reuse/refurbish project for this sort of issue.


#11

Thank you. Is there an update on the reuse/refurbish project? We have about $2K+ invested in V1 hardware but cannot get it up and running with the current software. We also purchased a Food Computer Kit PCBA from Open Agriculture Supply as we understand it is needed to upgrade v1 hardware to work with current software. Thanks.