Pyle PSWGP405BK GPS Watch Software and Firmware Updates

Today, I discovered that the New Balance NX990 GPS Cardio Trainer Watch, like the Pyle PSWGP405BK, is just another Latitude Limited Nav Master II clone.  Following my hunch, I searched for the NX990’s accompanying software, and lo and behold, it’s just rebranded version of GPS Master! Best of all, it’s an updated version, v2.0.16.124, vs the older v1.2 version that I got from Pyle. Besides the red background, it has a much improved interface, showing a google map of your track, and a zoomable graph with user selectable data that tracks your stats live on the map.

nbgpsmaster

So for instance, you can select the point on the graph where your heart rate is highest, and see where you were located on the map.

Best of all is the new Data Transfer->AGPS menu item. A-GPS (Assisted GPS) lets you use the Internet to download GPS satellite almanac data. Your GPS watch can download the almanac data directly via the satellites, but it is a very slow procedure. By connecting your watch to GPS Master once a week and downloading new AGPS data, you can get a hot GPS fix a lot faster. I wasn’t sure if my Pyle firmware had A-GPS support built in, so I took a risk, and used Setting->Watch firmware update to update my Pyle watch to the latest New Balance firmware. I’m happy so say that my watch did not get bricked! [DISCLAIMER: YMMV. I AM NOT RESPONSIBLE IF YOU DECIDE TO INSTALL THE NEW BALANCE FIRMWARE ON YOUR WATCH, AND IT TURNS INTO A PAPERWEIGHT] The New Balance v1.20 firmware appears to have all of the functions of my Pyle firmware. The most obvious difference is just that the screen fonts are more squared off looking. Some of the menus look slightly different, too. I took my watch outside after updating the AGPS data, and it got a GPS fix about 10x faster than the last time I used it.

Another great discovery is that unlike my GPS Master 1.2, NB 990 GPS’s exported GPX track files now contain heart rate data! This means when upload your GPX track files to web sites such as RunKeeper, your heart rate data will be saved and displayed, as well. Meaning that you don’t have to use the csv2gpx/csv2tcx utilities that I wrote yesterday in order get your HRM data into other platforms.

All and all, I am very happy with both the software and firmware updates. I took my watch and HRM out for a workout today, and they worked flawlessly with the new firmware.

Downloads:

NX990 GPS Master PC Software
NX990 GPS Master User Manual
NX990 User Manual

GPX and TCX output from GPS Master Software

A couple of years ago, I bought a Pyle PSWGP405BK GPS watch with Heart Rate Monitor.

PSWGP405BK

It’s been a great device, though it’s big, and a bit ugly. The battery far outlasts my wife’s Garmin watches, and I love the customizable screens. My main problem has been the lack of a useful way to extract heart rate data. The problem is that the GPS Master software offers only two ways to export heart rate data: 1) TKL format, which is an undocumented file format used only by GPS Master, and 2) CSV format, which isn’t compatible with any web sites or software that I use.  Although GPS Master can directly export GPX files, they do not include the heart rate data.

I finally got sick of it today, and after wasting some time looking for an easy way to adapter existing converter software to work w/ GPS Master’s CSV files, I gave up, and decided to write my own programs. So, I give you csv2gpx, and csv2tcx. csv2gpx takes a GPS Master CSV file as input, and outputs a GPX file with heart rate data embedded. csv2tcx takes a GPS Master CSV file as input, and outputs a TCX file with heart rate data. Both programs have a simple command line interface. I have supplied full source code on github, so anyone can compile them to run on their own platforms. For Windows users, I have supplied EXE files. The command line syntax is quite simple:

csv2gpx workout.csv

or

csv2tcx workout.csv

The output will automatically be generated as workout.gpx and workout.tcx, respectively.

Here is a sample session:

C:\git\csv2gpx\test>csv2gpx 20150125074851.csv
Lincomatic GPS Master CSV to GPX Converter v0.2

Converting 20150125074851.csv -> 20150125074851.gpx
Avg HR: 131
Max HR: 159
Trackpoints 2398

Note that the output file is the same as the input file, but with GPX extension. csv2tcx works in a similar fashion.

I think csv2gpx and csv2tcx should work with any other watches that work with GPS Master, as well. Runtastic’s watch looks identical to my Pyle, as well as several other models that I’ve seen. For instance, the New Balance NX990 also uses GPS Master, and looks identical. As I’ve stated in a previous article, the watch is built by Latitude Limited, and the OEM calls it the Nav Master II.

Update 2015-01-27: Argh! I just confirmed that the fancy new updated version of GPS Master bundled with the New Balance NX990, aka NB 900 GPS, now exports HRM data inside its GPX files! So I wasted my time writing the utilities above yesterday! It has some nice UI enhancements, as well. Highly recommended! You can read my detailed description: Pyle PSWGP405GK Software and Firmware Updates.

Downloads: csv2tcx and csv2gpx executables for Windows

Installing English Firmware on a FAST FWR171

I recently learned that the FAST FWR171-3G is a lower cost clone of the TP-Link TL-WR703N, the only difference being the case. While browsing AliExpress, I found what I thought was a great deal… the FAST FWR171 for only $16. After waiting over a month to receive it, I noticed that it doesn’t have a USB port. Sheesh! I’m such an idiot. Just like when I mistakenly ordered a TL-WR702N from Amazon, it turns out that the FAST FWR171 is a clone of the TL-WR702N, not the TL-WR703N. AAARRGGGH!!! The trailing -3G in the FWR171-3G model number denotes the TL-WR703N clone!! So, not only did I end up with a router that’s useless for hacking, because it doesn’t have a enough RAM to load OpenWrt, has no USB port, and the firmware is in Chinese! FWR171_2 Notice the lack of a USB port in the photo of the FWR171 above. That alone should have warned me that I was ordering the wrong model. The FWR171-3G is slightly larger, and has a USB port on the side. Not wanting to be left with a completely useless device, I started browsing around for an English version of the firmware. None exists, but I found one for the TL-WR702N. Unfortunately, the web admin interface of the FWR171 checks the firmware for the correct device, and it won’t allow you to load a firmware for th TL-WR702N. Luckily, an OpenWrt forum member named jvvh5897 figured out how fool the firmware loader into thinking that it’s loading the appropriate firmware for a different model. In this thread, he describes how to modify an English TL-WR702N firmware to run on the Chinese model. I took that information, and used it to modify the English TL-WR702N firmware to run on the FW171. To adapt the TL-WR702N firmware to be accepted by the FWR171, we need to change two fields: 1) the system identifier and 2) the MD5 checksum of the firmware. In the TL-WR702N English firmware that I downloaded, the bytes in the blue box are the system identifier, and the bytes in the red boxes are the 16-byte MD5 checksum. 702fw Note that the system ID contains 0702 for the TL-WR702N. I downloaded a firmware for the FWR171 and found that the system ID was 01 71 02 01. To update the MD5 sum, you must calculate the MD5 sum of the entire file, with the dummy MD5 sum CC 96 28 EE 8D FB 21 BB 3D EF 6C B5 9F 77 4C 7C inserted. Here is what the file looked like after I prepared it for calculating the MD5 sum: 151fwdummy Next, I calculated the MD5 sum of the English TL-WR702N firmware file modified as above, and it was 06 7e a9 aa 7d 1e 75 10 b0 09 84 19 f1 d9 93 2d, so I replaced the dummy MD5 sum with those bytes and saved the file. Amazingly, the FW171’s firmware upgrader accepted it! To skip the hassle of modifying the firmware yourself, you can download my pre-hacked English TL-WR702N for FW171 firmware file. Using google, I found several descriptions of how to load the new firmware file into the FW171, but they were all wrong, because mine had the newer firmware, which checks for the proper system ID. To get to the web interface, set the IP number of your host computer’s Ethernet adapter to 192.168.1.3. Plug the FW171 into your host computer’s Ethernet port, and point a web browser to 192.168.1.253. Below is the firmware page for mine, which happened to be the latest firmware posted on www.fastcom.com.cn: fwver-sm To load your English firmware, you must set up a TFTP server on your host machine. In Windows, you can use TFTPD32. If you don’t know how to use TFTPD32, I have a description in this article. Point your TFTP server to the directory containing your firmware file, and type the name of the file into the box containing fwr171v1-cn-up.bin below: fwupg-sm   Click the bottom left button in the dialog, and a progress bar will appear, indicating that the firmware is being loaded. Once it is done, the device will automatically reboot, and your host computer should see a new WiFi AP with SSID TP-LINK_xxxxxx, where xxxxxx are the last 6 digits of your FW171’s MAC address. This indicates that you have successfully loaded your English TP-WR702N firmware! Next, set your host computer’s Ethernet port to DHCP, and plug the FW171 into it. Your host computer will receive an IP number in the range of 192.168.0.X. Point your web browser to the TL-WR702N’s IP number 192.168.0.254, and log in with user admin, password admin. Downloads: English TL-WR702N firmware for FW171

How to Repair a Panasonic Massage Chair, Part 3

Unfortunately, my rubber hose hack from Part 2 worked only for a few weeks. The belt again stretched, and became loose:

loosebelt

One thing you can also see in the photo above is that I’ve slid the motor as far to the left as the adjusters allow (the slotted holes for the two brass screws). I couldn’t bend the motor mounts any more to tighten up the belt, so in addition to the rubber hose shim from Part 2, I wrapped 4 layers of electrical tape around each of the two pulleys:

tapedpulley

Amazingly, this increased the diameter of the pulleys enough that the belt became taut. I have tested the chair for a few hours, and this fix seems to be working well. Let’s see how long this hack holds up…

Previous related article: How to Repair a Panasonic Massage Chair, Part 2

Quickie Hack: Turn Your Bicycle Into A Party Machine

I was looking for a way to play tunes while biking the other day, and was too lazy to get out the CAD program and design something to print on my RepRap. Here’s a dirt cheap & quick hack to get some decent quality sound while riding your bike. All you need is 4 zip ties:

party1

party2

party3

party4

 

The only tricky part is that I criss-crossed the ties that attach it to the bike.. that is, I took the end of one tie and inserted it into the other tie, instead of its own end. This added some stability, and prevents the speaker from getting damaged due to rubbing against the handlebars. Be sure to rotate the speaker to the proper orientation for you to access its controls before tightening it up.

The speaker I used is a cheap Chinese fake Beats by Dr Dre speaker. I bought it on AliExpres for $13.88 including shipping from China. It’s also known as the “S11 bluetooth speaker,” and is available on eBay, as well. It has a built-in lithium-ion battery, Bluetooth connectivity, including speakerphone (the microphone is crap, though), and even has pause and track skipping buttons. It also has a cable for connecting it via a headphone jack, and even sports a microSD slot, so you can use it completely standalone. Not only is it loud, but the sound is actually better than lots of speakers I’ve tried that cost a lot more. The black model has a rubberized casing, which helps avoid damage from rough handling. It also comes in a rainbow of colors, some with metal casing, instead.

Now, I just keep my iPhone in my pocket, and pause/skip tracks using the buttons on the speaker. The speaker doesn’t have a volume control, but I can easily reach in my pocket and hit the volume buttons w/o looking at it. I took it on a 50 mile bike ride the other day, and the speaker didn’t vibrate off.

 

OpenWrt: Cross-compiling libmicrohttpd for TL-WR703N

Recently, I’ve been developing embedded webapps using node.js. Unfortunately, node.js is a bit bloated for resource-constrained platforms, such as the TL-WR703N running OpenWrt. Not only is it too large to fit into flash memory, requiring an external USB drive to run EXTROOT, but I’ve even encountered circumstances where I’ve been running out of RAM. Thus, I’ve been looking for a lean & mean HTTP library written in C. Right now, my top two candidates are axTLS and libmicrohttpd. Since it’s impractical to host a toolchain on the TL-WR703N, we have to cross-compile everything, which can be a bit of a chore to set up. The first step is to download and unpack the source code:

% wget http://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.38.tar.gz
% tar xzvf libmicrohttpd-0.9.38.tar.gz

If you don’t already have an OpenWrt toolchain set up, you can download and install it as follows:

% wget http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/OpenWrt-Toolchain-ar71xx-for-mips_r2-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2
% bzip2 -dc OpenWrt-Toolchain-ar71xx-for-mips_r2-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2 | tar xvf -

Next, we need a build script. Save the bash script below as build_libmicrohttpd_mipsbe.sh:

#!/bin/bash
#
# compile libmicrohttpd for ar71xx (mipsbe)
#

export BASEDIR=$(pwd)

### begin configuration

# node src directory
export SRCDIR=libmicrohttpd-0.9.38

#adjust STAGING_DIR and TOOLDIR below based on location of your toolchain
#ToolChain
export STAGING_DIR=${BASEDIR}/OpenWrt-Toolchain-ar71xx-for-mips_r2-gcc-4.6-linaro_uClibc-0.9.33.2/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2
#export STAGING_DIR=${BASEDIR}/openwrt/attitude_adjustment/staging_dir

export TOOLDIR=${STAGING_DIR}/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2

### end configuration

 
export TARGET_PATH=${BASEDIR}/${SRCDIR}-mipsbe
export PREFIX=${TOOLDIR}/bin/mips-openwrt-linux-
export LIBPATH=${TOOLDIR}/lib/
 
# MIPS cross-compile exports
export CC=${PREFIX}gcc
export CXX=${PREFIX}g++
export AR=${PREFIX}ar
export RANLIB=${PREFIX}ranlib
export LINK=${PREFIX}g++
export CPP="${PREFIX}gcc -E"
export STRIP=${PREFIX}strip
export OBJCOPY=${PREFIX}objcopy
export LD=${PREFIX}g++
export OBJDUMP=${PREFIX}objdump
export NM=${PREFIX}nm
export AS=${PREFIX}as
export PS1="[${PREFIX}] \w$ "
export LDFLAGS='-Wl,-rpath-link '${LIBPATH}
 
rm -rf ${TARGET_PATH}
mkdir ${TARGET_PATH}
cd ${SRCDIR}
make clean
make distclean
./configure --prefix=${TARGET_PATH} --host=mips-openwrt-linux-uclibc --without-snapshot --with-mips-float-abi=soft
make
make install

If your toolchain is in a different place from the STAGING_DIR specified in the script, adjust it to point to the proper location. Finally, execute the build script:

% sh build_libmicrohttpd_mipsbe.sh

After the build is complete, you can test it out by transferring one of the example files to your TL-WR703N running OpenWrt. A good candidate would be src/examples/fileserver_example. In addition to the executable, you also need to get the shared library onto your OpenWrt machine. It is built into a strange location: src/examples/microhttpd/.libs/libmicrohttpd.so.10. Put the file in /usr/lib/libmicrohttpd.so.10 on your target machine. Finally, you should be able to execute fileserver_example on the target machine.

TL-WR703N: Attaching USB Serial Adapters – FTDI/CP2102/PL2303/CH340G

Although the TL-WR703N has a built in UART, as I have shown in my previous article, it’s rather difficult to access, and is useful as a serial console in OpenWrt. For the support of your own apps, it is far more convenient to simply plug in a cheap USB to serial adapter — this can be done without even opening the case. Since the TL-WR703N only has one USB port, if you are using EXTROOT, both the serial adapter and the USB flash drive can be attached to a USB hub: usbserialThe TL-WR703N can easily supply the required current, so an unpowered hub may be used. To add support for USB to serial hardware, use opkg to install the appropriate modules. Basic USB to serial support:

opkg install kmod-usb-serial

FTDI (FT232) support:

opkg install kmod-usb-serial-ftdi

Silicon Laboratories CP210x (CP2102) support:

opkg install kmod-usb-serial-cp210x

Nanjin QinHeng Electronics CH341 (CH340G):

opkg install kmod-usb-serial-ch341

Prolific PL2303 support:

opkg install kmod-usb-serial-pl2303

Additionally, OpenWrt has packages for a slew of other USB serial adapters that I’m not familiar with. If you are using Attitude Adjustment (12.09) and its official repository, here are the other supported adapters:

kmod-usb-serial-ark3116 kmod-usb-serial-belkin -- Belkin
kmod-usb-serial-cypress-m8
kmod-usb-serial-ipw
kmod-usb-serial-keyspan
kmod-usb-serial-mct -- Magic Control Technology
kmod-usb-serial-mos7720
kmod-usb-serial-motorola-phone
kmod-usb-serial-oti6858
kmod-usb-serial-qualcomm
kmod-usb-serial-sierrawireless
kmod-usb-serial-ti-usb
kmod-usb-serial-visor -- Handspring Visor/Palm m50x/Sony Clie

After you install the appropriate kernel modules, your USB to serial converter will show up as /dev/ttyUSBx

[ 489.990000] usb 1-1.3: new full-speed USB device number 5 using ehci-platform
[ 490.100000] ch341 1-1.3:1.0: ch341-uart converter detected
[ 490.120000] usb 1-1.3: ch341-uart converter now attached to ttyUSB0

 

How to Repair a Panasonic Massage Chair, Part 2

In my article, How to Repair a Panasonic Massage Chair, I described how I fixed my Panasonic EP1004 massage chair. The chair worked for a year or so, and then stopped working again. The symptoms this time were a bit different from when the clutches got stuck. Instead of running for a while, and then beeping and shutting itself off, the massage mechanism stopped moving up and down. The chair was just stuck in kneading mode, and wouldn’t do anything else. +I was pretty sure the problem was due to a loose belt, but just didn’t feel like taking it apart again. Tonight, I decided it was time to get it working again. I opened it up, and sure enough, one of the belts had slackened so much that the pulleys were just freewheeling. The loose belt was the small one on the far left in the photo below:

belt

 

The belt doesn’t look loose in the photo, because I forgot to take a photo of it before tightening it up. Unfortunately, there was no adjustment left to tighten the belt. It must have stretched over it’s 15+ year lifetime. I’m pretty impressed by the quality of the of the belts in this thing. They haven’t dried up at all. If you look in the photo below, there are two screws in horizontal slots between the two pulleys. Note that the screws are all the way on the left of the slots, which means that the motor has already been slid as far as it will go to the right. Yet, the belt was still quite loose. I finally jerry rigged a fix by jamming a piece of rubber hose in between the motor and the metal box it’s attached to. To stiffen up the hose, I stuffed a wood dowel into it. The rubber hose is in the photo below, under the green/yellow wire that grounds the motor to the chassis.

beltfix

The chair is now working again… until something else goes wrong.

Previous related article: How to Repair a Panasonic Massage Chair
Next related article: How to Repair a Panasonic Massage Chair, Part 3

 

Windows 8: How to Fix Windows Update and/or Windows Defender Check for Updates Failure

I had a very irritating problem with my Acer Aspire V5 notebook computer running Microsoft Windows 8.1 for the past several months. The computer was not able to update itself. When I launched Windows Update, it would just hang forever checking for new updates, so I couldn’t even figure out what updates were needed, let alone download and install it. At the same time, Windows Defender would constantly bug me that my virus definitions needed to be updated, but every time I tried to download the updates, it would either hang forever, or fail.

After wasting many hours trying to find a solution, I finally fixed it yesterday. It turns out that the two problems were related. It seems that Windows Defender uses Windows Update as a back end to download its virus definitions, because my fix got both of them working again. So, without adieu, here is the procedure for getting your Windows Update and Windows Defender to successfully check for updates again:

Step 1: Download Windows Update Powershell Module

Open up your favorite Web Browser, and point it to:

http://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bc

Click the blue box labeled PSWindowsUpdate.zip and save the file to your computer.

(Direct download for PSWindowsUpdate.zip: http://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bc/file/41459/43/PSWindowsUpdate.zip)

Step 2: Extract files from PSWindowsUpdate.zip

Extract the files in PSWindowsUpdate.zip to %WINDIR%\System32\WindowsPowerShell\v1.0\Modules.

If you do this step correctly, in most computers, you will have a folder called C:\Windows\System32\WindowsPowerShell\v1.0\Modules\PSWindowsUpdate

Step 3: Launch Windows Power Shell with Administrator Privileges

From the Control Panel, open Administrative Tools. Right click Windows Powershell ISE, and select Run As Administrator:

Image1

Step 4: Import the PSWindowsUpdate Module

Type Import-Module PSWindowsUpdate into the PowerShell:

Image2

Step 5: Change Execution Policy

In the PowerShell, type:  Set-ExecutionPolicy RemoteSigned

PS> Set-ExecutionPolicy RemoteSigned

You will get a security warning dialog. Click the Yes button. You don’t have to worry, because we downloaded the module directly from Microsoft.

Step 6: Run Get-WUInstall

In the Powershell, type Get-WUInstall:

PS> Get-WUInstall

Answer any prompts which may come up. My system had a lot of updates pending, so I let the module download and install them all. After it’s done, your Windows Update and Windows Defender will work correctly again!

Many thanks to the people who came up with this solution. The information came from: http://social.technet.microsoft.com/Forums/windows/en-US/afc7f693-f742-402f-b513-063989b79c2f/windows-81-enterprise-windows-updates

gCode Visualization

I was working on a project today, which had some serious overhangs. I added support material manually, but needed to make sure that slic3r was traversing a usable path through my supports. Usually, I use Repetier Host‘s excellent built-in gCode visualizer, but it only displays a layer at a time, and I needed to see the actual paths followed in each layer. After searching a bit, I found an excellent online visualizer: gcode.ws:

Image3

 

It is very full featured, with sliders that let you step through your gCode layer by layer, and also line by line within a layer. Additionally, it prints out a lot of useful statistics within your gCode.

While running it in a web browser is handy, since you don’t need to install any software, sometimes, I need to have access to it when I have no Internet access. Fortunately, the visualizer is open source, and is written in javascript, so you can also run it directly from your hard drive. First, download the zip archive from github:

https://github.com/hudbrog/gCodeViewer/archive/master.zip

Unzip the archive, and simply launch index.html. I had security issues running it in Chrome, and it froze up in Internet Explorer, but Firefox runs it just fine. To run it in Chrome, you must launch it with the command line option “–allow-file-access-from-files” in order to lower the security so that it can access files locally, but it doesn’t work if you already have a running copy of Chrome.

On Windows computers, if Firefox isn’t your default browser, you can just right-click index.html, and select Open with->Firefox.

Image3

 

Many thanks to hudbrog for making this excellent tool.