Troubleshooting MVP Build


#1

(Referencing the recently demonstrated $300 build): $300 Food Computer

In response to the questions:

(1) I am mirroring the project exactly except for a wooden frame.
(2) Some familiarity with python, first time working with Pi/arduino/sensor type tech stuff. Have soldered larger wires before.
(3) The si7021 is failing when I run the test script as well as the validation UI script.

Test script reads:

Failure to get temperature, no sensor found; check pins and sensor
2017-08-30 03:40:54, si7921-top, Failure, temperature, ,Sensor not found

{
“attribute”: “temperature”,
“comment”: “Sensor not found”,
“name”: “si7921-top”,
“status”: “Failure”,
“timestamp”: “2017-08-30 03:40:54”,
“value”: “”
}

Test si7021 reads:

Test SI7021 Sensor
Traceback (most recent call last):
File “/home/pi/python/testSI7021.py”, line 4, in
print (“Temperature in Celsius is : %.2f C” %getTempC())
File “/home/pi/python/si7021.py”, line 16, in getTempC
bus = smbus.SMBus(1)
FileNotFoundError: [Errno 2] No such file or directory

Below are pics of my poor soldering skills (could this be the issue?), and the wiring back to the Pi. Will take better pictures tomorrow if it helps, my apologies. I also noticed now that you all built this in St. Louis, which happens to be where I’m from as well, small world!

!

!

!

!


$300 Food Computer
#2

HI Brian,
The picture of the board with the solder that looks like a “ball” is a warning sign. The solder “welds” should not look like that. Google “how to solder” and you will find good advice on how to create a solder weld and what it should look like. I’m also from St. Louis. If you want to meet sometime to look over your MVP build let me know (via direct message).
Joe


#3

@briandmcgraw Thanks for the detailed post!

I have to agree with @ferguman about the soldering, it does appear that perhaps your sensor isn’t making a full connection. Especially the SDA pin with that ball.

Great to hear your from St. Louis, if you’d like to come check out a finished MVP the one on the $300 post is located at TechShop in the Central West End (literally 5 minutes away from the location you posted). I’d be happy to help you out.

I’m curious how you heard about our project, have you been following OpenAg for awhile?


#4

@briandmcgraw
My bi-focals are not that great with the pictures, but it looks like the Red wire (SCA on the sensor) is going to pin 5, which is the SCL. and the sensor SCL (Brown wire) is going to pin 3 (SCA). If so, I think you have these reversed. The power (Blue) is correctly on pin 1, and the ground (Orange wire) looks like it is correctly on pin 9.

The error message indicates that the buffer cannot be read, which indicates a wiring issue (either the solder connection or wire pinning (or both)).


#5

Hi everyone – I believe it was the poor soldering (as well as that was not allowing the sensor to function. I redid it moments ago and the validation script is working.

Thank you all for the help, would love to meet up with the St. Louis folks sometime. I believe most of you all are in the CIC building (?), I work in Clayton but live off of grand/44 so pretty close to you all.

Don’t have much time tonight but will post some pictures, etc. once I get it cleaned up this weekend. Have a couple of basil plants ready to transplant in.

Best,
Brian


#6

Sweet!

I think we’re going to plan on an MVP build night at TechShop (next to CIC) Thursday the 7th. Send me a private message if you’re interested in coming! We have one finished on display and a number of other people working on builds.


#7

Thanks again for all the help everyone! MVP is mostly complete, I am going to add a few cosmetic touches in the coming weeks in order to keep it from being banished to the basement.

Now I have to actually become better at the growing side of things. A couple of small basil plants are in there now.


$300 Food Computer
Call for your photos and videos!
#8

Hi everyone, I seem to be facing the same problem as briandmcgraw

I have set up the system with the old Jessie mirror provided by @Webb.Peter thank you!

I have tried building the MVP here in Switzerland. I wonder if you can propose any further steps to resolve this issue with the Si7021.

Here the error:

—Test Data Logger—
Sensor Logging OK
2017-11-27 09:52:40, si7921_top, Failure, temperature, ,

{
“attribute”: “temperature”,
“comment”: “”,
“name”: “si7921_top”,
“status”: “Failure”,
“timestamp”: “2017-11-27 09:52:40”,
“value”: “”
}
{u’rev’: u’1-874f585703020eef755713f5aef6b2f6’, u’ok’: True, u’id’: u’6090c59abf5eb57a04acce73f7005a4b’}
2017-11-27 09:52:40, si7921_top, Failure, humidity, ,

TEST si7021

Test SI7021 Sensor
Traceback (most recent call last):
File “/home/pi/python/testSI7021.py”, line 4, in
print (“Temperature in Celsius is : %.2f C” %getTempC())
File “/home/pi/python/si7021.py”, line 18, in getTempC
bus = smbus.SMBus(1)
FileNotFoundError: [Errno 2] No such file or directory

I have exchanged the cables and I have redone the soldering but without success:

Would love to get your feedback. Best,

Daniel


#9

@DanB We just discovered this issue this other day. Can you please provide me with the following so I can better assist you:

  1. Are you running Raspian Jessie, or Stretch?
  2. Which software installation did you follow? Was the the walkthrough via readme, or etching an image? (I know it’s kinda confusing right now and for that, I apologize).
  3. When did you install the software?

@webbhm Any ideas? This is what we were running into yesterday right?


#10

@webb.peter Thank you for your reply, here my answers:

  1. Are you running Raspian Jessie, or Stretch? Jessie through the NOOB installation
  2. Which software installation did you follow? Was the the walkthrough via readme, or etching an image? (I know it’s kinda confusing right now and for that, I apologize). Walkthrough via readme and Youtube video
  3. When did you install the software? Last week via the github page Openag-MVP https://github.com/webbhm/OpenAg-MVP

I have just come to think that I have not installed the drivers for the Si7021. I do not fully understand where to place the subfolder with the driver, if this is required. https://github.com/webbhm/OpenAg_Si7021

Place the Adafruit_Si7021 library folder your arduinosketchfolder/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.

Here is how I have proceeded up until now (I have no programming skill =):

  1. I have tried installing the MVP Software with Stretch, I did not manage to build Couchdb (just installing it was a lot easier)
  2. I etched a picture of (https://github.com/webbhm/MVP_Disk_Image). This worked but I wanted to see if I could install it myself)
  3. Through different post in the forum I realized that I would have to work with Jessie (image you posted in the forum $300 Food Computer) in order for me to build the MVP Software like in the instructional video https://www.youtube.com/watch?v=TTdPuLTeddA&t=831s and without having to build Couchdb.

Sorry for the long post, I hope this provides some further detail. Thank you again your tremendous help,
Daniel


#11

The error is saying ‘file not found’ which sounds like the smbus is not installed. From a command line, try running the following:

pip install smbus


#12

Thank you @webbhm. I installed smbus2, then rebooted but unfortunately the same error as above persists.

Any other suggestions? I am very grateful for your help, thank you.


#13

Just read this closer, it is looking for the sensor file in my development directory, which doesn’t exist on your Raspberry. My best suggestion is to run my latest code with the install script. I assume you have no data, so rebuilding the database will not be an issue. If you have data from a prior (ver 1.0), then just skip the releaseScript_DB.sh.


$300 Food Computer
#14

Thank you @Webb.Peter and @webbhm

I have attempted to set up the MVP II on a Raspbian Stretch. After a couple attempts (permission setting did not seem to work well). I have now got a MVP dashboard (on the localhost:8000) with foreign data. Here some of the issues:

MVP 1.0 Validation script
If any RED, stop and fix it, then re-run this script

—Check for directories—
/home/pi/MVP OK
/home/pi/MVP/scripts OK
/home/pi/MVP OK

—Check CouchDB —
CouchDB not installed or running
Sensor database not created
Design doc not installed

—Test Sensors—
SI7021 OK

—Test Data Logger—
/home/pi/MVP/python/logSensors.py not working or not installed
2017-11-28 20:02:39, si7921_top, Success, temperature, 24.0,

{
“attribute”: “temperature”,
“comment”: “”,
“name”: “si7921_top”,
“status”: “Success”,
“timestamp”: “2017-11-28 20:02:39”,
“value”: " 24.0"
}
2017-11-28 20:02:39, si7921_top, Failure, temperature, ,HTTPConnectionPool(host=‘localhost’, port=5984): Max retries exceeded with url: /mvp_sensor_data (Caused by NewConnectionError(’<requests.packages.urllib3.connection.HTTPConnection object at 0x75f904d0>: Failed to establish a new connection: [Errno 111] Connection refused’,))

{
“attribute”: “temperature”,
“comment”: “HTTPConnectionPool(host=‘localhost’, port=5984): Max retries exceeded with url: /mvp_sensor_data (Caused by NewConnectionError(’<requests.packages.urllib3.connection.HTTPConnection object at 0x75f904d0>: Failed to establish a new connection: [Errno 111] Connection refused’,))”,
“name”: “si7921_top”,
“status”: “Failure”,
“timestamp”: “2017-11-28 20:02:39”,
“value”: “”
}
Traceback (most recent call last):
File “/home/pi/MVP/python/logSensors.py”, line 11, in
logData(“si7921_top”, “Failure”, “temperature”, ‘’, str(e))
File “/home/pi/MVP/python/logData.py”, line 10, in logData
logDB(timestamp, name, status, attribute, value, comment)
File “/home/pi/MVP/python/logData.py”, line 29, in logDB
r = requests.post(‘http://localhost:5984/mvp_sensor_data’, data = json_data, headers=headers)
File “/usr/lib/python2.7/dist-packages/requests/api.py”, line 110, in post
return request(‘post’, url, data=data, json=json, **kwargs)
File “/usr/lib/python2.7/dist-packages/requests/api.py”, line 56, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/lib/python2.7/dist-packages/requests/sessions.py”, line 488, in request
resp = self.send(prep, **send_kwargs)
File “/usr/lib/python2.7/dist-packages/requests/sessions.py”, line 609, in send
r = adapter.send(request, **kwargs)
File “/usr/lib/python2.7/dist-packages/requests/adapters.py”, line 487, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host=‘localhost’, port=5984): Max retries exceeded with url: /mvp_sensor_data (Caused by NewConnectionError(’<requests.packages.urllib3.connection.HTTPConnection object at 0x75f16630>: Failed to establish a new connection: [Errno 111] Connection refused’,))

—Test Actuators—
/home/pi/MVP/python/adjustThermostat.py not working or not installed
/home/pi/MVP/python/setLightOff.py not working or not installed
/home/pi/MVP/python/setLightOn.py not working or not installed
Webcam OK

—Building


#15

What I am seeing points to the database not being up and running. Do you get anything if you put the following into your browser?
localhost:5984
That is the address of the database, and should come back with a JSON message saying it is OK. If not, the database is not running, which will cascade to sensors (not logging).
You can try restarting the database with:
/home/pi/MVP/scripts/startCouchDB.sh
Also, check the log in:
/home/pi/MVP/logs

The last script of the build (relaseScript_Final.sh) should have set things up to auto restart on boot. Not sure why CouchDB is not running.


#16

I have tried localhost:5984 without success (localhost refused to connect). Restarting the database did not help either (startCouchDB.sh).

pi@raspberrypi:~ bash /home/pi/MVP/scripts/startCouchDB.sh pi@raspberrypi:~ bash /home/pi/MVP/setup/releaseScript_Final.sh

Start Final Configuration Changes

/home/pi/MVP/setup/releaseScript_Final.sh: line 38: /home/pi/scripts/test2.txt: No such file or directory
mv: cannot stat ‘/home/pi/scripts/test2.txt’: No such file or directory
bind address added to /home/couchdb/etc/local.ini
/home/pi/MVP/setup/releaseScript_Final.sh: line 51: /etc/rc.local2: Permission denied
mv: cannot stat ‘/etc/rc.local2’: No such file or directory
startup.sh added to /etc/rc.local
/home/pi/scripts/MVP_cron.txt: No such file or directory
11/29/17 09:18:18 Final Config Complete

Here the the logs:

couchdb.log.pdf (28.7 KB)
server.log.pdf (16.0 KB)

I hope this helps you.


#17

@webbhm

When @drewthomas89 and I tested the build last night we had this same error as well. We created the test2 file and granted permissions (there were several issues with permissions being denied). Then after we ran it we noticed the test2.txt disappeared. Not really sure what all is going on there, but it seemed to work once we added that file.

We did get to see the DB up, and index.html populated with our data. The web server seemed to be the final hiccup as well as some error within adjustThermostat.py that popped up when running releaseScript_test.sh.

@DanB Please hang in there, I’m really sorry you’re still not up and running. I hope you don’t mind learning with us! Also, you should contact @Marie-Claire and @pocock who are also in Switzerland, they have a meetup for an OpenAg chapter.

Edit: @drewthomas89 mentioned this too:

On the adjustThermostat.py and logSensors.py, we changed SI7921 to SI7021 a few times, but first ran into permissions issues. We fixed them with:

sudo chmod a+r /path
sudo chmod a+w /path
sudo chmod a+x /path.

In the releaseScript_Final.sh script, changed:
Couch2=/home/pi/scripts/test2.txt

to:
Couch2=/home/pi/MVP/scripts/test2.txt.


#18

@DanB

From @webbhm:

I think I have it working, though keeping it as separate scripts for now. There may be an issue of starting CouchDB, and the script moving too fast to the next step and not being able to build the databases. Hence, there is a new script to run after releaseScript_DB.sh. First open your browser to see if Couch is running (it should), but there will not be any databases. Then run couchInit.sh.
I tried doing just the download (instead of build) but Erlang hit an issue when trying to create a view document in mvp_sensor_data. I am not trying to figure that out (for now), but keeping it as a complete build. You should be able to re-run most of this, but to be safe, for now, remove what you are going to replace:
sudo rm -r /home/couchdb
sudo rm -r /home/pi/MVP

The scripts to run (in order) are:
buildScript.sh (the latest version calls /home/pi/MVP/releaseScript.sh and sets permissions)
/home/pi/MVP/releaseScript_DB.sh (calls couchBld.sh and couchInit.sh)
##Open your browser to check that Couch is running before proceeding, and contains the mvp_sensor_data database with one document##
/home/pi/MVP/releaseScript_Test.sh (calls Validate.sh)
/home/pi/MVP/releaseScript_Final.sh
when you re-boot, the database and web server should auto-start


#19

@Webb.Peter @webbhm Thank you. I very much appreciate it.

I am still getting errors (I believe this occurs while building the database). When I load localhost:5984 I get this:

{“couchdb”:“Welcome”,“version”:“2.1.0”,“features”:[“scheduler”],“vendor”:{“name”:“The Apache Software Foundation”}}

Here again the log:

couchdb.pdf (154.3 KB)


#20

@Webb.Peter
I believe you actually are good. If you get the welcome message, the database is running. To look at tables, you can try:
localhost:5984/_utils
The errors you are seeing are from the running of Couch, not the build (the build does not log, just sends to terminal). What you attached are due to Couch needing some standard administrative databases (_users, _replicator, _global_changes), but they have not been built yet (next step). After these are built, the errors will go away.
I think I have enough kinks out of the scripts that I am now running the install by just starting the first script and having them all chained together. I believe it is stable, now just trying to make it simpler.