Tuesday, April 10, 2012

Ubuntu 12.04 on Lenovo Q150 with OCZ vertex 2 SSD and 4Gb of Memory

See my old post about about Lenovo Q150, OCZ vertex 2, 4gb of Memory and Ubuntu 11.04 installed on a SSD and using 4Gb of mem.

For ubuntu 12.04 on the Q150, I used a usbdrive flashed using "Startup Disk Creator" from ubuntu 11.10. to save the SSD from constant writes, I did not create a swap partition. I created only one partition and rely on 4Gb of real memory for all the memory needs.

Ubuntu 12.04 Desktop
This build detects all the hardware without problems, I recommend installing the nvidia drivers for better 3D and flash performance.


This new version boots faster and feels faster on the Q150 when compared to ubuntu 11.10.
I recommend the update since the install is a breeze and all hardware is setup without any fuzz. The sound, hdmi video out, wired network, wifi, a Logitech bluetooth keyboard, a usb wireless Logitech mouse, logitech usb sound bar speakers, blue-tooth dongle for the keyboard, all works great. I didn't found time to test hdmi sound out, but it should work since it worked on 11.10.


Software


I installed flash, chromium, banshee and hplip  for my wifi hp photosmart c8180 All-in-one printer using "Ubuntu Software center".

banshee and chromium


Hulu desktop

http://www.hulu.com/labs/hulu-desktop

Hulu Desktop
Dropbox and Google Music Manager


Google Music Manager 


https://play.google.com/music/listen


Select upload music, download 64 bit version, and double click on it to install it.

Also add it to startup from shutdown menu.




You can also get Google earth, chrome, gtalk plugin:

Skype

run command:
sudo apt-get install skype


Since this is so basic, I don't think there is much more to write about Ubuntu 12.04 installation and compatibility with the Q150, it all works great.



Ubuntu 12.4 install notes

Also related with install of Ubuntu 12.04 is my other post  Ubuntu 12.04 review on Lenovo Q150.

Add medibuntu repositories by running the commands below and use Software center to add the packages you need.

sudo -E wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update
sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update
sudo apt-get install app-install-data-medibuntu apport-hooks-medibuntu 
sudo apt-get install non-free-codecs ubuntu-restricted-extras libdvdcss2


For google applications add one by one, the apps will add the repositories of the apps you install.
http://www.google.com/linuxrepositories/

Flash:
sudo apt-get install flashplugin-installer

Minitube and Vlc:
sudo apt-get install minitube vlc

Links:
http://www.unixmen.com/medibuntu-repositories-available-for-ubuntu-12-04-lts-precise-pangolin-ppa/
https://bugs.launchpad.net/ubuntu/+source/minitube/+bug/921287/comments/7


For MacBookPro users


Download the mac 12.04 iso for 64 bit (for EFI boot support) and boot your mac with it, it's the easiest method.

Sensors (temps & fans)


To enable proper detection of sensors edit /etc/modules:
gksudo gedit /etc/modules

Add to this to end of file, save and reboot:
coretemp

Bug report filed to track this not being part of the stock install.
To get the Macbook fans to work properly you will need to enable the Mactel PPA and install macfanctld.
sudo add-apt-repository ppa:mactel-support/ppa
sudo apt-get update && sudo apt-get install macfanctld

For more info on macfanctld
man macfanctld

Temperature, fanspeed, environmental light and keyboard backlight can be controlled over the sysfs exported interface at /sys/devices/platform/applesmc.768/.



edit your to look like this /etc/macfanctl.conf
# Config file for macfanctl daemon
#
# Note: 0 < temp_X_floor < temp_X_ceiling
#       0 < fan_min < 6200       

fan_min: 2000

temp_avg_floor: 36
temp_avg_ceiling: 55

temp_TC0P_floor: 50
temp_TC0P_ceiling: 58

temp_TG0P_floor: 50
temp_TG0P_ceiling: 58

# Add sensors to be excluded here, separated by space, i.e.
# exclude: 1 7
# will disable reading of sensors temp1_input and temp7_input.

exclude:

# log_level values:
#   0: Startup / Exit logging only
#   1: Basic temp / fan logging
#   2: Log all sensors  

log_level: 0


Wireless card
The Broadcom driver was not installed by default, you either need to connect your MacBookPro to the internet and allow the installer to download updates while installing. Or use System->Administration->Additional Drivers to install the STA drivers.
Sometimes it won't allow you to install the Drivers from "Additional Drivers" (specially with PAE Kernel) So, you will need to install the firmware manually:
sudo apt-get install firmware-b43-installer b43-fwcutter

Then, you need to reinstall bcmwl: 
sudo apt-get install --reinstall bcmwl-kernel-source

Touchpad (bcm5974)

The touchpad works out of the box. Uncheck the "Enable mouse clicks with touchpad" checkbox under the Touchpad tab, and enable two-finger scrolling from the preference->mouse->touchpad applet. Then the touchpad will work just like in OSX. Clicking and holding with one finger and dragging with the other work like a dream. Furthermore tweaking the drag and drop time to be less may be help. 

LCD Brightness Control

(taken fromhttp://www.voria.org/forum/viewtopic.php?f=3&t=1091):

If backlight control does not work for you, follow these instructions, this also enable PowerControl for the screen using the nvidia driver to keep temp down and battery life longer:
  • Edit the file '/etc/X11/xorg.conf' and add this line into the Device section:
  • Option  "Coolbits" "1"
    Option  "RegistryDwords" "EnableBrightnessControl=1; PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerLevel=0x3; PowerMizerDefaultAC=0x3"

Mac boot startup keys

Press C during startupStart up from a bootable CD, DVD, or USB thumb drive (such as OS X install media).
Press D during startupStart up in Apple Hardware Test (AHT).
Press Option-Command-P-R until you hear startup sound a second time.Reset NVRAM
Press Option during startupStart up in Startup Manager, where you can select an OS X volume to start from. Note: Press N to make the the first bootable Network volume appear as well.
Press Eject, F12, or hold the mouse or trackpad buttonEjects any removable media, such as an optical disc.
Press N during startupAttempt to start up from a compatible network server (NetBoot).
Press T during startupStart up in Target Disk Mode.
Press Shift during startupStart up in Safe Boot mode and temporarily disable login items.
Press Command-V during startupStart up in Verbose mode.
Press Command-S during startupStart up in Single-User mode.
Press Option-N during startupStart from a NetBoot server using the default boot image.
Press Command-R during startup
Start from Lion Recovery1
1 Available on Macs that ship with OS X Lion. Some CPUs require an EFI BootROM update to support this feature


https://help.ubuntu.com/community/MacBookPro5-5/Precise
https://help.ubuntu.com/community/MacBookPro

Sunday, January 22, 2012

Ubuntu 11.10 on Lenovo Q150




Jan 22 2012: I updated the post and added instructions to describe the sound settings for HDMI using Ubuntu 11.10. This post instructions should work on 11.10 and 11.04, but I recomend using 11.10.

The Lenovo Q150 comes Atom D510 and the nvidia Ion gfx, 2GB of ram and a 250 GB HD, but mine  is running with a OCZ Vertex 2 disk and 4 Gb of memory to improve the speed.

I decided to install the 64 bit version of Ubuntu. I also installed:
  • ubuntu tweak
  • miro
  • minitube (youtube player, without flash)
  • huludesktop
  • skype
  • chromium


How to add Ubuntu-tweak

sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak

XBMC install:
# Install the nvidia drivers to be able to start xbmc, the open source drivers won't work. You can do that by going to "System Settings" and run the "Additional drivers" app on Ubuntu followed by a reboot. After this install xmbc 

sudo apt-get install xbmc
You can get all the other applications from Ubuntu Tweak or Ubuntu Software Center.
The latest version of Ubuntu contains updates to the kernel, alsa and nouveau nvidia drivers.

- The new opensource video drivers seems as fast as the proprietary drivers when playing video and this is great, but flash is a little bit faster with the nvidia drivers.
- It also detects the nvidia HDMI sound card and sound works out of the box.
- Basic installation from a USB key works fine.
- HDMI/VGA and sound out, little USB keyboard/mouse works fine.
- Dual boot with Windows 7 works fine. But since I got a SSD installed on the Q150, I removed windows.
- Video acceleration at 1080p works great for Miro, mplayer, minitube, vlc, xmbc with the opensource drivers. Sound works out of the box for xmbc, with default settings.
- Wireless card works out of the box as well as the Ethernet drivers. In the Ubuntu 10.10 and 10.04, I had some problems to get the Ethernet driver to work without a cold reboot, but now it seems to work flawless.

Problems I found:

- Flash video acceleration does not work as fast as in windows, it uses more CPU, I think this is because flash on linux does not have gfx acceleration.
- With the the nvidia opensource drivers Ubuntu sometimes freezes, this normally happens when using Unity or playing Videos. I assume this is related with 3d or video acceleration stuff since using just the browser does not seem to create problems. You need to reboot Q150 if this happens. With video nvidia drivers seems to be stable. I'm currently using the nvidia drivers.


Wake up from usb wireless keyboard

You need to enabled USB wake up, in /proc/acpi/wakeup
# cat /proc/acpi/wakeup
sudo -s
echo USB0 > /proc/acpi/wakeup
echo USB1 > /proc/acpi/wakeup
echo USB2 > /proc/acpi/wakeup
echo USB3 > /proc/acpi/wakeup
echo EUSB > /proc/acpi/wakeup

This will allow you to suspend the machine use the wireless usb keyboard to wake up.

Wake up from at certain time
# Check alarm is not step
cat /proc/driver/rtc
# clear alarm, is need before setting
sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm"
# Set alarm
sudo sh -c "echo `date -u --date "Aug 9, 2010 00:05:00" +%s` > /sys/class/rtc/rtc0/wakealarm"

# Check alarm time
cat /sys/class/rtc/rtc0/wakealarm
cat /proc/driver/rtc


How to use sound over HDMI 

If you install nvidia drivers sound should work out of the box for HDMI, the open source drivers don't support sound over hdmi. After installing the nvidia drivers and a reboot, just go to sound Preferences and select Hardware->"High Definition Audio Controller" to "Digital Stereo (HDMI) nr 4 Output", and disable the other sound devices. In my case I had to play with that setting, it looks like only one setting works for me: "Digital Stereo (HDMI) nr 4 Output". None of the others produce a sound. This was done using Ubuntu 11.10.


Older Posts

Sunday, June 19, 2011

Arduino code for Gaui 330X quad copter




I've been doing some work with arduino and GAUI 330X. In this example we controlling the throttle speed of the engines. On the 330X throttle is also used to reset and config the ESCs (4 small boards that control the power to the engines and speed).

I removed the blades and replace those with plastic circles, so I can test the code without having the 330x flying all over the place.

Since I don't own a radio/receiver, it took me a while to get the 330X configure and working.

This example, should allow you to configure the ESCs, and start the 330X, and throttle the engine up and down with the potenciometer.

One thing I didn't realize for a while is that the ESCs are the ones that beep (not the GU334), and since all four are connected to the GU3344 is difficult to configure them because they all beep at same time and are not really synchronized, so you can't really figure out what is the current state of each one.

Probably in the future, I need to figure out a easy way to configure the ESC one by one, without redoing all the wiring.

This code should be used with a potenciometer on pin analog 1.

The wires from GU334 gyroscope should connected to the arduino in the order below:
  • yellow is the rudder wire connect to pin 9
  • orange is the throttle wire connect to pin 10
  • red is the int elevator wire connect to pin 11
  • green is the gain/gear don't connect this wire
  • white is the aileron wire connect to pin 12 (this connector also has power (3 wires). Only connect the white wire to the arduino)
GU334 wires behave like servos, so you can use the servo arduino library, to control the GU334.

Just take it consideration that 90(the user is not pushing the controls) is the neutral value on the servo and 0(user pushing the controls backwards at max) is max backwards value and 180(user pushing the controls forward at max) is max forward value.




#include

int aileronPin = 12;
int rudderPin = 9;
int throttlePin = 10;
int elevatorPin = 11;
int gainPin = 8;
int potPin = 1;

Servo aileron; //White
Servo rudder; //Yellow
Servo throttle; //Orange
Servo elevator; //Red
Servo gain; //Green (Gain/Gear)

void arm(){
setSpeed(aileron, 90);
setSpeed(rudder, 90);
setSpeed(throttle, 90);
setSpeed(elevator, 90);
setSpeed(gain, 90);
delay(1000);
}

void setSpeed(Servo &s, int speed){
if (s.read() != speed) {
s.write(speed);
Serial.print(speed);
Serial.print("\n");
}
}

void setup() {
aileron.attach(aileronPin);
rudder.attach(rudderPin);
throttle.attach(throttlePin);
elevator.attach(elevatorPin);
gain.attach(gainPin);
Serial.begin(9600);
arm();
}

void loop() {
int foo = analogRead(potPin);
setSpeed(aileron,90);
setSpeed(rudder,90);
setSpeed(throttle,map(foo,0,1023,0,180));
setSpeed(rudder,90);
setSpeed(elevator,90);
setSpeed(gain,90);
delay(10);
}



NOTE: Created a library for arduino to control the Gaui 330X available here https://github.com/hagleitn/QuadCopter/

Sunday, June 5, 2011

DFU Mode Arduino UNO without soldering



I did these steps after I loaded and "empty" sketch to the board.

Code:
void setup(){}
void loop(){}
-----------------------------------------------------------------
INSTALL THE DFU PROGRAMMER (console commands)
-----------------------------------------------------------------
$ sudo aptitude install dfu-programmer

-----------------------------------------------------------------
DOWNLOAD AND VERIFY THE FIRMWARE (console commands)
-----------------------------------------------------------------
$ wget --no-check-certificate https://github.com/arduino/Arduino/raw/master/hardware/arduino/firmwares/arduino-usbserial/Arduino-usbserial-uno.hex
$ md5sum Arduino-usbserial-uno.hex
8e01ee236e70bbea43f7eb4e11c9688a Arduino-usbserial-uno.hex

-----------------------------------------------------------------
PUT ARDUINO UNO IN DFU MODE (see Picture)
-----------------------------------------------------------------
0) connect your board to the pc
1) insert 2 wires in GND pins according to the picture above
2) hold the "wire 1" on the top left 8u2 ICSP pad (AREF)
3) touch the "wire 2" against the left side of the capacitor below the RX LED (leds will blink)
4) remove the "wire 2" wire
5) remove the "wire 1" wire
NOTE: in step 3, my board actually has 2 capacitors instead of one like displayed in the picture, use the capacitor below the RX LED.

-----------------------------------------------------------------
UPLOAD THE NEW FIRMWARE (console commands)
-----------------------------------------------------------------
$ sudo dfu-programmer at90usb82 erase
$ sudo dfu-programmer at90usb82 flash Arduino-usbserial-uno.hex
$ sudo dfu-programmer at90usb82 reset

-----------------------------------------------------------------
FINAL STEP
-----------------------------------------------------------------
disconnect the board from the pc
reconnect it and you are done

NOTE: when you are done remove dfu-programmer package from Ubuntu since this package require the arduino IDE and some other tools and those versions don't work with Arduino UNO board.
Most of these instructions were copied form MementoMori posts on
http://arduino.cc/forum/index.php/topic,52447.0.html

Friday, April 8, 2011

Measure network speed between 2 machines

install

sudo apt-get install iperf


run on machine A
iperf -s

run on machine B
iperf -c IP_OF_MACHINE_A

Tuesday, March 15, 2011

Android LG optimus v factory reset

NOTE: didn't worked for me, I returned the phone in the end.

Android LG optimus v factory reset
1. Turn off your LG Optimus V.

2. Press and hold the following keys for over 5 seconds: Down volume key + Home + Power

3. When the power turns on, release these keys.

3G Drops & Standby Battery Drain (Solutions)

The steps were as follows:

* Check "Time Without a Signal": Home, Menu, Settings, About Phone, Battery Use, click "Cell Standby" and not the value. It should be close to 0% if you've been in 3G range. 50% indicates a definite problem.

To "Fix" - Note the original poster says this change will reset if you reboot the phone and need to be redone:

* Dial *#*#4636#*#* which will go to the phone's "Testing" menu.
* Click "Phone Information", then Menu, then click "Select radio band".
* Click "Force Close" and return back to "Phone Information"
* Scroll down to "Set preferred network type:"
* Click the "Set preferred network type:" button and select "CDMA only".
* Click the "Set preferred network type:" button again and reselect "CDMA auto (PRL)".

As mentioned in the link, now charge your phone to reset the battery usage statistics and after an hour or so monitor the "Time without a signal" value. The problem seems to be from an incorrect network type value that is originally set/saved despite it showing the correct value.

Some people also note that they get better battery usage with WiFi left on vs 3G. I'm not sure if this is due to this issue or not, but I'll do further tests leaving WiFi on tonight after a full recharge.

The default WiFi "Sleep Policy" on the Optimus V is set to turn WiFi off "When screen turns off". If WiFi is truely better, then one would need to set this to "Never". (Note on some other phones WiFi defaults to "Never" sleep.) To change the setting:

* Home, Menu, Settings, Wireless & Network, Wi-Fi Settings
* Click the Menu button and select "Advanced"
* Select "Wi-Fi sleep policy" and change to the desired value


Note: this information was copied from the links below for personal reference.


3G Drops & Standby Battery Drain (Solutions)
http://androidforums.com/lg-optimus-v/293583-3g-drops-standby-battery-drain-solutions.html

LG Optimus V Factory Reset
http://www.lg-phones.org/lg-optimus-v-factory-reset.html

Setting dns over TLS on ubuntu 26.04 using quad9 and

With this change future dns queries should got to Quad9 and fallback Cloudflare if Quad9 has a outage, and should go over TLS.  Change /etc/...