this app automates the roof and curtains opening and closing on telescope pointing base
on crac client
sudo apt-get install python3-tk python3-pip
on crac server
sudo apt-get install python3-pip
# for raspberry pi
sudo apt-get install libatlas-base-dev
sudo apt-get install tk-dev openssl-dev libffi-dev
https://pyenv.run | bash
open ~/.bashrc and copy these 3 lines at the bottom of the file
export PATH="/home/alessio/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pip3 install pipenv
pipenv shell
pipenv install --dev
--dev is needed only for development purpose
pipenv shell
exit
pipenv update --dev
python -m unittest discover -v
coverage run -m unittest discover -v
coverage html
python -m unittest unit_test/roof_control_test.py
coverage run -m unittest unit_test/test_curtains.py
coverage html
Open up the file manager and navigate to ./htmlcov Double click on the html file relative to the class you want to check coverage
mypy *.py
mypy gui.py
pycodestyle *.py
python server.py -m
python server.py -s
python server.py -m -s
python client.py
./crac.sh -s start
./crac.sh -s stop
./crac.sh -s logs
./crac.sh -s start -a client
./crac.sh -s start -a server -p "-m -s"
if you pass just an argument, quotes are not mandatory
./crac.sh -s start -a server -p -m
./crac.sh -s logs -a server
./crac.sh -s logs -a client
obviously, only the server use arguments
https://wwww.bisque.com/wp-content/scripttheskyx/functions_l.html
For enable/disable debugger on theSkyX: open menu via Tools | Run Java Script. This brings up a window with a buffer into which you can paste the script and a checkbox to "Enable Debugger" so you can run the script and get execution feedback. Keep it disabled on production!
ssh -L 59000:localhost:5901 -L 3030:localhost:3030 -C -N remoteIP
this way you can connect to the server via both vnc (5901) and CRaC server (3030). Or you can decide to run CRaC client/server locally and connect remotely to theSkyX (3040)
Install docker
compile the docker image
docker build -t crac_server . -f Dockerfile.server
run the docker image
docker run --net=host crac_server
you can also pass the arguments:
docker run --net=host crac_server -m -s
Install docker
https://sourabhbajaj.com/blog/2017/02/07/gui-applications-docker-mac/ https://medium.com/@SaravSun/running-gui-applications-inside-docker-containers-83d65c0db110
just once in a Mac environment
brew cask install xquartz
brew cask install docker
compile the docker image
docker build -t crac_client . -f Dockerfile.client
Right before starting the docker image
IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
export DISPLAY=$IP:0
xhost +
run the docker image
docker run -e DISPLAY=$IP:0 --net=host crac_client
Install docker and docker-compose
start the service on a Mac OSX
./composer.sh -o mac -s start
start the service on linux
./composer.sh -s start
stop the service on a Mac OSX
./composer.sh -o mac -s stop
stop the service on linux
./composer.sh -s stop
Flag used by composer.sh: -o mac if it's running on a mac OSX -s start/stop/restart/build/logs -a crac_client/crac_server
It is possibile to change the arguments passed to the crac server in the command section of crac_server in docker-compose.yml