jenkinsracing / open-race-scale

Open Source Racecar Scale
GNU Lesser General Public License v3.0
2 stars 4 forks source link

explicitly define build environment #9

Closed RoaddogLabs closed 7 years ago

RoaddogLabs commented 7 years ago

Update docs with explicit instructions on build environment steps. An example the default docs for Kivy install to Pi are python2.7. Building Kivy using python 2.7 fails to import statistics from loadcell.py as it's set to python3 in the #! of loadcell though used python2.7 to run main.py. The dependency and Kivy build on a Pi takes around an hour all in.

Rather than reading comments in the code, bring those to the readme.md or a docs wiki.

Reminder to set PYTHONPATH to the ORS source dirs so the modules will load. Many deployment issues are due to different environment variables and paths between the host the dev was on and what the end user is using.

Users that are not devs (which is basically most racers and/or makers) will likely have difficulty installing all the dependencies unless explicitly noted. You and I can tell what lib is missing for example when something that needs a gcc lib or some sort bails with an error. The users are going to need this wrapped up in a neat little package or at least as neat as possible given the platform.

Given the number of dependencies and difference in environment variables this package may make a good candidate to run from Docker once it gets to a place where the hardware and software are at one as well as an RPI image ready to operate for those that aren't able or willing to set up a Pi and run Docker or install manually.

zerox1212 commented 7 years ago

I will improve the docs soon, but you should not have to do anything fancy to get this to work on a Pi, unless you are using an older Pi OS image that doesn't have Python 3.x.

Step should basically be: Grab latest RPi NOOBS image from RPi website and load onto Pi `pip3' install the dependencys (which I will list soon in readme) git pull this repo and run main.py

Once I have assembled hardware I will make a proper pip package so that it's easy to install.

RoaddogLabs commented 7 years ago

The issue is your dependencies default in most cases to a python2.7 build regardless of if they work in 3 or not. Kivy is a classic example. Most utils don't default to python3 yet and as a courtesy devs using 3 typically call it out.

There were also a couple of gcc libs that were dependencies of of the dependencies. For someone that works in the shell it's not an issue, for regular users it's a gigantic issue. I've seen it hundreds of times. The people that are going to use your project want to build and use scales, not hack the shell. The easier you make if for them to do that, the more successful your project will be.

zerox1212 commented 7 years ago

Python dependencies don't default to anything. It depends on your environment. If you were running pip for python 2.7, the libraries got installed to python 2.7, and then I agree it wouldn't work.

This code is essentially pre-alpha and anyone trying it at this point would be running the code from an IDE anyways. I don't think I have even tried to run kivy on the Pi yet. I have just been getting everything ready in Windows.

I'm probably going to reorganize this repo (move hw stuff to separate repo) then I can make a python package so dependencies get installed automatically.