Skip to main content

Posts

Golang modules - everything, even your application, is a module

I’m new to golang modules . Here are some of the things that I wish I had known when I started using them. There is no reason to set GOPATH One of the things I struggled with was how to reconcile modules with the single workspace directory recommended in the golang docs and what was previously where GOPATH would point. With go modules you wouldn’t normally set GOPATH. Everything is a module Everything is a module. Even your application. This is something not immediately obvious or mentioned anywhere. Every module has to have a name If you aren’t planning to import or share your application/package then you can use a non-repository name like myapp . When you initialize go modules you can do: go mod init myapp If you’d like to share this as a module you’ll want to use its web location instead like: go mod init github.com/user/repo Packages need to be fully qualified If you had a subdirectory of your application called mypackage then you’ll have to adjust your impo...

Graco Swing By Me - Battery to AC wall adapter modification

If you have one of these Graco battery powered swings you are probably familiar with the cost of C batteries! The swing takes four of them and they only last a handful of days. I'm not sure if the newer models support being plugged into the wall but ours didn't. If you are a little familiar with electronics and soldering, here is a rough guide on how you can modify yours to plug in! I wasn't sure how exactly to disassemble the swing side where the batteries were. I was able to open up the clamshell a bit but throughout this mod I was unable to determine how to fully separate the pieces. I suspect that there is some kind of a slip plate on the moving arm portion. The two parts of the plastic are assembled and the moving arm portion with the slip plate is slid onto the shaft. Because of the tension in that slip plate it doesn't want to back away, and because of the mechanicals that portion of the assembly doesn't appear accessible in order to free it. I was...

Oscilloscope assisted debugging

Concept External test equipment is a powerful but often overlooked tool for debugging particular kinds of software problems. In particular, test equipment like oscilloscopes and logic analyzers are well suited to investigating timing related issues on embedded systems. Why is test equipment suited to helping with issues related to timing? Oscilloscopes and logic analyzers can easily provide microsecond or better measurements and, unlike software based monitoring approaches, they aren't affected by other software running on the system. Embedded systems are ideal for this approach as they both provide the io outputs required for timing measurement, and often lack the advanced debugging facilities found in desktop/laptop processors and operating systems that would make this approach less necessary. At the conclusion of  debugging some 1-Wire bus contention issues  I was still seeing CRC errors reported periodically. Here is how I used an oscilloscope to track down the lik...

Bus contention on a 1-wire bus

Background I've been playing around with the Maxim  DS18B20 digital temperature sensor. These are neat devices that provide a digital temperature, which means they provide an actual Celsius reading in digital form, with a pretty high level of accuracy, +/- 0.5C from -10C to 85C. They are also quite compact. Here is the typical TO92-3 form factor that the DS18B20 comes in. Why not a thermistor connected to an ADC? Your microprocessor may not have an accurate enough or linear enough ADC to let you attain the desired temperature accuracy. In my case I'm using the Espressif ESP32 . The ESP32 is a great processor but its ADC still needs some work . Code to linearize the ADC results was added earlier this year but the biggest missing piece is proper calibration of the ADCs vref. Without this the scaling of ADC values can vary by several percent. Good news is that factory calibration is possible and should be coming. Thermistors also have a non-linear resist...

Designing and building a workbench

We have a stack of lumber, copper pipe, and trim that has been on the basement floor in our last house and that we moved over to our new house. It's tough to keep the material organized, the pipes, trim and lumber is stacked together and tough to get at. It's not an effective use of floor space and the lumber and pipes are quite long, some of the pieces are 10' long. If I built a 10' long workbench I could store the material below it, either on the floor or shelves, and it would provide space to work on projects and storage space for a chop saw and other tools. I've used Tinkercad to make some 3D mockups for work projects before and it worked pretty well. Tinkercad can be used to create designs for 3D printing but in this case I used it to visualize the workbench and determine how to construct it. 3D model Here is the 3D design that you can view, duplicate, and edit. The dimensions of the lumber in the model should be correct. Note that the scale is...

Tesla appears to be actively limiting the performance of their cars - Update: Tesla has confirmed and backed away

Tesla owners have noticed a change in the behavior of their cars, specifically in the performance models such as the P85 and the P90DL, where the performance of the cars doesn't seem to match previous or listed results. User wk057 has done some pretty extensive reverse engineering, modifications, and looking into the internal systems of the car, including the battery pack. On TeslaMotorsClub what started as a thread about battery pack capacities not matching advertized amounts, rated amount of available energy doesn't even match the car's own reported energy , turned into a thread called Pack Performance and Launch Mode Limits . This thread has kicked off a bit of a firestorm as these performance limits weren't documented or disclosed. It appears pretty clear that Tesla is counting the number of Launches (done through launch mode), as well as the number of Wide Open Throttle (WoT) events. When those counts go beyond some predefined values the car will reduce the am...

Travelling on Spirit airlines out of Boston Logan airport? Here are some tips.

I attended CES 2017 in Las Vegas. Booking the trip late I ended up on Spirit airlines. It was both non-stop, making it six hours to Las Vegas from Boston, and affordable, less than $300 for a one way trip compared to around $700 with JetBlue. Here are some tips that might help you when travelling on Spirit from Boston Logan airport. Eat Spirit is located in the B-terminal, gates B-37 and 38, with its own TSA security checkpoint. While it does have restrooms and places to sit the food selection is limited to a single food stand. I'd recommend eating at the Legal C Bar (number 77 in the image below) prior to going through the terminal security checkpoint. The food and service there were great. Drink The water and other drinks are cheaper if you buy them at the food cart rather than on the flight. Seats The seats on Spirit don't recline. They do this to reduce weight, seat cost, seat maintenance costs, and so seats don't impact the free space of other passengers,...