SainSmart DDS-120 Oscilloscope on MacOS

Summary

I’m working on a project which requires me to use an oscilloscope. I have never had a need for such a device, so I was very surprised when I priced used oscilloscopes used at €300.

As a result, I looked at my options and I was happy to find there are a plethora of known as USB Oscilloscopes. These are hobby-level oscilloscopes, which are less expensive because they save money on the computing and display components of the device.

https://i1.wp.com/cdn.shopify.com/s/files/1/1978/9859/products/9_4_1024x1024.jpg?w=525

This oscilloscope in particular, is quite capable. At about $70,  my Sain Smart DDS-120, included the scope, two channels, two probes, a logic analyzer and an external trigger.  You can find the specs of the scope here.

Anyway, given I only have a Apple computers and the software for the scope runs on windows I thought I would share what I did to make it work.

Steps

At this point, it should be fair to assume you have access to the scope and you just need to get it working. There are two options for getting Windows to run on your Mac computer, you can go dual-boot (the reliable and least convenient), or Virtual Machine (less reliable, though not unreliable, and most convenient). I chose the latter. There are a bunch of Virtual Machine options, I chose VirtualBox, or VBox. I chose VBox because it’s free and it works pretty well. With that in mind, here are the steps I followed to get the scope working on MacOS.

  1. Download and install the latest version of VirtualBox. I used version 5.2.x
    1. On MacOS 10.13, I got an error message at the end of the installation saying I needed to allow the program to run in security & privacy preferences pane. After I did this, the installation said there was an error and it had not installed correctly. I simply re-installed it, and the installation completed without any issues (not even the security & privacy warning).
  2. Download and install the latest VirtualBox Oracle VM VirtualBox Extension Pack. This will be in the VirtualBox download page and cannot be installed until AFTER you have installed VirtualBox. To install just double-click on the file and it will automatically pickup VirtualBox and install itself there.
  3. Once installed, you need to create a Win7 Virtual Machine (VM). To do this:
    1. Click on “New”
    2. Click “Create”
    3. Click “Create” again and you are done
  4. At this point you have an empty VM. You will need a Win7.iso file. These are easy enough to find on the internet. If you need one, message me directly and I can point you in the right direction. Assuming you have an ISO image, select the VM and click on Start –> Normal Start. Since you need to load the OS into the VM, you will get this error message (though instead of Windows 7 Ultimate… yours will likely say “Empty”. Click on the Folder Icon next to the drop-down and select the your Win7.iso file. Click start and follow the instructions.
  5. After you have finished installing Win7 you will need to setup Scope software and calibrate the probes.
    1. Enable the scope’s USB to connect through your Mac onto the VM by following these steps:
      1. Start the VM
      2. Connect the Scope to the Mac using the USB cable
        1. Your Mac should NOT pick up the scope as it’s not compatible, so don’t worry if nothing happens on your Mac (the host)
      3. Right-click on the VM and choose settings. Under settings click on “Add Filter” and select BUUDAI USBxxx. Make sure to select it and click OK.
      4. The VM will inform you that it’s installing the necessary drives and it should just begin picking it up going forward.
    2. Install the software. The software I used is here: Software_V1.5.0. The zip file includes everything I needed to get it to work. Just look for DDS120.exe inside the folder and that’s it 🙂
      1. You can check installation by clicking on “Start” on the bottom right of the software screen.
    3. Now you need to calibrate the probes.
      1. To calibrate the probes, set them to 10X and connect them to the scope and use the signal emitter between the two channels to calibrate them. 2018-01-25 18.00.44.jpg
      2. Inside the Scope software do the following:
        1. Select Channel 1 and make sure it’s On and set to 10X
        2. Set the time to 1ms
        3. Set Channel 1 Voltage to 50mV
        4. Optionally, you can zoom in to get a closer look at the waves (but this is not necessary
      3. You want the signal to be as square as possible. You can adjust it by using a small screwdriver to calibrate the wave shape. The probes are pretty good, but not perfect. So don’t worry if you cannot get the shape of the wave to be perfectly square.

That’s it you are done and ready to begin using your new USB scope.

Plex Media Server auto restart on crash (MacOS)

Summary

If you use the Plex Media Server on your home PC to serve your media content, then you know how important it is to keep that service up and running at all times. For this reason I found it frustrating when my iOS Plex Player kept crashing the server.

For some reason, the iOS Plex App would crash the server anytime I tried to play a video using automatic quality throttling. Anyway, after I figured out it was the iOS App, I began looking into way to make sure that in the future, the server would come back up, even if it had been crashed.

Steps

Setting up a process to auto-restart is simple. You just need to create a LaunchAgent and have LaunchD (MacOS’s agent and daemon controller) take care of the rest:

  1. Remove the check on Plex Media Server to Open at Login
    1. If you Plex Media Server is already running, go up to the menu bar and make sure to uncheck Open at Login. Otherwise, you could end up with duplicate processes.
  2. Create a file like this one (if you are using Plex Media Server.app, you can just use that file) and make sure it’s named com.plexapp.plexmediaserver.plist
    1. Lines 5 to 11 tell launchd to start the program when computer starts and to restart it (keepAlive) if it crashes.
    2. Lines 11 and 12 give a name to the LaunchAgent.
    3. Lines 16 to 18 are the program’s parameters. open is a built-in program in MacOS for opening files, URLs and programs. -g tells open to start the program in the background. And /Applications/Plex Media Server.app is the path to our application 🙂
  3. Place the file under the LaunchAgents folder in the user’s Library (here: ~/Library/LaunchAgents/). You should end up with this path: /Users/<your username>/Library/LaunchAgents/com.plexapp.plexmediaserver.plist
  4. Load the LaunchAgent into LaunchD like this: launchctl load ~/Library/LaunchAgents/com.plexapp.plexmediaserver.plist
    1. That tells LaunchD to look at the configuration file in the plist file you have given it and execute it
    2. You can also unload it, which means to remove the plist file from LaunchD’s queue of things to control. launchctl unload ~/Library/LaunchAgents/com.plexapp.plexmediaserver.plist

That’s it. From now on, when the computer logs in, it will start Plex Media Server and if it crashes and it will automatically restart.

Troubleshooting

If you run into issues, you can troubleshoot by looking at the system logs and loading or unloading the plist file.

The system.log records any error messages generated by LaunchAgents (not just the one you just created). You can view the system log like this:

  • To just view what is there now: cat /var/log/system.log
  • To scroll through what is there now: cat /var/log/system.log | more (and press the spacebar to progress)
  • To view the most recent changes in real-time: tail -f /var/log/system.log
    • I find this to be the most helpful

With access to the system log, you can now test your plist by

  1. Unloading the plist
  2. Edit the plist
  3. Re-Load the plist
  4. Check the system log

 

MacOS installer language setting

The other day I purchased an MBP13 from eBay. It was a great deal and it came from Italy. I should probably elaborate this point as it was kind of unique. I live in Spain, but I’m originally from the US, as such, I prefer a US keyboard (the Spanish, or even the UK English keyboard layouts are different, trust me). Anyway, on eBay I found an MBP13 with a US keyboard layout, that was originally purchased in Japan, but was being sold by a person in Rome, Italy, coming to an American living in Barcelona, Spain… funny no?

Anyway, I got the laptop and it was in very good shape. However, like all used pieces of software, I needed to reset it. However, the installer’s language (not the OS) was in Italian.

I looked online for changing the language of MacOS and I was always directed to the System Preferences –> Language and Region –> Set to English… change, but that is AFTER you have installed the OS.

So I gave my bad Italian a try and I ended up with a bad disk partition and a bad install.

2017-12-15 14.04.02.jpg

I then figured out the setting. To update the language on your installer (or BIOS, as some people referred to it), do this:

  1. Restart the machine by holding down the power button until it shuts off (around 5-10 seconds)
  2. Press the power button again
  3. Immediately after pressing the power button hold down command and r (command + r), just keep it holding down
  4. That will start the recovery cycle and it will try to connect to the internet. Wait for that to finish
  5. You’ll arrive at the Installer.
  6. Regardless of the language just remember to click on the second menu (not counting the Apple logo), the first option will be Change Language. Click and you are set 🙂 2017-12-18 19.44.37.jpg

Do you need a US phone number even while not in the US?

If you travel a lot and/or live outside of the US and require the appearance of being in the US, then Google Voice is for you.

Google voice is a VoIP service which works very similar to normal VoIP services plus you get a pretty reliable texting service too.

You can find more information on Google voice here. Below is a diagram to explain how the system works and how you can use to appear as if you are calling from a US number even while traveling.

The integration of the Google Voice App is very good in Android phones. On iPhones not so. On iPhones, your integration will be more like when you are traveling, where you need to use both apps (the Google Hangouts Dialer and the Google Voice App for individual functions).

There are a bunch of really good articles on how to use Google Voice and the Google voice dialer out there, so I will not plagiarize them. Instead here are some useful links.