MDRS:HAL Development Log

From Marspedia
Revision as of 13:39, 11 November 2018 by Jburk (talk | contribs) (→‎Setting up Python/Kivy)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
HAL


Development Log of the MDRS Habitat Activity Lexica (HAL)

Developers: James Burk, Ryan Watson, Matt Hopson (MarsChat)

Operating System

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)
  • VLC
  • Libreoffice (Default in the base image)
  • OMX

Users

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

10/31:

Here is the latest issue list for HAL after Crew 197's rotation.

  1. 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)
  2. The Raspbian install still has a screensaver (blank) after 10 mins or so, we should disable that for the touchscreen.
  3. 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.
  4. 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.
  5. MarsChat worked great.
  6. Time worked great, although we might remove the leading "0" and the seconds.
  7. 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.
  8. 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.

10/19:

  1. HAL works!!!
  2. Disable Screensaver
  3. 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.

10/13:

  1. Hostname should be "hal"
  2. 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.

Earlier

  1. need to fix sudoers, still is expecting the default `pi` user
    1. command to disable: sudo passwd --lock pi
  2. Add Mars related wallpaper by default
    1. MDRS or URC
  3. Fixup timezone, initial / ongoing time sync via ntp. Currently defaults to UTC
  4. Password is currently set during the image build / provision. Can / should be more dynamic
  5. Dual displays with HDMI output as primary
    1. add "display_default_lcd=0" to /boot/config.txt

Install walk-thru

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.

Windows 10

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.

Download: https://etcher.io/

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.

6) Flash!

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

6. Clone MDRS-HAL

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)

Weather API

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
Forecast
http://api.openweathermap.org/data/2.5/forecast?id=5540148&APPID=cd14c2a1a96fc217b8b23c10d60abada


Description of JSON (under heading: "Weather parameters in API respond")

Bandwidth Monitor / Wifi at Hab

Bandwidth Monitor

Use Kivy Bar Graph

Show stats on:

  • Plan Allowance (MB per day)
  • Allowance Remaining (MB)
  • Allowance Remaining (%)
  • Time until Allowance Refill


Wifi Password

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.