Jack Crossfire's blog View Details
Archive for March, 2015
Posted by Jack Crossfire | Mar 29, 2015 @ 11:52 PM | 5,061 Views
So the very last attempt before going to sleep got GPS to go again. Some
years ago, Google dropped support for the LocationManager & switched to the
FusedLocationApi, which was far more complex. The general idea is in this
incomplete Main class:


Code:
public class Main implements 
	OnConnectionFailedListener, 
	ConnectionCallbacks, 
	GoogleApiClient.ConnectionCallbacks, 
	GoogleApiClient.OnConnectionFailedListener,
	LocationListener, 
	GpsStatus.Listener
{
	
	public GoogleApiClient mGoogleApiClient;

// start GPS
	void init()
	{
                mGoogleApiClient = new GoogleApiClient.Builder(this)
                        .addConnectionCallbacks(this)
                        .addOnConnectionFailedListener(this)
                        .addApi(LocationServices.API)
                        .build();

                mGoogleApiClient.connect();
	}


// get location immediately
	void polling()
	{
            if(mGoogleApiClient.isConnected())
			{
				Location location = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
			}
	}

// manually stop GPS
	void close()
	{
                LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient,
                        this);
                mGoogleApiClient.disconnect();
	}


// callbacks from the location API
	@Override
	public void onConnected(Bundle connectionHint) {
// Only getting 1hz
        final int locationInterval = 1000;

        LocationRequest mLocationRequest=new LocationRequest();
        mLocationRequest.setInterval(locationInterval);
        mLocationRequest.setFastestInterval(locationInterval);
        mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);


        LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient,
                mLocationRequest,
                this);
	}

	@Override
	public void onGpsStatusChanged(int event) {
	
	}

// callback when location is ready.  This is more efficient than polling, but 
// doesn't happen at a known time
	@Override
	public void onLocationChanged(Location location) {
	}
}

Another step backward & another step forward. If anyone can make a serial
port require 2 API's & 10 million lines of code, it's the Goog.
Posted by Jack Crossfire | Mar 28, 2015 @ 10:45 PM | 5,039 Views
After several uneventful years, Android GPS stopped working again. The problem initially appeared to be a failure of the app to stay on when the phone was blank. Then it was narrowed down to the GPS module shutting down when the phone was blank. It was further narrowed down to not involving the SDK, IDE, or any settings.

It was further narrowed down to the module not shutting down but entering a mode where it continued reporting locations, but much less accurately when the screen was blank. Each location was very close to the final real location, but slightly moved towards the current location.

The issue 1st appeared after running 13 miles with it. After leaving a Target store, it stopped recording the current position when the screen went blank. The issue now appears like 1 of those cases of putting your thumb on a trace to make a circuit work. In this case, the proverbial thumb would be the screen being on.

The timing of it all agrees with yet another salt water intrusion. These phones are now $30, so there wasn't much concern for protecting it. They're cheaper than buying a standalone GPS module. GPS recording still works with the old battery sucking, unreliable bluetooth hack:

https://www.rcgroups.com/forums/show....php?t=2227978

There's another matching phone at the day job that no-one uses, but success varies when changing phones with the same plan.



The innards continue on their way down to a single chip on board.


A contact covered in goo being used to enhance connectivity, but no salt. Wiped the goo off, which did nothing. There were many pads for missing components, near all the antennas.


The other side was a bare sheet of nothing.
Posted by Jack Crossfire | Mar 26, 2015 @ 11:00 PM | 4,699 Views
In what has become an annual ritual, Wednesday was pilot suicide day. Now that Egyptian, Malaysian, & German pilots have killed themselves by crashing their planes, the question is who will kill himself next year?

Easy enough to say humans should be taken out of the loop & there shouldn't be a crew of any kind, but it's yet another case of humans now being unfit to do something they did successfully, 50 years ago, like marriage & politics.

Hard to say there are any more people with mental health issues on the street, than 30 years ago. There could be a zombie invasion.
Posted by Jack Crossfire | Mar 19, 2015 @ 10:39 PM | 5,868 Views
Are you finding millenials to speak a completely unintelligible language?

"On CSI: Cyber, Uber Is the Perfect Vehicle for Dad Sadness Murder"
"The Government Is Testing Myriad Invasive Biometric Surveillance Methods"
"Tag Heuer and Intel Are to Challenge the Apple Watch"
"Mall Cops Catfished Black Lives Matter Activists on Facebook"
Posted by Jack Crossfire | Mar 19, 2015 @ 12:14 AM | 5,140 Views

The next generation of travel fan was finished. While many ideas for a shroud emerged, it still ended up the same as last year. The tripod mounting was much smaller than last year. The maximum power was reduced to 1/4, to make it suitable for indoor use.



The best idea for a shroud would not fit in a suitcase, but be suitable near a pool.
Posted by Jack Crossfire | Mar 16, 2015 @ 10:58 PM | 6,122 Views


Motor Noise comparison (0 min 46 sec)


3 ESCs were compared to find the least noise. None were as silent as a household fan, but SimonK at 18khz was the quietest.

After debating the issue all day, decided to go with the original plan of installing SimonK firmware.




An hour of intricate soldering attached a programming header directly to the Atmega8 SCK, MOSI, MISO, RESET. It had the same pinout as the Atmega328. This was a SuperSimple 15-18A from 2007, predating Arduino by many years. Atmel had yet to even label it as an Atmega.

The firmware was on https://github.com/sim-/tgy

Making the particular image required make tp.hex. There was also a tp_8khz.hex target, which generated 8khz PWM. tp.hex generated 18khz PWM. Installation used the Arduino as ISP sketch, using:

/amazon/root/arduino.heroine/hardware/tools/avr/bin/avrdude -C/amazon/root/arduino.heroine/hardware/tools/avr/etc/avrdude.conf -v -patmega8 -cstk500v1 -P/dev/ttyACM0 -b19200 -Uflash:w:tp.hex:i -Ulock:w:0x0F:m

The motor was now quieter than all the others, even at 19V. 19V at minimum throttle previously made the loudest squeel. There was still a slight wine from commutation, but the squeel was gone. It was quieter than the Castle Creation 35, which was rated at 32khz. The Castle still squeeled at 32khz, probably due to a bug.

There was a nugget on http://majek.mamy.to/en/hobbyking-su...monk-firmware/ about the tp.hex image containing a bootloader, but it required some fuse mangling & yet another Arduino sketch.
Posted by Jack Crossfire | Mar 15, 2015 @ 02:55 AM | 6,691 Views
For all the 3D printers which you absolutely must buy, there is but 1 printer which has never improved or gone anywhere but up in price: the kind which prints on paper. More specifically, the 44" inkjet. They were $3000, 10 years ago. Now, they're $5000. To this day, they still dry out if not used every week. The refills cost hundreds in the old days & thousands now.

With all the advances in technology that we're told are packed into the 3D printer, absolutely none of it has benefited the inkjet. Hacks of inkjets only amount to reusing the x-y table, making the print head squirt something besides ink, but never expanding the form factor. There is still no consumer offering which can print on 44" paper & no-one has ever hacked an inkjet to do it.

Your best bet is based on a plotter, but it would be glacially slow at printing anything near photo quality, if it ever did. It takes very high resolution to achieve any kind of color gradient.

The Goog found some guy who built a 1 pin dot matrix printer, years ago. http://www.sentex.net/~mwandel/tech/printer.html We seemed to have common interests, over the years. It's amazing how primitive everything in the 1980's looks today. In the mind's eye, the 1980's look as new as today.
Posted by Jack Crossfire | Mar 14, 2015 @ 02:54 AM | 6,003 Views
Built a simple test board for a 2nd ATmega & it worked perfectly. The Arduino ISP sketch required no changes. Getting the bootloader to work was the last straw. Many configuration parameters were missing from boards.txt.

Getting the required reset pin required pulling out the ATmega from the UNO & using the UNO as a serial port. Would never write a bootloader which required connecting the reset pin. This required a 2nd ribbon cable, different from the cable used to program the bootloader. The bootloader ended up not being worth it.

Found the verbose options in the Arduino preferences, which would reveal how to do everything on the command line. Made up a makefile which could compile an old time C program, upload it using Arduino as ISP, set the fuse bits & everything.
/amazon/root/arduino.heroine/hardware/tools/avr/bin/avr-gcc -O2 -mmcu=atmega328p -o fan3.o fan3.c


/amazon/root/arduino.heroine/hardware/tools/avr/bin/avr-gcc -O2 -mmcu=atmega328p -Wl,--section-start=.text=0x0000 -nostdlib -o fan3.elf fan3.o


/amazon/root/arduino.heroine/hardware/tools/avr/bin/avr-objcopy -j .text -j .data -O ihex fan3.elf fan3.hex



/amazon/root/arduino.heroine/hardware/tools/avr/bin/avrdude -C/amazon/root/arduino.heroine/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/ttyACM0 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xE2:m
/amazon/root/arduino.heroine/hardware/tools/avr/bin/avrdude -C/amazon/root/
...Continue Reading
Posted by Jack Crossfire | Mar 09, 2015 @ 11:38 PM | 6,038 Views
2 weeks ago, an apartment in the city was $5000. Now, it's $7000. 5 years ago, the stock market was 10,000. Now, it's 20,000. Last year, a house in Palo Alto was $1,000,000. Now, it's $4,000,000. From this standpoint, $15,000 is not a lot of money.

Though a meaningless amount, the $15,000 tag should keep it out of competition with the thousands of fitness tracking startups. There's still at least 1 guy whose home equity isn't doubling every second & who still needs to pick $200 over $15,000.

From half an hour scrolling through long & informationless web pages of computer renderings of nothing, it's clear their market is men buying status symbols for their girlfriends. That segment is a lot more alive now than it was 20 years ago. But say you just sold your $5,000,000 condo. Why not drop a day worth of property tax on a $15,000 watch?

It's also clear the middle class is pulling away from the rest of us. The top 1% is the new middle class. That's what the 1st $1000 phones felt like, when they arrived years ago.
Posted by Jack Crossfire | Mar 08, 2015 @ 10:45 PM | 5,738 Views









A week of commutes yielded the standalone Atmega board, but it didn't take a program. The Arduino ISP generated all the right signals, sending 0xac 0x53 0x00 0x00 to enter programming mode, but the Atmega stood silent.

Getting this far was a bit harder than the marketing. 1st, most Arduino UNO's end up in a drawer, never to be seen again. The remaneder get used in a project which is never finished or turned on once & put away. Almost never is a project converted to a standalone board.

There is the standard guide http://arduino.cc/en/Tutorial/ArduinoToBreadboard

Since every version of the Arduino IDE is different, the guide is almost useless. The Breadboard1-5-x.zip file needed to be decompressed directly into the arduino-1.6.0/hardware directory. Then the hardware/breadboard/avr/boards.txt file needed a very cryptic line:

atmega328bb.bootloader.tool=arduino:avrdude

Flashing a bootloader would 1st require installing the examples->ArduinoISP sketch on the UNO. That required having "Arduino UNO" as the board, "ArduinoISP" as the programmer. Open the serial monitor, set baud rate 19200 & send 1[space] to verify the ArduinoISP is running.

Then change the programmer to "Arduino as ISP" change the board to "Atmega 328 on a breadboard" & select tools->"burn bootloader". That invoked the ArduinoISP sketch properly. It generated all the right signals, but the target Atmega didn't send anything on MISO or even put it in output mode.

Tried slowing down the ArduinoISP to 32khz by changing CLKPR, increasing the delays to 1 second in start_pmode, connecting all the GND & Vcc on the target. It was still dead.

The next step would be making an Atmega breakout board just for programming the qfp32 package, with room for trying a crystal & serial port. Using a tried & true PIC or stm32 is a lot more productive than starting a new microcontroller.
Posted by Jack Crossfire | Mar 04, 2015 @ 12:05 AM | 6,291 Views