Thursday, February 21, 2019

MacBook battery replacement requires calibration

A few years ago I bought a second hand Mid 2010 MacBook Air 11 as a standby machine. It came with a dead battery. A cheap Chinese replacement was purchased via eBay but while the battery life was usable (for reading the news over breakfast) it would warn that it was going to shut down after about two hours. Shown here in activity monitor.



I did what they advised in that I charged it up and then used it until it warned me on the first cycle.

The battery actually reported that it had more than the design capacity and I figured this was a lie.


Figuring I'd bought a low capacity battery pretending to have more mAh than it really did, I ordered a new one from a reputable dealer, iFixit Australia.

While waiting for the new battery to arrive I read up on battery manager calibration and this time did the following:

  • Fully charged the battery over night
  • Ran the laptop with screen and disk never sleeping, also no screen dimming (Energy saver)
  • Left it like that to run until it shut itself down
  • Left it another 5 hours to really go flat
  • Fully charged it over night
Interestingly as it discharged there was a long flat part of the charge graph before it actually turned off.


After this exercise, the battery had much better life, perhaps five or six hours of heavy use.

The new battery turned up and I figured I might as well put it in to see if it's better. Replacing the battery in an old MacBook Air is pretty easy if you have the pentalobe screwdrivers.



Interestingly, it reports less capacity in CoconutBattery and the Chinese import.


I again followed the calibration process outlined above and this time, just for fun, I ran a bash script to record screen shots for a movie.


For my own future reference, create a folder on the Desktop called "ScreenRecord" and run this command line to capture screen shots periodically:

while [ 1 ];do vardate=$(date +%d\-%m\-%Y\_%H.%M.%S); screencapture -t jpg -x ~/Desktop/ScreenRecord/$vardate.jpg; sleep 1; done


To make the folder full of jpeg images into a movie I used ffmpeg:

ffmpeg -r 24 -pattern_type glob -i '*.jpg' out.mp4

(-r is the frame rate).

Measuring real world battery life is not easy as load varies wildly. I think the new battery is slightly better than the old one after calibration, but I wish I had done this earlier and saved my money.

Friday, February 15, 2019

Pi-Star hotspot getting started

The hotspot board I ordered via eBay for AU$60 arrived (I note the price has increased recently). It turns out to be labeled a Jumbo Spot rev 1.6. I already had the Raspberry Pi Zero but the other parts came as shown here.


The metal box is very solid, the board is good quality and the OLED display was already soldered in place. There was some soldering in that the pin headers for attaching to the Pi had to be soldered on to the Pi Zero board.

The Pi-Star software was downloaded from here and copied to the microSD card using Etcher on macOS.

Because I hadn't read enough documentation, I fired it up connected to a monitor and keyboard and attempted to get it on to my Wifi via the command line. (Don't do this).


The right way to get started is to let it boot and after a minute or so it creates a Wifi network called "pi-star-setup". On a computer, join that wifi network and go to http://pi-star.local and you log in with username pi-star and password raspberry to do the configuration via a web interface. Here you can tell it about your wifi network and then let it join. After that, go back to your own network and again visit it via http://pi-star.local.

Jumbo Spot isn't in the radio/modem type popup so I used MMDVM_HS_Hat (DB9MAT & DF2ET) for Pi GPIO and that appears to work.

DMR Master is set to DMR+_IPSC2-AUS-2 with options "TS2_1=505;TS2_2=3802;TS2_3=3803;TS2_4=3804;TS1_1=13;TS1_2=113;TS1_3=123". These settings derived from VK7HSE in the Pi-Star forum. I am seeing traffic and can see myself transmit.

There's a good tutorial on setting up Pi-Star configuration on Amateur Radio Notes here.

All boxed up now and it looks like a solid bit of gear.


I set it to the frequency which was already in a code plug I used in my TYT MD-380. I can see a bit of activity on the web interface.


Range seems excellent, it certainly covers the house without any problems. I'm still figuring this thing out but so far it seems good.

I've had a few brief contacts on talk group 505 slot 2 but often can see that a station is there but not hear them.

Updated firmware to 1.4.14

Following the instructions from hvdn.org I've just updated the Jumbo Spot firmware from v1.3.3 to 1.4.14. So far so good and very easy to update.

Here's a VK4 talking to a VK3. I'm in VK2 via this Jumbo Spot.


There is a page for the IPSC2-AUS-2 network which my hot spot is connected to here.

Tuesday, February 05, 2019

TYT MD-380 DMR getting started in Sydney

The DMR radio I ordered for AU$127 just days ago arrived today. I thought this would be a place to leave notes for myself that might help others as it's pretty mystifying to get started with.

For the price it's a very solid feeling radio. Heavy in the hand (in a good way), with a good keyboard and knobs. It came with the USB programming cable - I didn't know this and ordered one at the same time. The charging dock is solid and the little power adapter came with an Australian plug adapter. Two antennas, a small stubby one and a slightly larger one that the manual says works better. On UHF the full size one is quite compact anyway.

MD-380 doesn't turn on! Turning on the power and nothing. Charged for an hour, still nothing... it turns out that there was a piece of tape between the battery and the radio so I had to remove the battery and peel it off to turn on the radio. All good.

I registered my callsign for a DMR ID at https://www.radioid.net/ note that you need to upload a copy of your license.

From the recent talk at ARNSW, I learned that I'd need to download a "codeplug" file, edit it to put in my DMR ID number and send it to the radio.

The vk2kvp/md380-codeplug was downloaded as a zip and the file "MD380-90_All_AU_DMR+analog+CB_v15.rdt" was extracted out of that.

A TYT Code Plug Editor was downloaded from Milor.com and it opened the .rdt file extracted from the vk2kvp zip. I put in my callsign, my DMR ID (5050184) and saved the file. It warns about passwords being set but I checked and they were blank.

Finally, I opened the codeplug (.rdt) file with TyMD380tools and sent it to the radio. Update, I've now realised that the code plug editor can directly send to the radio, very nice.



I know from earlier experiments with an RTL-SDR that I can hear the Sydney repeater VK2RCG so I went in to zones and chose that one.

Initial Observations


  • The colour screen is low resolution and even short callsigns have to scroll to be read.
  • The large icons on screen take up space, I wonder if they can be reduced?
  • My screen backlight stayed on until I changed it in Menu, Utilities, Radio Settings, Backlight.
  • When the backlight is off, the screen is completely unreadable.

Useful links


First contact

After hearing nothing all afternoon and calling on Talk Group 9, which I thought was the local TG, I asked for help in the Facebook group. It turns out that the Sydney repeater is off the internet. Les suggested Talk Group 505 Slot 2. I called and got a reply from VK2RF who said I was showing up as unknown ID.

I guess that because my ID is new it hasn't been added by other users yet.

Audio sounded good and I'm now thinking that a hotspot might be the way to go as the only repeater I can hear is off line.

The Facebook group is a great source of info. The reason why I wasn't hearing much is that pretty much all the local repeaters are currently down and the one I can hear is off the internet.


My thanks to Glenn, Les, Pete, Bruce, Bevan and Denis for their help.

Ordered a hot spot

I've ordered an MMDVM Hotspot for AU$60 (I have a spare raspberry Pi already). This seems like the way to go as all the local repeaters are currently down of off the internet. It will take a few weeks to come from China and I'll report the experience here.

The OpenSPOT2 looks tempting but I quite enjoy Linux tinkering and the Pi-Star software for the MMDVM hotspots is being actively updated and looks amazing.

Talked with Les VK4TB

I successfully sent Les a text message via TG505 and then he suggested we have a talk on TG3809 Slot 1. This wasn't in my code plug so I've added it (I got the name wrong saying QLD) but anyhow we were able to talk between Sydney and Brisbane quite well as you'll see here.


I have now flashed the firmware to the "enhanced" version. I was unable to do this under windows as the program just crashed each time I hit flash.

Mine had Firmware version D014.004 and CP Vers V01.37. This seems pretty recent but it looks like updates are available from TYT. Including "MD-380_390 FOR USA" dated 2019-01-07. I have not tried this.

Flashing the firmware worked smoothly on Ubuntu Linux following the excellent instructions from the author Travis Goodspeed here.

The new firmware has a number or worthwhile enhancements including showing the name and info about the person talking:


When no one is talking, you can configure to see lots of useful info including the time slot and talk group (without having to wait for it to scroll into view) and down below is the last call heard.


Nice code plug editor for Linux - editcp

There's a great code plug editor for Linux called editcp by Dale Farnsworth. The binary installed as advertised on Ubuntu and works well.


The UI, built with qt, is superior to the Windows program I've been using as you can drag to re-order items in the lists. One slightly concerning thing is the warnings about fields with illegal values that I get each time I save or go to send to the radio.


Despite this warning all seems well and I've grabbed the code plug (terrible name for settings) from the radio, edited various things, and sent back to the radio where all works nicely.