protected void onStart()
    {
        // reader = new RandomTickReader();
        // reader.addListener(estimator);
        // try
        // {
        // reader.start();
        // } catch(Exception e1)
        // {
        // }

        if(reader == null)
        {
            try
            {
                String port = prefs.get(PREF_PORT, null);
                if(port == null)
                {
                    // Port not set, try to find it automatically
                    String ports[] = SerialReader.getPorts();
                    if(ports == null || ports.length == 0)
                        throw new Exception("Device not connected!");
                    else if(ports.length > 1)
                    {
                        JComboBox<String> choices = new JComboBox<String>(ports);
                        JOptionPane.showMessageDialog(frame, choices, "Select USB port", JOptionPane.PLAIN_MESSAGE);
                        port = (String) choices.getSelectedItem();
                    } else
                        port = ports[0];
                }
                reader = new SerialReader(port);
                reader.addListener(estimator);
                reader.start();
            } catch(Exception e)
            {
                reader = null;
                JOptionPane.showMessageDialog(frame, "Error:\n" + e.getMessage(), "ERROR", JOptionPane.ERROR_MESSAGE);
                log.log(Level.WARNING, "Error creating reader", e);
                return;
            }
        }

        estimator.start();
        updateButtonsAndColors();
    }