MDRS:HAL Development Log
- 1 Development Log of the MDRS Habitat Activity Lexica (HAL)
- 2 Operating System
- 3 Users
- 4 Current Issue List
- 5 Install walk-thru
- 6 Setting up Python/Kivy
- 7 Weather API
- 8 Bandwidth Monitor / Wifi at Hab
Development Log of the MDRS Habitat Activity Lexica (HAL)
Developers: James Burk, Ryan Watson, Matt Hopson (MarsChat)
Ryan Watson: I have a beta Raspberry Pi image that I've posted up on S3 and I want to invite you to download, write to your SD card and give it a try. It has a very sparse selection of apps:
- Chromium (Can be changed to Firefox, defaults to Chromium so left it alone for now)
- Libreoffice (Default in the base image)
Default pi user still in effect as admin. Likely disable but not delete, due to potential future needs of having that standard user.
There are two baked in users, an administrative user for possible future tasks and a workstation user:
- U: `admin` / PW: `get_to_mars` - U: `mdrs` / PW: `get_to_mars`
Current Issue List
Here is the latest issue list for HAL after Crew 197's rotation.
- HAL is set up at the MDRS and connected to the Github repo. It successfully runs on the touchscreen (which is mounted to the wall in the Upper Deck)
- The Raspbian install still has a screensaver (blank) after 10 mins or so, we should disable that for the touchscreen.
- I could never get it to run on boot to the correct screen. I had trouble setting the 'export VC_DISPLAY=4' variable for a shell process prior to running HAL. It would always show up on the main screen.
- Google Calendar's API is inconsistently returning results from the Hab, likely due to the poor internet connection. We should replace that feature with a local-based JSON file with the Crew's daily schedule, and a tool for them to maintain it.
- MarsChat worked great.
- Time worked great, although we might remove the leading "0" and the seconds.
- Weather worked great, although not all the possible weather symbols are implemented. Also, the weather is Hanksville, since there is no API for our local Bloomsky weather station that's attached to the MDRS Robotic Observatory.
- Bandwidth monitor still needs to be implemented based on the router scrape. I wrote code to scrape the router but I did not have time to complete the UI display during the rotation, mostly because I had a lot of trouble using the Internet to do research for code troubleshooting.
- HAL works!!!
- Disable Screensaver
- Ensure python3.7, PIP 18.1, Cython 0.28 and Kivy 1.10.1 are all the default and running without a virtualenv. Eg: "python -V" and run not as root should be 3.7.
- Hostname should be "hal"
- when installing software, it asks for pi or root password (our accounts not listed). Since I didn't know either of them, I had to reset using sudo passwd pi with admin account.
- need to fix sudoers, still is expecting the default `pi` user
- command to disable: sudo passwd --lock pi
- Add Mars related wallpaper by default
- Fixup timezone, initial / ongoing time sync via ntp. Currently defaults to UTC
- Password is currently set during the image build / provision. Can / should be more dynamic
- Dual displays with HDMI output as primary
- add "display_default_lcd=0" to /boot/config.txt
The end goal is to write the boot image file to an SD card, configured to boot a Raspberry Pi. There are several possible workflows possible using OSX, Linux or Windows. I will detail a Windows based workflow below and add others as necessary.
1) Download artifact from S3
The zip file artifact is currently located at https://s3.amazonaws.com/watson-builds/image_2018-10-03-razpi-modz-v.5.2.zip and downloadable via browser or other tool.
2) Install image writer utility
I found via the Raspberry Pi forums a utility called etcher written and hosted by resin.io, an IoT company. The utility is straightforward and easy to use. There is no need to extract the img file from the downloaded zip file. This utility can accept the compressed file and write to an SD card.
3) Insert SD card
Before starting Etcher it is helpful to insert the SD card then start the application.
4) When the application is open navigate to the download location and select the still compressed .zip file
5) The SD card should already be selected, if not choose the correct target SD card drive.
Etcher will begin to write the image to the card. In testing this typically takes about 15 minutes. During the process Windows will notify that the drive has been ejected, or that the card needs to be formatted before use etc. Cancel or dismiss these messages and let Etcher continue. After the write is complete it will verify the write and then software eject the SD card (unmount it from the computer). You can now remove the SD card and place into the RaspberryPi.
Setting up Python/Kivy
Will be using the Kivy package to output to the RPi Touchscreen.
1. Install Python3
2. Create virtualenv named "halenv"
virtualenv ~/halenv source halenv/bin/activate
3. Update PIP
pip install --upgrade pip
4. Install Cython
pip install Cython
5. Install Kivy
7. Test that it works.
Note: to output Kivy apps to the RPi touchscreen, use:
export VC_DISPLAY=4 call (["export VC_DISPLAY=4"], shell=True)
Exact API calls to return JSON - cache it and only call 1x per hour.
Current conditions http://api.openweathermap.org/data/2.5/weather?id=5540148&APPID=cd14c2a1a96fc217b8b23c10d60abada
Description of JSON (under heading: "Weather parameters in API respond")
Bandwidth Monitor / Wifi at Hab
Use Kivy Bar Graph
Show stats on:
- Plan Allowance (MB per day)
- Allowance Remaining (MB)
- Allowance Remaining (%)
- Time until Allowance Refill
You will be able to connect with HughesNet wireless within the Hab using either:
SID: Science pw: ScienceDog or SID: MarsHab pw: SpaceDog
Check under the router itself.