Thursday, December 12, 2013

The Future of Avionics.


In the last two weeks a couple articles have hit my in box, showing me why the avionics market is about to make a huge change. The current system of all-in-one boxes is not gonna work, and we need to accept that. It is time to go component with the avionics.



The electronics in the boxes have a life. They don't really wear out, unless you believe in the smoke theory of electronics. The other parts do wear out, knobs, displays, and other mechanical parts. The manufacturers aren't making some of the components any more (chips, knobs, etc). J. Mac McClellan who writes a great blog for the EAA pointed out that the Garmin radios are starting to go obsolete. So 10 or 15 years ago, you spent $20,000 updating the panel in your airplane, and now you need a new radio. There are no slide in replacements, so do you glue on something for now, until you can afford a whole nuther panel?

Another company was mentioned in the Canard Squadron email I get where they are using Android tablets and phones for a PFD. The company is called Talos Avionics. The product is a-efis, and can be bought today! No nothing certified, but probably good enough for daily use, with steam gauges as backups. Sure why you can't use certified instruments as backups to your non-certified panel? Well, the non-certified panel is more functional.

Another project I am working on is based on the STMF429 discovery board. This board has a display, CPU, gyros and accelerometers, and costs under $25. Have a look at the picture on page 9, and how detailed the graphics are. Why couldn't a small AI or better device be built for about $100 using this technology. It would be aviation throw away ($100 hamburger range). Right now any hole in the panel will cost at least $500 to get filled. The 6 pack that IFR pilots rely on costs a minimum of $3000, could we take that cost down to under $1000, I think so.

I've been talking about doing engine monitor on Android for about 3 years, what is so hard about it. (I've had a few distractions...). There are challenges, certainly, but giving people a full time job to do this stuff, and it should be quick and easy.

Prove me wrong, until then, it is time to change the world. 




Friday, October 18, 2013

Some Vendors

A while ago, it was my son's birthday, and I thought I'd get him one of the JXD 7300's. I thought it would be better than the JXD 5110, it is bigger and I thought it would be more useful. I waited too long to order it from China, so I looked for a US vendor. I had no luck finding a US vendor. I thought I might be OK getting it express shipped. 

I ordered it on a Thursday, and paid the extra $30 for 3-5 day shipping. The device arrived 15 days later. The correspondence with the company was challenging. On Sunday they sent me a note:

Since the value for your order is a little expensive, to protect the safe of your paypal account,

we want to confirm some info from you, hope your kindly understanding.
1st,  Could you pls confirm your shipping address whether correct or not

Well I appreciate that they are worried for my safety, but $144 isn't that much, I have spent way more than that on Paypal before. I also realize it is already tomorrow in China, so my Thursday order was really Friday early morning, and the Sunday correspondence was really Monday, but follow along. I did tell them that it was me, and that I thought my Paypal account was verified. I responded on Sunday, which I am sure they got on Tuesday. Their response Monday at 2AM my time was:

May I know when do you expect to receive the parcel? then I will arrange a shipment, since normally we will ship the order within 3-7 working days.

Ok, shouldn't they expect that if I paid for 3 day shipping I might want it really soon? What is there about 3-7 working days before they ship it? Holy cow, it seems really obvious now I am not going to get the thing in time. So I decide to look for a new vendor, maybe someone in the US. I look, and there is a vendor in New Jersey who has 10 of them listed on Ebay. I decide to order the one from ebay, and try to work something out with this Chinese vendor.  

I sent the following message:

I expect to receive the device by Thursday 10/10/2013.

The response I got was:

Hi friend,
Thanks for your email.
I will ask the warehouse to ship it by Thursday, pls wait patiently.
Hope your understanding in advance.

Best regards,

This is almost comical. I want it by Thursday, so they will ship it by Thursday? Maybe they know it is yesterday here in the US, so they can ship it and it will arrive Tomorrow? By now, I've had enough, since this won't make it even the week of my son's birthday, so I am ok with cancelling the order. Remember the first message, they weren't even sure it was me, they ought to be cool with me cancelling the order. I send a note back:

I wanted it at my house on Thursday!

Can we just Cancel this order?

Wow, that seems pretty clear. I am asking, not telling, but I have things arranged, and I no longer want the unit from them. Their response is:

Hi friend,
Even though we ship it yesterday, it is impossible to arrive you in one day. It will usually will take 3-7 working days via DHL.
We will urge the warehouse to ship it in 1 day, is it OK?
Looking forward to your reply.
Best regards,

Did they ship it yesterday? Am I in a time warp? I realize they are adjusting days, and this message I got on Wednesday, I know I don't want it. I did send them a note, that I thought was pretty clear:

If you are going to ship it anyway, then it doesn't matter.

It will be late, and I will just give your company a bad review.
I'd rather you not ship it, refund my money and we both
go away disappointed.

Is this clearer? "I would rather they not ship it and refund my money". I felt that was pretty clear. They did send one more note:

Hi friend,
Thanks for your email.
We will ship it today, pls wait for a while patiently.

It arrived 9 days later. Unbelievable, did they expect me to say good things about them? What do you think, did I miss something? I've bought most of my Arduino stuff from China, and I expect those things to arrive at my house 2-3weeks after I pay for the item. This took 2 weeks using express mail! I don't get it. 

I'll share the vendors name, if you ask. 

Sunday, October 6, 2013

Starting With Android Studio

Over the summer, well at GoogleIO, Google introduced a new way to develop apps for Android, called Android Studio. Android Studio is based on IntelliJ instead of Eclipse. I've been using Eclipse for 7 years, so this change might be a challenge.

The install was really straight forward. Everything is on developer.android.com. The link about halfway down the page will have the various install packages, one for Windows, one for Mac and another for Linux. The only thing these packages don't include is the JDK.

I had a JDK6 installed on my Linux box, and was able to install without any issues. I adjusted my PATH environment variable in the bashrc file, and everything worked the second start (the first start complained about double something being created). Start.sh seems generic, but that is what they use.

Once it came up, there was the tip of the day, and then a warning that there is a new update. There wasn't anything obvious about the update, and how to get the update. I clicked on the "more info" button, and it said to go to help->Check for updates in the menu. I clicked that, and it offered "get updates and restart". The studio GUI went away for about 2 minutes, and gave me status of what is happening. Applying patch was the longest part.

Once it comes up, it starts with a prebuilt app called "My First App". Not sure what it is, but it is a place to start.

The developers page has a link to some tips. These tips offer easier ways to do some editing, and navigation using control keys like emacs and other editors.

The layout editor give an easy start, but isn't intuitive. I added a button, and it looked like it was attached top and center. When I re-sized the button, it jumped to the upper left. The proper way to re-size the button was to change the text and font. I'll have to play with that a little more, so I can figure out how to align buttons and such (assuming I have an app with many buttons).

Most of the default devices are Nexus, and generic low resolution ones. I don't think a 5.4" screen will likely come in 480x854 pixels. I created a Galaxy NoteII with a 5.5" screen at 1280x720 pixels, since that is a phone I use. It doesn't reall matter, since whatever you create will just change presentation on the different devices.

At the top of the edit area, are tabs for the editable stuff, and at the bottom are the tabs for the view. The view can be changed between "Design" and "Text". Design is the drag and drop part. Text is the place where the XML and Java are edited for the project. The java code is where the callbacks and such go. The XML is where the properties of the display is set. While much of the screen layout can be adjusted in the drag-n-drop section, sometimes certain tweaks require editing the XML.

Building is easy, pressing the build menu, and selecting make project will create a set of executables that can be used to build an APK file. The APK file must be signed with a given key. Either a self signed key, or an official key from a register can be used. To self sign an app for testing, you can use the Keytool.

Once your app is running in the emulator (and maybe on a device), the adb tool can be displayed. Selecting on the Android in the bottom part of the frame, or selecting run->debug from the top menu, will enable debugging.

This is a powerful tool. Android Studio has many options, and will take some getting used to. It may not happen the first time you use the tool, or the second time, but it will be a good tool to use.

Give it a shot!



Sunday, September 22, 2013

Samsung isn't Great


I was all excited about the Samsung infrastructure, but I see some big cracks. I've got the Galaxy NoteII and the Galaxy Note 10.1. My wife also has the Galaxy NoteII. Don't get me wrong, Samsung builds great hardware.

Samsung software is not so great! They go a real strong 90% of what someone needs. I think as long as you stay in the Samsung family, things get along. Once outside, well, that is when the trouble starts. I've never signed up for any of the Samsung services, since I was already signed up for the Google services that meet my needs.

Things like Peel, gosh what a great little app for knowing what is happening on the TV networks. Easy to program and easy to get all setup. They sent out an update (I didn't think it needed it, but I took the update, and then the IR didn't work so well on one TV. I reset up that TV, and then it worked again, but why did the update break things???

The other feature of the Notes, are the pens. Wow, how cool is that. There have been no updates to the SNote software since I got the units, and the software is almost there. The text recognition is wonderful, no training, and it was recognizing my chicken scratches almost perfect. My problem is with the text boxes. Why can't the text boxes be more automatic. They come up small, and aren't easy to resize, and don't always put spaces between words. That makes the software, close to unusable.

I use the SNotes to take written notes, and don't bother to convert to text. That removes the search capability. I say I'll get to converting the written text to either a blog post or a wiki entry for my work documents. But that will add work, and may not help long term.

I feel Samsung pollutes the systems with crapware too. The AllShareCast dongle app is probably really useful if you have an AllShareCast dongle, but I don't. Why can't they make that an optional app instead of requiring it on all devices. ChatOn, SamsungLink and SamsungPushService all seem benign, but I need to keep those things up to date, in case there are exploits in the current version. (If you want a laugh, look in the playstore for reviews of SamsungLink). Why don't they make their services compelling, rather than same or worse than what I have today.

So now Samsung releases Gear. What a bad joke! It only works with the newest Samsung devices (for now??). The NoteIII and the newest Note 10.1. Dang you mean I need to update all my hardware to use a watch that might work for a day? I don't think so. This silly watch can't be very useful, since it has a tiny screen, and can't really talk to the outside world without a tablet or phone. Battery life of 25hours, well, hmmm... I better not spend the night at a friends house unless I brought a charger. And why not a wireless charger?

Now Samsung wants to start a whole new infrastructure. They want people to look at Tizen as a replacement for Android. Cool! their apps are so good, why not have me looking at devices based on Tizen, they will be better than...a sharp stick in the eye, I guess. (where is that sarcasm tag??)

No, I think my next device will NOT be Samsung. They don't have to do much to fix things in the next year, they only need to make what they have usable. Going for the next big thing is great, if they did it great. They haven't done anything great so far, and I don't seem 'em going that way. They will continue to do things that look like they could do things great, and will continue to disappoint. Unless they actually do great things, they will start being another mediocre phone company.

Samsung will need to support current devices, and make improvements. The Note line is clearly different than any other phone/tablet available, and they can build on that by fixing the software! Samsung has a reputation of crapifying phones, and if they quit doing that going forward that would help their reputation. By removing the crap, they may have an incentive to make their apps compelling, and people will want them, and actually install them. Today, all the owners of Samsung devices are forced to have the crap preloaded, and all we want to do is remove it!

It is up to you Samsung!

Sunday, August 4, 2013

The Mask is Off By One

A common software mistake, off by one errors happen occasionally. Indexing starting at 0 instead of one, you got ten things, so the last on is 9, not 10. What about hardware, you go pins, and they are numbered, or sometimes labeled. Dang it, wouldn't you know it, the labels on the board were off by one.

If you look at those labels, you can see the ground and 3.3V labels and that is where I am connected. Trouble is, if you look on the board this shield plugs into, the labels are off by one.

Starting with the pin labeled 5.0V on the shield, that is connected to RESET on the MEGA128 board that I am using. The next pin, is labeled  3.3V, but the traces in front of it are connected to the 5V. The next pin, labeled GND but the trace in front of it is really 3.3V. See these two pictures.

I believe I may have cooked my chip. All I could get out of the code was a 0. Over and over again. I should check the other writing to make sure I am connected to the proper pins. 


I have a spare MAX31855, so I am not totally dead in the water yet. I want to connect it to the right voltage, incase it does a shutdown on over voltage, and not leak smoke only. (I never saw any smoke).

Unsoldering the chip may be possible as well.

I really am trying, I just kept fiddling with the software, until tonight when I checked the voltage. (trust me the software is monkey see monkey do. I am using the SPI library included with the Arduino code.

I am an idiot. The 50, 51, 52 ... pins at the end start with 2 ground pins. I didn't count. So it is completely wired wrong. I need to take another whack at that part before I get around to calling my chip bad.

I am blaming it on being out of hardware practice. Can you take 5 years off from something and pick it up in a weekend.

Ever be so dumb yourself?

I re-did the connections. I am, using the ICSP header for both the SCLK and MISO. I've got it connected to 3.3V and it seems to be outputting data. 0 with nothing connected and some random data when the thermocouple is connected.

I've found the Adafruit libraries for the MAX31855, and want to try them, but am out of time for tonight. I'll get to looking at them another evening when I have more time. 

Monday, July 15, 2013

Chips Are Getting Smaller

I started building with integrated circuits in about 1976. Radio Shack started carrying the 7400 series chips sometime around then. In school I had learned about half and full adders, so I knew what AND, OR and NOT gates were. I imagine they were a couple bucks each back then, but I wanted to build something. I quickly soldered up a half adder using these chips on a piece of Formica, dead bug style.

Over the years I built many projects hand soldering huge boards of chips. In high school, me and three other guys (Scott and Steve) built Don Lancasters TV Typewriter II. We etched the board our selves, but without plated through holes, ended up soldering sockets on both sides of the board (Steve pulled his hair out troubleshooting the thing, eventually removing about half the sockets, soldering the chips in, on both sides). I built many expander boards for the various computers I've had in the last 40 years.



Tonight I soldered in the MAX31855KASA chip I got as a sample a couple months ago. Fun, cool, challenging. I cleaned the heck out of the soldering iron, had to refile the tip to get it sharp enough, and it happened. The first time, I got 4 of 8 pins, the second time I got 6 of 8, and finally with some heat, I got the other two. It doesn't look pretty, but it works, and no shorts. Mass production will require solderflow, if I am to use these chips.



Yesterday and today, I did some research. Yes, the Arduino supports SPI. There is a nice SPI reference library as well. The MAX31855 only does serial out, so I connected the pins like:

   44  - IO44  - Chip Select of the 31855
   50  - MISO  - Serial out of the 31855
   52  - SCK - Serial clock input of the 31855

I used my standard color coding, that I have been doing for over 30 years:
   Blue - Ground
   Red - Vcc
   White - Signal

Then the rainbow ribbon cable is:
   Red - T+ Thermocouple +
   Orange - T- Thermocouple minus

The results look a little messy:
   

I am a little nervous that the chip is at one end of the board and the SPI is at the other end, but that is the layout of this proto board. There is only one thermocouple input in this chip, so that also disapoints me, but who knows, working in eagle, and maybe it won't matter. 

I tested the K-thermocouple that I have using a soldering iron and my vold meter. It is hard to read the voltage in the meter, but it looks like 15mv:



I haven't written the code yet, but I'd like to as soon as I can. Maybe tomorrow. 


Sunday, July 14, 2013

Amarino - Again

So I switched back to Amarino. Nothing wrong with the Andruino, in fact long term I'll probably base things off of that, I just need a GUI on the Android now, and Andruino doesn't let me do that. Code that I write for Amarino will be portable for the most part, so I should be able to write a gage module and use it for both environments.

So I rewound... I didn't go to the trouble of connecting the old PC hard disk to the new computer. I thought I would learn more if I did it the hard way. So far I think I have. Amarino isn't very flexible. The code must be hard coded for your bluetooth cards address. Finding the numeric address was a challenge. Initially when the pairing starts it displays the address, but then it changes to the name of the device. I looked in settings, thinking it might list the address there. It turns out the Amarino app has the address in the connect dialog. It took a little while, but I have it.

When I installed the ADK, it defaulted all my targets to 4.2.2. That works great on the emulator, but none of my devices are that advanced. I only have 4.1.2 on them, and some older phones have 2.3.3 or something. (If you aren't familiar with Android, the 2.x OS was pre-tablet version, but you can find some off brand tablets running 2.x, then the 3.x OS was for the early tablets, and Google quickly came up with an OS to satisfy their needs, and it only ran on tablets. The 4.x and above OS is the unified phone/tablet OS that is very current, and is more distributed, so most situations only need a new app, not a whole new OS to get almost all the latest features). The different OS targets APIs are also numbered (IE 4.1.2 is API 16, 2.3.3 is API API 10, sort of like Java versions). 

I installed the 4.0, 4.1 and 2.3 APIs so I can test things out on all my devices. This is done in the Android SDK manager app. Just a few clicks, to select what do download, and press install packages and the ADK is app updated! I didn't download the MIPs or Intel versions, thinking it would save time, and I don't really need them. The older tablets I gave the kids are MIPs based tablets, I may get a version another day for them, if I decide the app is suitable for older tablets (probably, I am not doing anything too complicated, but I don't think those devices have bluetooth).

Loading a bunch of new devices still didn't let me change targets. I had to restart Eclipse. Now I have a large collection of usable APIs. It still can't find my phone, only the emulators. It turns out I needed some new Samsung USB driver for it. I am not sure if Samsung is pushing the boundaries, or if they are being evil requiring a new driver. I'll look into that another day. I installed the app, but now touchwiz keeps crashing. I am rebooting the device, hoping whatever mess I created will get fixed.

Uh oh, now what? Well rebooting didn't fix anything, touchwiz keeps crashing. The phone is useless right now. At least the GUI. It isn't anything malicious, like a virius, just my dopey version of SensorGraph. I can use the notification bar to get to email, and that works (if there is a notification to select). Now when I exit email to go back to the home screen, when touchwiz crashes, I end up back at the email program.

Ooof, sitting here thinking about things, I think I know what I did. The SensorGraph came with an Icon defined in the original package. When I started putting the package together, it couldn't find that icon, so I created a 0byte file for it. I am guessing touchwiz is trying to draw a zero byte icon, and is getting a null pointer exception. I'll change the app to use some other icon, and then download that. It is just touchwiz, so that makes as much sense as anything.

Yes, that fixed that trouble, but now SensorGraph quit at startup. I thought it was because Amarino wasn't running. I started Amarino and connected to the board, then SensorGraph, but it still crashes. The LogCat was enabled, and I see a runtime exception, no class found at.abraxas.amarino.Amarino. It almost sounds like I don't have the amarino libs installed on the phone? Hmmm...

"With great power..." I had the amarino libs included in the build, but not in the deploy. Under the project->properties->buildpath->order and export, I had to check the box to export the amarino libraries. Now it works! Well it is connected, and well, 1 active connection. It says "hello world, sensor graph". I still need to upload the sensor graph software to the arduino. I had already loaded the code to the arduino library. Here is a screen shot of the stock MeetAndroid sketch output on the phone (random noise on analog pin 5)
Then I went and changed the sketch to read the input from the LM34 that was on the board at pin 15
It started at ambient temperatures, then I put my sweaty fingers on it, and you can see where it jumped up.

Now on to redoing my GUI work.