Fail at "buildScript" - MVP


#1

Now I’ve just completed to make the hardware of my MVP (Japanese BOM version based on MVP_V1).
And I move to get “Operation Software” according to “$300 FC MVP Software guide”.
At the No 19 “Run buildScript”, I have the Error with the following comment and can’t finish this.
Comment on terminal:
"#’, u’2’: u’# IMPORTANT - PLEASE UPDATE YOUR API ENDPOINT.

Before starting this, I got my ACCESS Key of API(Free). I’m not familiar with API. Please someone give me advice.


#2

What is the url of the git repository from which you sourced the build script?


#3

The URL is:

I copied extracting script of “build script” and pasted it for run as indicated in the guide.
At the first trial, i got this message and recognized i did not have “Key”. So I registered myself to API and did the second trial. And i have same error message.
The full error message is as follows.

Start Local file changes

(‘env: ‘, {‘mac’: ‘b8:27:eb:d3:ff:ba’, ‘location’: {u’a’: u’#################################################################################################################################’, u’1’: u’# #’, u’0’: u’#################################################################################################################################’, u’3’: u’# #’, u’2’: u’# IMPORTANT - PLEASE UPDATE YOUR API ENDPOINT #’, u’5’: u’# to use the new ipstack API endpoint, designed as a simple drop-in replacement. #’, u’4’: u’# This API endpoint is deprecated and has now been shut down. To keep using the freegeoip API, please update your integration #’, u’7’: u’# #’, u’6’: u’# You will be required to create an account at https://ipstack.com and obtain an API access key. #’, u’9’: u’# #’, u’8’: u’# For more information on how to upgrade please visit our Github Tutorial at: https://github.com/apilayer/freegeoip#readme #’}, ‘exp’: ‘experiment_1’, ‘reservoir’: {‘empty’: 220, ‘full’: 175, ‘timeout’: 1200, ‘change’: 3}})
(‘location: ‘, {u’a’: u’#################################################################################################################################’, u’1’: u’# #’, u’0’: u’#################################################################################################################################’, u’3’: u’# #’, u’2’: u’# IMPORTANT - PLEASE UPDATE YOUR API ENDPOINT #’, u’5’: u’# to use the new ipstack API endpoint, designed as a simple drop-in replacement. #’, u’4’: u’# This API endpoint is deprecated and has now been shut down. To keep using the freegeoip API, please update your integration #’, u’7’: u’# #’, u’6’: u’# You will be required to create an account at https://ipstack.com and obtain an API access key. #’, u’9’: u’# #’, u’8’: u’# For more information on how to upgrade please visit our Github Tutorial at: https://github.com/apilayer/freegeoip#readme #’})
Traceback (most recent call last):
File “/home/pi/MVP/python/buildEnv.py”, line 60, in
test()
File “/home/pi/MVP/python/buildEnv.py”, line 50, in test
print("city: ", env.env[‘location’][‘city’])
KeyError: ‘city’
08/05/18 21:38:19 : Failure to build environment variables
\033[31;47m 08/05/18 21:38:19 : Failure installing CouchDB \033[0m
08/05/18 21:38:19 buildScript.sh: Failure running release specific script
pi@raspberrypi:~ $


#4

We were using a 3rd party website to collect geographic information about where the MVP was located (based on the router), and they decided to change their service and no longer provide it without registration. This is what is breaking.
I have updated the code in github. As a quick patch, you can modify your version of /home/pi/MVP/python/Initialize.py and comment out the line that calls the location information (line 24).

def initialize():
“”“One time setup of the environment - get UUID of Field
Args: None
Returns: None
Raises:
None
“””
env = {}
env[‘field’] = get_field()

env[‘location’] = str(get_location())

save_dictionary('env', env_file, env)

Sorry for the problem. I hope this gets you going again.


#5

There is no “Initialize.py” in the directory of “/home/pi/MVP/python/” listed in the MVP of GitHub.
Please kindly send that file.


#6

Sorry, my mind in is a future version; and actually in a different repository.

Assuming you are getting your code from:

You want to go to /home/pi/MVP/python/buildEnv.py
comment out line 16

buildLocation()

Sorry for the confusion.


#7

@nobuhiko417 Please let us know if you have any further issues. I apologize that this wasn’t seamless. We are in the process of transition repo’s into this GitHub:

https://github.com/futureag

More information on this wiki as well:


#8

Thank you for your additional support.
I tried to use “buildEnv.py” amended by webbhm. However I still have following errors.

================= Quote ====================

Start Local file changes

('env: ', {‘mac’: ‘b8:27:eb:d3:ff:ba’, ‘exp’: ‘experiment_1’, ‘reservoir’: {‘empty’: 220, ‘full’: 175, ‘timeout’: 1200, ‘change’: 3}})
Traceback (most recent call last):
File “/home/pi/MVP/python/buildEnv.py”, line 60, in <module>
test()
File “/home/pi/MVP/python/buildEnv.py”, line 49, in test
print('location: ', env.env[‘location’])
KeyError: ‘location’
08/07/18 10:28:38 : Failure to build environment variables
\033[31;47m 08/07/18 10:28:38 : Failure installing CouchDB \033[0m
08/07/18 10:28:38 buildScript.sh: Failure running release specific script
================== End of Quote =========

Therefore I checked “couchdb.log” and see the following errors but I don’t know whether this is the reason or not and how to fix it also.
=================== Quote from couchde.log ==========
info] 2018-08-07T01:27:17.617384Z couchdb@127.0.0.1 <0.204.0> -------- Starting couch_sup

[notice] 2018-08-07T01:27:17.780336Z couchdb@127.0.0.1 <0.91.0> -------- config: [couchdb] uuid set to 2ec23e76144a240c264d15aacefcf6b7 for reason nil

[info] 2018-08-07T01:27:18.035812Z couchdb@127.0.0.1 <0.203.0> -------- Apache CouchDB has started. Time to relax.

[info] 2018-08-07T01:27:18.099110Z couchdb@127.0.0.1 <0.9.0> -------- Application rexi started on node ‘couchdb@127.0.0.1’

[error] 2018-08-07T01:27:18.178211Z couchdb@127.0.0.1 emulator -------- Error in process <0.282.0> on node ‘couchdb@127.0.0.1’ with exit value:

{badarg,[{ets,member,[mem3_openers,<<"_users">>],[]},{mem3_shards,maybe_spawn_shard_writer,3,[{file,“src/mem3_shards.erl”},{line,486}]},{mem3_shards,load_shards_from_db,2,[{file,“src/mem3_shards.erl”},{line,389}]},{mem3_shards,load_shards_from_disk,1,[{file,“src/mem3_shards.erl”},{line,378}]},{mem3_shards,load_shards_from_disk,2,[{file,“src/mem3_shards.erl”},{line,407}]},{mem3_shards,for_docid,3,[{file,“src/mem3_shards.erl”},{line,96}]},{fabric_doc_open,go,3,[{file,“src/fabric_doc_open.erl”},{line,38}]},{couch_index_server,’-get_index/3-fun-0-’,2,[{file,“src/couch_index_server.erl”},{line,68}]}]}

[error] 2018-08-07T01:27:18.178800Z couchdb@127.0.0.1 <0.252.0> -------- Error opening view group _auth from database shards/40000000-5fffffff/_users.1533472452: {‘EXIT’,{{badmatch,{badarg,[{ets,member,[mem3_openers,<<"_users">>],[]},{mem3_shards,maybe_spawn_shard_writer,3,[{file,“src/mem3_shards.erl”},{line,486}]},{mem3_shards,load_shards_from_db,2,[{file,“src/mem3_shards.erl”},{line,389}]},
=============== End of Quote =============


#9

Thank you for your help. From your recent amendment of “buildEnv.py” in GitHub, I understood “buildLocation()” was changed to “#buildLocation()”. Although I tried this amendment, It failed again with Error message. This time is "KeyError:‘city’.


#10

Give me a bit to look closer at this. You are past the point where it was failing (creating the location data), and it now looks like you are failing on a validation routine - it cannot find the data it expected to be created by buildLocation.


#11

Can you give me a screen shot of the error, and what is happening before you get it. I am having a hard time reproducing the error, and it would help to know exactly where in the script this is occurring.
Thanks

HW


#12

I think I may have found it.
In the buildEnv.py file, you need to comment out the last line of the file.

test()

When test is run, it builds the environment, then prints it. In the print it is calling a part of the dictionary that no longer exists (print("city: ", env.env[‘location’][‘city’])


#13
  1. Location data
    With regard to the location data, I checked my registration of API again. There are some curious points (differences) between the data automatically captured and my input data.
    Automatically captured data
    ZIP code: 590-0814 City: Sakai, Region: Osaka
    My input Data in my account
    ZIP code:651-2241 City:Kobe, State: Hyogo
    I don’t know why but does it affect the original (before amendment) “buildEnv.py”?
    If it does, how can I fix them?

  2. #buildLocation”, “#test()”
    I understood your suggestion makes a bypass route for followings.

def buildLocation():
jloc=getLocation()
loadDict(‘location’, jloc)

def test():
import env
print('env: ', env.env)
print('location: ', env.env[‘location’])
print("city: ", env.env[‘location’][‘city’])
print("lattitude: ", env.env[‘location’][‘latitude’])
print("longitude: ", env.env[‘location’][‘longitude’])

Anyway I will try this but I’m just wonder I can run MVP without location data afterwards?

------------------- Result -------------------------------
Thank you very much!!
Finally I succeeded to go through the stage 19 and reached to the stage 25 “Launch the Dashboard”.
On the other hand, a temp & humid sensor is heated up during this setting up. Now it is 1:38 am. After having sound sleep, I’ll fix it and start first experiment.
Thank you again.

For checking purporse of temp & humid sensor, I tried to prepare a second Rpi with the amended buildScript of GitHub. And again, I faced “Fail notice” as follows.
The link “mirror.stjschools.org/public/apache/couchdb/source/2.1.1/apache-couchdb-2.1.1.tar.gz” does not exsit from Today. And there is “2.2.2/apache-couchdb-2.1.1.tar.gz” . Does this work instead of 2.1.1?

================ Quote ====================
–2018-08-08 23:38:14-- http://mirror.stjschools.org/public/apache/couchdb/source/2.1.1/apache-couchdb-2.1.1.tar.gz
mirror.stjschools.org (mirror.stjschools.org) をDNSに問いあわせています… 97.84.43.53
mirror.stjschools.org (mirror.stjschools.org)|97.84.43.53|:80 に接続しています… 接続しました。
HTTP による接続要求を送信しました、応答を待っています… 404 Not Found
2018-08-08 23:38:15 エラー 404: Not Found。

tar (child): apache-couchdb-2.1.1.tar.gz: open 不能: そのようなファイルやディレクトリはありません
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
/home/pi/MVP/setup/couchBld.sh: 30: cd: can’t cd to apache-couchdb-2.1.1/
/home/pi/MVP/setup/couchBld.sh: 33: /home/pi/MVP/setup/couchBld.sh: ./configure: not found
make: *** ターゲット ‘release’ を make するルールがありません. 中止.
/home/pi/MVP/setup/couchBld.sh: 37: cd: can’t cd to ./rel/couchdb/
/home/pi/MVP/setup/couchBld.sh: 40: cd: can’t cd to /home/couchdb/etc
08/08/18 23:38:18 : Failure building CouchDB
\033[31;47m 08/08/18 23:38:18 : Failure installing CouchDB \033[0m
08/08/18 23:38:18 buildScript.sh: Failure running release specific script


#14

This is another one where we rely on 3rd party software and they have made a change. The latest version of CouchDB is now 2.2.0, and the script was built when 2.1.1 was the latest version.
Unfortunately, you are the first to catch these changes.

For a quick fix, try going through the script (/home/pi/MVP/setup/couchBuild.sh) and change all occurrences of 2.1.1 to 2.2.0. See if that works for you.

As to the location information. You are correct that it is not required to run the MVP. We were looking to the future when we could collect data on a central cloud database, and this would give us the ability to know where the MVPs were located.


#15

Thank you again for your full support. To face small problems is OK for me to understand the contents a little bit of given scripts. It makes me to learn more them. Anyhow after amending the script of “couchBuild.sh” according to your advice, I succeeded to finish all setup but at third trial. Because the connection of temp/humid sensor seems unstable. I checked MVP dashboard and temperature shows -46.9 degree c and humidity shows -6%. The sensor may be broken and it also shows Timestamp (hover over to display date), Where can I see the manual of using Dashboard.


#16

You are correct that you will have a validation error if your sensors are not hooked up correctly. Check the solder on the pins, and make sure your wires are correct. The SI7021 is an I2C bus sensor, for a low level check, type the following from a command prompt:
sudo i2cdetect -y 1
You will get a table of potential I2C addresses, and you should see an address of 40 in the list if you wires are correct.

The charts are created through the script render.sh The script calls various python programs that create the charts. You can look at the python code to see how the data is collected, processed and turned into a chart.


#17

Finally sensor si7021 works.My problem is the poor quality of “jumper wire”.
And my MVP starts to run anyhow.

However still there are some problems related to the “builtScripts” and its guide as follows.

  1. “Timestamp” on MVP dashboard
    A shown in the picture below, the latest time is 2018/08/12-2:00:02 but the actual time is 2018/08/12 12:10.
    Almost 10hr difference is recognized. I believe this happens because of null data of “geoLocation” since it
    was neglected in the modified “buildScript”.

    Of course Time zone of “pi” is Tokyo, Asia.
    DSC00273A
    Please let me know how to force “Timestamp” change without “geoLocataion” data.
    Can I change it in the “logData.py”?
  2. Error in the data entry of “MVP dasboard”
    I tried to enter some data and I faced to the error code “ERROR 501” likewise.
    DSC00274A
    DSC00275A
    This Error happens whatever I typed in the blankets.
  3. Fan cotrol pin of pi.
    According to the url: https://github.com/webbhm/OpenAg-MVP-II#architecture
    In the “Pin Assignment”, the pin for relay #1 (fan control) is described " '35 - GPIO13 fan control
    (relay #1)". However pin # of GPIO13 is 33"
    So I believe it has to be amended as
    "• ‘35 - (reserved for relay #2)’
    " • ‘33 - GPIO13 fan control (relay #1)’
    Right?

#18
  1. The timestamp is set to Greenwich time, not local time; and it has nothing to do with either the Raspberry timezone or the env.py location information. It has confused a lot of people. We want to be able to synchronize MVPs, so trying to stay with one time standard. It would be nice if we could get the charting to display in local time, but that is a feature we have not gotten to yet.

The data entry is something we were working on, but never implemented with that server. I failed to remove the line from the screen, and the form. We are working on getting it into the next release.

That being said, it looks like you are up and running!


#19

OK, I understood.
I can close this topics. While I enjoy to observe my first experiment, I will join the topics of “MVP” itself to know the latest design of “MVP II”.
Thank you.