Monthly Archives: January 2019

Mild progress, new laptop

I have not posted an update recently, as I have been busy with work and configuring my new laptop. I decided to go with a Dell XPS 13 Developer edition (AKA Ubuntu pre-installed). So far I’m pretty happy with the computer purchase. The price was rather high, but the design is darn good. I didn’t think I would like to type on a 13″ laptop… notebook… netbook… Ultrabook… whatever you want to call it, but I do! It’s a well-designed keyboard on a few levels. I won’t go into any of the details, as there are enough reviews of the thing for sure, but I like it! Fast, good battery life, made to run Gnu/Linux ^_^

It has been a few years since I last tried to use Ubuntu or some other Gnu/Linux variation full time. I have a good feeling about this time since a lot of the deal breakers have been solved! The following issues I had before to varying degrees have been fully fixed.

  • Netflix
  • Games (Steam)
  • TeamViewer
  • Managed Service application I use
  • Audio and Video seem to work flawlessly now

I still have a few more things I need to setup and configure, but I already have PyCharm working and my programs loaded and working. So I’ll be doing more programing soon.

I found out that Ubuntu 18.04 displays the interface of my sensor control center app different than both Windows & Raspbian, so I added GUI customizations to support Ubuntu. OpenGL works well for graphing on my Ubuntu computer, so I have enabled it by default for Ubuntu, but I’ll have to add the option to use CPU rendering in case others are not as lucky to have a working graphics card.

Just doing a quick update today. Until next time.

Python Virtual Environment

W00t, I have python virtual environments setup and working with a requirements.txt file in the Linux sensor installer script. Shortcuts & services now use the python virtual environment. Now it doesn’t matter if the main python environment is altered! I’m glad I got this working because pipenv just wasn’t working quickly enough for the poor Pis.

I’m having trouble with my configuration file upgrade section … it doesn’t always load things properly between changes and will probably be time intensive to maintain all the upgrade paths. With this in mind, I’m thinking about just resetting configuration files to default when said files change between versions. It would force one to change the config file after larger updates but at the same time, it would mean the sensor would always load up properly after an upgrade… I was thinking I could make a backup of the old configurations during the upgrade and add the ability to see previous configs in the control center for a quick reference. I’ll have to give it some more thought.

I have been giving more thought to my Sensor Triggers and it comes to mind I should probably make different types of triggers. I’ll probably split the triggers into variances (Readings differ by a variance within a given time) and min/max values (Readings exceed or go below a value, checked every X time). AKA I’ll have 3 ways to record data.

  • Record every X seconds (Interval Recording)
  • Record if the difference between 2 readings, taken every X.X seconds is more then the variance (Variance Trigger Recording)
  • Record if the sensor value is above X or below Y. Check every X Seconds (Min/Max Trigger Recording)

Those 3 types of checks should cover most project scenarios where sensor recording is required.

I have had a chance to poke the program a bit more over the past few days, so I’m happy about that. Still looking forward to warmer and sunnier weather!

Re-Configured hardware sensor config

I finally had a clear enough mind to really go through and update the raspberry pi sensor software configurations. Before I had multiple functions load the config file from the disk, but this means its reading from the disk multiple times, and the disk is one of the slower parts of a computer, especially for the Pi’s. So, I made it so the configuration py file itself loads and creates the configuration object, and all others just use that object. This way it only loads once (well technically twice because it’s used in 2 programs). This also standardizes things for simplicity, so whenever anything uses the config, it’s done the same everywhere and points to the same object instance. Easier to follow code and saves a bunch of system resources.

I’ll have to remember to do my refactoring when I’m feeling really good, as refactoring takes the most thought and planning… well that and writing the initial code 🙂 But I usually don’t know the best way to do it the first time, especially if I have to “fiddle around” to get it working, so the better work generally comes during refactoring.

During this configuration overhaul, I made a separate python file for trigger variances, since I will be making interval and trigger recording work on all sensors. With the new variance python file in place, I’ll be creating a new configuration file to enable variances per sensor & making it so the interval and trigger recording can be enabled and disabled separately in the main config file.

Motivation is especially low, so little has actually been done in the past 4 or 5 days. Something about the winter…