dinsdag 31 mei 2011

unable to find valid certification path to requested target

This was the complete exception I encountered trying to post data to a https connection.

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

I eventually found a lot of information on how to bypass or fix this issue. A quick fix is to implement a TrustManager accepting everything like this:

import java.security.cert.X509Certificate;

    import javax.net.ssl.HostnameVerifier;
    import javax.net.ssl.HttpsURLConnection;
    import javax.net.ssl.SSLContext;
    import javax.net.ssl.SSLSession;
    import javax.net.ssl.TrustManager;
    import javax.net.ssl.X509TrustManager;

    // Create a trust manager that does not validate certificate chains
    TrustManager[] trustAllCerts = new TrustManager[] {
        new X509TrustManager() {
            public X509Certificate[] getAcceptedIssuers() {
                return null;
            }
 
            public void checkClientTrusted(X509Certificate[] certs, String authType) {
                // Trust always
            }
 
            public void checkServerTrusted(X509Certificate[] certs, String authType) {
                // Trust always
            }
        }
    };
 
    // Install the all-trusting trust manager
    SSLContext sc = SSLContext.getInstance("SSL");
    // Create empty HostnameVerifier
    HostnameVerifier hv = new HostnameVerifier() {
  public boolean verify(String arg0, SSLSession arg1) {
   return true;
  }
    };

    sc.init(null, trustAllCerts, new java.security.SecureRandom());
    HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
    HttpsURLConnection.setDefaultHostnameVerifier(hv);

A better solution is to add the required certificate to your keystore. For more information on these solutions check this info.

I also found this rather outdated discussion. The linked utility is no longer available but it might be useful to read through the comments.

Android presentation

Again I got the opportunity to speak at an evening session. This time I talked about Android.

Download Android presentation (PDF/13MB)

The presentation exists of 2 parts. The first part being a general introduction to Android as a mobile operation system. Talking about it's history, future, features, ...

The second part is more technical about development for the Android platform. Still on a high level limited to the SDK parts you will encounter creating a simple first application.

woensdag 11 mei 2011

Trim your RC aircraft

To begin with an overview of the available airplane control surfaces that need to be trimmed to get a proper level flight without any stick input:


If you trim make sure to get several mistakes high and trim for a normal level flight with for instance 50% throttle to begin with. If you have a programmable radio you can trim other scenario's also like slow speed etc. But changing throttle will absolutely change effect of all controls so it's important to keep that steady.

Another tip for beginners is to make sure that all controls are centered on both the radio (check trim buttons!) and the model before you fly.

This is a clear list on how to trim your airplane.


 TRIM FEATURE   FLYING MANEUVERS   OBSERVATIONS CORRECTIONS  
Control CenteringFly general circles and random 
maneuvers.
Try for hands off, straight 
and level flight.
Readjust linkages so Tx 
trims are centered.
Control ThrowsRandom maneuvers.A. Too sensitive. 
B. Insufficient control.
A. Change linkage to 
reduce throws. 
B. Change linkage to 
increase throws.
Engine Thrust Angle1. From fast straight flight, cut throttle. 
2. With throttle on, pull to vertical flight.
1A. Aircraft continues straight flight for a short distance. 
1B. Plane pitches nose up. 
1C. Plane pitches nose down.
2A. Plane tends to yaw right
2B. Plane tends to yaw left
1A. Thrust angle is OK. 
1B. Decrease downthrust. 
1C. Increase downthrust.
2A. Add leftthrust.
2B. Add rightthrust.
Center of Gravity 
Longitudinal Balance
From level flight at low throttle and in trim, push the nose to 45 dive and neutralize controls.A. Plane continues in dive for  a short distance, and gradually pulls out. 
B. Nose pitches up abruptly. 
C. Nose pitches down more (tucks under). 
A. CG is good. 
B. Add nose weight.
C. Remove nose weight.
Split Elevators 
Yaw and CG
Into wind, Pull open loops using only elevator. Repeat test with outside loops to inverted entry.A. Wings are level throughout. 
B. Plane tends to left when right side up, and to right when inverted. 
C. Planes tends toward right when right side up and left when inverted. 
D. Plane goes left, right side up and inverted. 
E. Plane goes right, right side up and inverted. 
A. Trim is fine. 
B. Add right rudder, or weight to right wing. 
C. Add left rudder, or weight to left wing. 
D. Raise right half of elevator, or lower left half of elevator. 
E. Raise left half of elevator, or lower right half of elevator.
Yaw2Into wind, do open loops, using only elevator. Repeat tests using outside loops from inverted entry.A. Wings are level throughout. 
B. Yaws to right in both inside and outside loops. 
C. Yaws to left in both inside and outside loops. 
D. Yaws to  right on inside loops, and left on outside loops. 
E. Yaws to left on inside loops, and right on outside loops.
A. Trim is correct. 
B. Add left rudder trim. 
C. Add right rudder trim. 
D. Add left aileron trim. 
E. Add right aileron trim.
Lateral BalanceInto wind, do tight inside loops, or pull to straight up flight into hammerheads. Repeat test from inverted entry.A. Wings stay level and plane falls randomly in each direction from hammerheads. 
B. Falls off to left from both inside and outside loops. 
C. Falls off to right in both inside and outside loops. 
D. Falls off in opposite directions on inside and outside loops.
A. Trim is correct. 
B. Add weight to right wing. 
C. Add weight to left wing. 
D. Change Aileron trim.
Aileron Rigging.With wings level, pull to vertical  climb , and neutralize controls.A. Climb continues same path.
B. Nose tends to go to inside loop.
C. Nose tends to go to outside loop.
A. Trim is correct.
B. Raise both ailerons slightly.
C. Lower both ailerons slightly.
Wing IncidenceKnife edge flight.A. Plane tends to nose up position (as if up elevator is applied).
B. Plane tends to nose down position (as if down elevator is applied). 
A. Reduce wing incidence.
B. Increase wing incidence.
Aileron Differential.With wings level, roll repeatedly left or right.A. Model stays on heading.
B. Model yaws in direction of roll (barrel roll).
C. Model yaws opposite the direction of roll.
A. Aileron Differential is correct.
B. Too little differential (reduce down throw).
C. Too much differential (increase down throw).


source: http://www.scootworks.com/rdrc/trim.html

zondag 8 mei 2011

2212-06 2200kv Parkjet motor

This is one of the motors you'll find many scratch models for. One I would love to build some time is the polaris seaplane. Just need to find the time....

It comes with a prop adapter and a mounting plate like you can see on this picture. 


I couldn't find it for sale on hobbyking. The UK located GiantCod shop sells it though: http://www.giantcod.co.uk/221206-2200kv-brushless-outrunner-motor-p-402397.html

Specifications:
Type: A2212/06
KV (RPM/V): 2200
Voltage: 6-12V (2-3s lipo or 5-7 niCd/NiMh)
Max. Amp: 28A (60 sec. max)
Max. Efficiency.: 14-22A > 72%
No load currency: 1.4A@10V
Internal resistance: 45 mΩ
Shaft diameter: 3.17mm
Dimensions: D27.5 x L30mm
Weight: 49g. (excl. mounts)
model weight: 300-1000 gram


Included:
1 x Brushless motor
1 x Cross type motor mount
1 x Aluminium Prop Adapter
4 x Countersunk screws


Prop (max.):
2S LiPo: 7x5
3S LiPo:  5x5

Test Data:
This is a test data sheet I found on the web. I prefer running it with a 6x4 APC prop.