Nokia N900 (nokia-n900): Difference between revisions
No edit summary |
m removed this |
||
(203 intermediate revisions by 35 users not shown) | |||
Line 6: | Line 6: | ||
| imagecaption = Nokia N900 running cmus | | imagecaption = Nokia N900 running cmus | ||
| releaseyear = 2009 | | releaseyear = 2009 | ||
| originalsoftware = Maemo | | category = community | ||
| originalsoftware = Maemo | |||
| originalversion = 5 (Fremantle) (Linux 2.6.28) | |||
| pmoskernel = Mainline Linux | | pmoskernel = Mainline Linux | ||
| chipset = TI OMAP 3430 | | chipset = TI OMAP 3430 | ||
| cpu = 600 MHz Cortex-A8 | | cpu = 1x 600 MHz Cortex-A8 | ||
| gpu = PowerVR SGX530 | | gpu = PowerVR SGX530 | ||
| storage = 32 GB | | storage = 32 GB | ||
| display = 800x480 TFT resistive | | display = 800x480 TFT resistive | ||
| memory = 256 MB | | memory = 256 MB | ||
| architecture = | | architecture = armv7 | ||
| | | type = Slide-Out Keyboard Handset | ||
| whet_dhry = 58.4 | |||
| status_usbnet = Y | | status_usbnet = Y | ||
| status_flashing = | | status_flashing = N | ||
| status_touch = Y | | status_touch = Y | ||
| status_screen = Y | | status_screen = Y | ||
| status_wifi = Y | | status_wifi = Y | ||
| status_fde = Y | | status_fde = Y | ||
| status_mainline = Y | | status_mainline = Y | ||
| status_battery = | | status_battery = Y | ||
| status_3d = | | status_3d = N | ||
| status_accel = Y | | status_accel = Y | ||
| status_audio = Y | | status_audio = Y | ||
| status_bluetooth = | | status_bluetooth = N | ||
| status_camera = | | status_camera = P | ||
| status_gps = | | status_gps = Y | ||
| status_mobiledata = Y | | status_mobiledata = Y | ||
| status_sms = P | | status_emmc = Y | ||
| | | status_sms = Y | ||
| status_calls = P | |||
| status_otg = - | |||
| status_keyboard = Y | |||
| status_irtx = Y | |||
| status_sdcard = Y | |||
| status_haptics = Y | |||
| status_proximity = Y | |||
| status_light = Y | |||
| status_nfc = - | |||
| status_magnet = - | |||
| booting = yes | | booting = yes | ||
| | | status_uboot = yes | ||
| status_uboot_secondary = Y | |||
| status_uboot_mainline = Y | |||
| status_uboot_keyboard = Y | |||
| status_uboot_screen = Y | |||
| status_uboot_usbhost = - | |||
| status_uboot_usbperipheral = Y | |||
| status_uboot_sd = Y | |||
| status_uboot_internalstorage = Y | |||
| status_uboot_buttons = Y | |||
}} | }} | ||
{{Based on SoC|Texas_Instruments_OMAP_3_(OMAP3xxx)|TI OMAP 3430}} | |||
[[File:I3wm-n900.jpg|thumb|right|Running i3wm]] | [[File:I3wm-n900.jpg|thumb|right|Running i3wm]] | ||
[[File:20170724 0002.jpg|thumb|right|Splash screen]] | [[File:20170724 0002.jpg|thumb|right|Splash screen]] | ||
__TOC__ | |||
=== Contributors === | === Contributors === | ||
* ''[[user:Sicelo|sicelo]]'' | |||
* ''[[user:Danct12|Danct12]]'' | |||
* ''[[user:MartijnBraam|MartijnBraam]]'' | * ''[[user:MartijnBraam|MartijnBraam]]'' | ||
* ''[https:// | * ''[https://gitlab.com/craftyguy craftyguy]'' | ||
* ''[https://github.com/pavelmachek Pavel Machek]'' | * ''[https://github.com/pavelmachek Pavel Machek]'' | ||
* ''[[user:drebrez|drebrez]]'' | * ''[[user:drebrez|drebrez]]'' | ||
* ''[https://github.com/fxkrait FXKrait]'' | * ''[https://github.com/fxkrait FXKrait]'' | ||
* ''[[user:ollieparanoid|ollieparanoid]]'' | |||
=== Users owning this device === | |||
{{Device owners}} | |||
== Additional info == | == Additional info == | ||
Cameras are supported in the kernel, but have very complex media pipelines. [https://git.sr.ht/~martijnbraam/megapixels-compat Megapixels] has preliminary support for at least the rear/main camera. | |||
The GPU is a PowerVR SGX530 which does not have FOSS drivers, so 3D acceleration does not work with the mainline kernel. However, the blobs, patched mesa, and patched wlroots that permit it to work on mainline with postmarketOS are maintained in the [https://gitlab.com/pvrports pvrports project]. It packages the work of the [https://github.com/openpvrsgx-devgroup/linux_openpvrsgx linux openpvrsgx dev group] , which maintains a "near-mainline" kernel fork with the required kernel driver. | |||
Voice calls work, but need https://gitlab.com/libcmtspeechdata/libcmtspeechdata to route the speech data. Integrating this in pmOS is WIP. | |||
There's bluetooth support at bluetooth-next, but that works on N950, not on N900. [https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/commit/?id=7bb318680e868cd049922f6761170b42ff89687d Bluetooth] . The driver compiles fine and loads firmware correctly, then times out on the bluetooth 'read_BD_ADDR' HCI command. | |||
The FM receiver, located inside the bluetooth chip, is enabled by a magic bluetooth packet, so it requires a working bluetooth stack to be available. Otherwise it is a regular i2c device and has simple routing to the codec. Its driver needed some work in the kernel and was eventually dropped. It should not be too difficult to get it working once chip is enabled. | |||
OTG might work since the kernel has support. However, like [[Wileyfox_Swift_(wileyfox-crackling)]], there is a hardware limitation that prevents the N900 from automatically detecting that there's a connected device, and also detecting the USB version/speed it supports. With some work, it most likely should work with manual activation | |||
== Installation == | == Installation == | ||
=== Boot from the SD card === | |||
# Follow the instructions on the [[installation]] page for installing postmarketOS to the SD card. Running from internal storage is not recommended and probably has no real benefit since it is quite slow. | |||
# If you do not already have u-boot installed, boot Maemo Fremantle (the stock OS) and [http://maemo.org/downloads/product/Maemo5/u-boot-flasher/ install u-boot from pali]. If this does not work from Hildon Application Manager, you may run <code>sudo apt-get install u-boot-flasher</code> in maemo terminal (see {{issue|16|wiki}} and {{issue|1371|pmbootstrap}}). See Additional Info below for instructions on configuring pmos to boot by default. | |||
# | |||
# Place the sdcard into the n900 and boot it with the keyboard slide open | # Place the sdcard into the n900 and boot it with the keyboard slide open | ||
# Choose the u-boot shell | # Choose the u-boot shell | ||
# enter <code>run sdboot</code> into the shell | # enter <code>run sdboot</code> into the shell | ||
=== Configuring U-boot (optional) === | === Configuring U-boot (optional) === | ||
Line 81: | Line 109: | ||
ITEM_FSTYPE="ext2" | ITEM_FSTYPE="ext2" | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
It can be set | It can be set as the default boot option by creating a symlink: | ||
<pre>root@Nokia-N900:~# ln -s /etc/bootmenu.d/10-pmos.item /etc/default/bootmenu.item</pre> | <pre>root@Nokia-N900:~# ln -s /etc/bootmenu.d/10-pmos.item /etc/default/bootmenu.item</pre> | ||
Line 97: | Line 125: | ||
</pre> | </pre> | ||
'''Note''': This will set pmos as the default boot option. Maemo will still be accessible when booting the N900 with the keyboard slide out and selecting the relevant boot option in the u-boot boot menu. | '''Note''': This will set pmos as the default boot option. Maemo will still be accessible when booting the N900 with the keyboard slide out and selecting the relevant boot option in the u-boot boot menu. | ||
== Features == | |||
=== Wifi === | === Wifi === | ||
You can use NetworkManager's console UI to connect to your network. Please note that <code>nmtui</code> does not work properly when started from <code>tmux</code>. | |||
<syntaxhighlight lang="shell-session"> | |||
$ nmtui | |||
</syntaxhighlight> | |||
==== With iwd ==== | |||
From the 5.15.13 kernel package onward, you are also able to use <code>iwd</code> to manage wireless, if you so prefer. | |||
==== Power saving / ping times ==== | |||
It should be possible to disable power saving for better ping times, see {{maemo-leste|172}}. | |||
< | <syntaxhighlight lang="shell-session"> | ||
$ sudo apk add iw | |||
$ sudo iw dev wlan0 set power_save off | |||
</syntaxhighlight> | |||
sudo | |||
</ | |||
=== Keyboard Backlight === | === Keyboard Backlight === | ||
Line 135: | Line 157: | ||
=== Keyboard layout === | === Keyboard layout === | ||
The keyboard layout is asked during <code>pmbootstrap init</code> after you select the <code>nokia-n900</code> device. | |||
The keyboard layout | |||
Available keymaps: | Available keymaps: | ||
<div style="overflow:hidden"> | |||
[[File:N900 keymap us.jpg|800px|thumb|left|us/rx51_us]] | |||
[[File:N900 keymap ch-de.jpg|800px|thumb|left|ch/rx51_ch]] | |||
[[File:N900 keymap se.jpg|800px|thumb|left|se/rx51_se and fi/rx51_fi (same for Swedish and Finnish).]] | |||
[[File:N900 keymap it.jpg|800px|thumb|left|it/rx51_it]] | |||
</div> | |||
==== Console ==== | |||
:'''NOTE:''' during installation pmbootstrap will typically ask you for the desired keymap. The following is only for experimentation: normally all should just work fine after setting up the SD card from pmbootstrap. The following section may be dated and pmbootstrap has already done the job for you. | |||
To obtain your desired language keymap file for the RX-51, [https:// | To obtain your desired language keymap file for the RX-51, [https://gitlab.postmarketos.org/postmarketOS/pmaports/-/blob/master/device/community/device-nokia-n900/keymaps/rx51_us.map such as this one]: | ||
* On the N900, install <code>kbd-bkeymaps</code>, either by using <code>pmbootstrap install --add kbd- | * On the N900, install <code>kbd-bkeymaps</code>, either by using <code>pmbootstrap install --add kbd-bkeymaps</code> on the host system or by running <code>apk add kbd-bkeymaps</code> on the device itself. | ||
* The keymap must be in binary format, bmap. This can be accomplished using the <code>loadkeys</code> tool: | * The keymap must be in binary format, bmap. This can be accomplished using the <code>loadkeys</code> tool: | ||
< | <syntaxhighlight lang="shell-session"> | ||
$ apk add kbd kbd-bkeymaps | |||
$ loadkeys -b rx51_us.map > rx51_us.bmap | $ loadkeys -b rx51_us.map > rx51_us.bmap | ||
$ gzip rx51_us.bmap</ | $ gzip rx51_us.bmap | ||
</syntaxhighlight> | |||
* Compress it and copy it to <code>/usr/share/bkeymaps/us/</code> on the N900. | * Compress it and copy it to <code>/usr/share/bkeymaps/us/</code> on the N900. | ||
Line 164: | Line 190: | ||
==== X11 ==== | ==== X11 ==== | ||
:'''NOTE:''' during installation pmbootstrap will typically ask you for the desired X11 xkb keymap. The following is only for experimentation: normally all should just work fine after setting up the SD card from pmbootstrap. The following section may be dated and pmbootstrap has already done the job for you. | |||
In X11 you can use <code>setxkbmap</code> to configure the desired layout. | In X11 you can use <code>setxkbmap</code> to configure the desired layout. | ||
Right now it's configured to use the <code>nokiarx51/us</code> layout by default (see [https:// | Right now it's configured to use the <code>nokiarx51/us</code> layout by default (see [https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/blob/a7afd519eff34237dfe2766634ac6b2c5076e9f5/aports/device/device-nokia-n900/keymaps/40-xkb.conf 40-xkb.conf]) then the pmbootstrap script will patch this file to set the <code>Option "XkbLayout"</code> to <code>"nn"</code> where "nn" is your country code. | ||
{{note| Info: Tab is ctrl+i}} | {{note| Info: Tab is ctrl+i}} | ||
Line 190: | Line 218: | ||
=== Display === | === Display === | ||
With DRM enabled ( | With DRM enabled ({{MR|197|pmbootstrap}}), the display can be managed at this location: <code>/sys/devices/platform/omapdrm.0/graphics/fb0/</code> | ||
For example, the display can be turned off by: | For example, the display can be turned off by: | ||
Line 205: | Line 233: | ||
=== GUI === | === GUI === | ||
==== | ==== i3wm ==== | ||
[[ | '''[[I3wm]] is the recommended UI.''' It is lightweight and fast, and we have a custom N900 configuration that optimizes for its keyboard ([https://www.reddit.com/r/unixporn/comments/7wt8ig/i3gaps_n900_restored_to_glory/ photos]). The most important keybindings are described below, for details see [https://gitlab.postmarketos.org/postmarketOS/pmaports/-/blob/master/device/community/device-nokia-n900/i3wm/i3wm.conf i3wm.conf]. This file gets installed to <code>~/.config/i3/config</code> and of course you can customize it. If you have good additions, please make a merge request so everybody benefits from an improved default config. | ||
===== default mode ===== | |||
* shift + space: switch to "command mode" | |||
==== | ===== command mode ===== | ||
* t: open terminal | |||
* | * k: kill current program | ||
* w: workspace mode | |||
* r: restart i3wm (use after modifying the config) | |||
* q: go back to "default mode" | |||
==== | ===== workspace mode ===== | ||
* a/s/d/f/g: switch to workspace 1/2/3/4/5 | |||
* q: go back to "command mode" | |||
===== Other ===== | |||
==== | ====== Display brightness ====== | ||
With the current configuration, you can adjust the display brightness using the volume keys while holding the Shift key | |||
==== | ==== Xfce4 ==== | ||
[[Xfce4]] also works very well on the N900 | |||
==== Sxmo (dwm or sway) ==== | |||
[[Sxmo]] also supports the Nokia N900, and also includes a fully-featured deviceprofile. However, note that sxmo has very high CPU usage on the N900, evidently due to the daemons that keep the environment working. It is recommended to disable as many of its daemons as possible, e.g. conky. | |||
==== Misc: Middle click ==== | ==== Others ==== | ||
There are also Mate, etc. | |||
==== Misc: Middle click and right click ==== | |||
Obviously, you can't middle click with a touchscreen, but this can be annoying when it's one of the few ways to paste in the terminal. | Obviously, you can't middle click with a touchscreen, but this can be annoying when it's one of the few ways to paste in the terminal. | ||
This script simulates a middle click: | This script simulates a middle click: | ||
Line 249: | Line 273: | ||
xdotool keyup ctrl | xdotool keyup ctrl | ||
xdotool keyup shift | xdotool keyup shift | ||
</syntaxhighlight> | |||
For simulating right click button you can use this command: | |||
<syntaxhighlight lang="sh"> | |||
xdotool click 3 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 256: | Line 285: | ||
==== Charging ==== | ==== Charging ==== | ||
Battery charging is fully supported by the kernel and does not need any special configuration. | Battery charging is fully supported by the kernel and does not need any special configuration. | ||
Normally, the N900 will auto-detect the connected charger type, and pull an appropriate current from it. However, in the event that this does not work, you can adjust it manually as follows: | |||
<syntaxhighlight lang="sh"> | |||
~$ echo 'host' | sudo tee /sys/class/power_supply/bq24150a-0/mode # sets current limit to 500mA | |||
~$ echo 'dedicated' | sudo tee /sys/class/power_supply/bq24150a-0/mode # sets current limit to 1800mA | |||
</syntaxhighlight> | |||
You can also directly set the current limit by writing one of: | |||
<pre> | |||
100 | |||
500 | |||
800 | |||
1800 | |||
</pre> to <code>/sys/class/power_supply/bq24150a-0/current_limit</code>. Any other value written will be rounded to the next higher number from this list. | |||
Be sure that the charger/port can supply the amount of current safely | |||
'''Hint: '''To disable the LED charging indication, do: | |||
<code>echo 0 > /sys/class/power_supply/bq24150a-0/stat_pin_enable</code>. | |||
[http://www.ti.com/lit/ds/symlink/ | [http://www.ti.com/lit/ds/symlink/bq24150.pdf Datasheet for the bq24150 charging chip] | ||
==== Battery Capacity Reporting ==== | |||
To calibrate the battery and get a more accurate capacity report: | |||
# Charge it up '''fully''', using a wall power adapter. | |||
# Unplug the device, then allow the battery to run all the way down. This may take quite a while to happen (>24hrs, but can be made shorter by running a CPU intensive workload). Do not let it charge at all during this time. This means you may not use USB for example, as this automatically causes the device to start charging, albeit slowly. | |||
# When the voltage reaches 3248mV (the EDV1 threshold burned into the fuel gauge's EEPROM), the battery charge gauge chip will be calibrated. You may charge it up again to use the device. Note it may require a number of learning cycles to more accurately learn the battery capacity. | |||
Unfortunately, it is not possible to calibrate an N900 that has a non-functional USB port (which is rather common). In this case, all battery utilities will permanently report a 0% capacity. The battery status will still be monitored by the kernel/udev, and when it gets low, the system will automatically be shutdown gracefully. | |||
[http://www.ti.com/lit/ds/symlink/bq27200.pdf Datasheet for the bq27200 charge gauge chip] | |||
==== Temperature ==== | |||
There's battery temperature sensor. | |||
<syntaxhighlight lang="shell-session"> | |||
$ cat /sys/devices/platform/68000000.ocp/48072000.i2c/i2c-2/2-0055/power_supply/bq27200-0/temp ; \ | |||
cat /sys/devices/virtual/thermal/thermal_zone0/temp | |||
324 | |||
32400 | |||
</syntaxhighlight> | |||
=== Clock === | === Clock === | ||
==== Setting the hardware clock ==== | ==== Setting the hardware clock ==== | ||
If your hardware clock doesn't have the time set you can set it with: | |||
< | <syntaxhighlight lang="shell-session"> | ||
$ date -s "2017-08-14 16:34:50" | $ date -s "2017-08-14 16:34:50" | ||
# Write the current system time to the hardware clock | # Write the current system time to the hardware clock | ||
$ hwclock -w</ | $ hwclock -w | ||
</syntaxhighlight> | |||
==== Setting the hardware alarm clock ==== | ==== Setting the hardware alarm clock ==== | ||
Line 292: | Line 348: | ||
Control trough <code>rtcwake</code> [https://linux.die.net/man/8/rtcwake (Manual Page)]. | Control trough <code>rtcwake</code> [https://linux.die.net/man/8/rtcwake (Manual Page)]. | ||
< | <syntaxhighlight lang="shell-session"> | ||
# Suspends the device to memory for 10 seconds | # Suspends the device to memory for 10 seconds | ||
rtcwake --verbose --seconds 10 --mode mem | rtcwake --verbose --seconds 10 --mode mem | ||
Line 299: | Line 355: | ||
rtcwake --verbose --time_t $TIME --mode no | rtcwake --verbose --time_t $TIME --mode no | ||
/sbin/poweroff | /sbin/poweroff | ||
</ | </syntaxhighlight> | ||
Manual control from sysfs: | Manual control from sysfs: | ||
< | <syntaxhighlight lang="shell-session"> | ||
# To set the wakealarm directly, set $TIME to number of seconds since epoch (1970-01-01). Then poweroff or suspend: | # To set the wakealarm directly, set $TIME to number of seconds since epoch (1970-01-01). Then poweroff or suspend: | ||
echo $TIME > /sys/class/rtc/rtc0/wakealarm | echo $TIME > /sys/class/rtc/rtc0/wakealarm | ||
Line 308: | Line 364: | ||
# To set new wakealarm time, first reset time to 0! | # To set new wakealarm time, first reset time to 0! | ||
echo 0 > /sys/class/rtc/rtc0/wakealarm | echo 0 > /sys/class/rtc/rtc0/wakealarm | ||
</ | </syntaxhighlight> | ||
{{note| When setting number of seconds since epoch, make sure you account for your timezone and see how your realtime clock keeps the time (utc or local)!}} | {{note| When setting number of seconds since epoch, make sure you account for your timezone and see how your realtime clock keeps the time (utc or local)!}} | ||
Line 314: | Line 370: | ||
=== SMS === | === SMS === | ||
You can use ofono test scripts | |||
<code>sudo apk add ofono-scripts; cd /usr/lib/ofono/test</code> | |||
< | |||
</ | |||
Here's an example using the test scripts to enable the modem and send | Here's an example using the test scripts to enable the modem and send an SMS: | ||
<pre> | <pre> | ||
# | # ./enable-modem | ||
# ./online-modem | |||
# | # ./send-sms 5033784582 "I like pizza." 0 | ||
# | |||
</pre> | </pre> | ||
Line 349: | Line 399: | ||
=== GPRS === | === GPRS === | ||
GPRS can be managed by | GPRS can be managed by NetworkManager. | ||
{{note|Once you perform the following steps, the GPRS connection will be established by | {{note|Once you perform the following steps, the GPRS connection will be established by NetworkManager automatically on every boot.}} | ||
Stop ofono in order to set APN: | Stop ofono in order to set APN: | ||
Line 389: | Line 429: | ||
<pre> | <pre> | ||
$ sudo rc-service ofono start | $ sudo rc-service ofono start | ||
$ sudo | $ sudo rc-service networkmanager stop | ||
$ sudo rc-service networkmanager start | |||
</pre> | </pre> | ||
<pre> | <pre> | ||
$ ip addr show gprs0 | $ ip addr show gprs0 | ||
10: gprs0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1400 qdisc pfifo_fast state UNKNOWN qlen 10 | 10: gprs0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1400 qdisc pfifo_fast state UNKNOWN qlen 10 | ||
Line 414: | Line 443: | ||
=== GPS === | === GPS === | ||
Install the package <code>gps-nokia-n900</code>, then run as follows: | |||
<pre> | <pre> | ||
sudo GPS_PTY_LINK=/tmp/n900-gps gps-nokia-n900 -d | |||
</pre> | </pre> | ||
The NMEA stream will be available at <code>/tmp/n900-gps</code>. | |||
{{note| The modem must be Powered on in order to get data from the GPS chip. While it is not absolutely required for the modem to be set Online, it is recommended to do so}} | |||
=== FM Transmitter === | |||
The N900 contains an Si4713 FM transmitter, it's controlled by video4linux. To start transmitting: | |||
<syntaxhighlight lang="shell-session"> | |||
$ v4l2-ctl -d /dev/radio0 --set-ctrl=mute=0 --set-freq=95.21 | |||
Now there should be silence on 95.21Mhz instead of noise when tuning in with a radio | |||
$ aplay -vv some-very-good-music.wav | |||
</syntaxhighlight> | |||
=== Torch === | |||
The device has an ADP1653 flash controller, mainly for use with the camera. It drives two white power LEDs connected in series, and has an additional red indicator led (referred to as a privacy indicator). The ADP1653 has a driver in mainline kernel, and it probes fine. However, some DTS changes are needed to make it work, since the driver requires it to be tied to a camera. | |||
< | In the meantime, the LEDs can be used as a torch manually using <code>i2cset</code>. | ||
apk add | However, '''BE WARNED:''' setting wrong values via i2c runs the risk of over-driving the LEDs and causing permanent hardware damage. | ||
<syntaxhighlight lang="shell-session"> | |||
Install the prerequisites | |||
$ sudo apk add i2c-tools | |||
Unload the driver in case it is already loaded. We will use i2c manually | |||
$ sudo modprobe -r adp1653 | |||
Enable the chip | |||
$ echo 88 | sudo tee /sys/class/gpio/export | |||
$ echo "out" | sudo tee /sys/class/gpio/gpio88/direction | |||
$ echo 1 | sudo tee /sys/class/gpio/gpio88/value | |||
Turn the torch on, using the lowest torch current - DO NOT use other values here or you risk burning the LED | |||
Values between 1 and 7 enable the red privacy/recording led, with different intensity | |||
0x8 is the lowest torch intensity, and we do not recommend going above it | |||
$ sudo i2cset -y 2 0x30 0x0 0x8 | |||
Turn the torch off | |||
$ sudo i2cset -y 2 0x30 0x0 0x0 | |||
Disable the chip | |||
$ echo 0 | sudo tee /sys/class/gpio/gpio88/value | |||
$ echo 88 | sudo tee /sys/class/gpio/unexport | |||
</syntaxhighlight> | |||
== Resources == | == Resources == | ||
* | * {{Device package|nokia-n900|community}} | ||
* {{Kernel package|postmarketos-omap|community}} | |||
* [https://kernel.org Kernel source] | * [https://kernel.org Kernel source] | ||
* [https://web.archive.org/web/20131117073524/http://skeiron.org/tablets-dev/nokia_N900/ Images and Flashers for Maemo] | * [https://web.archive.org/web/20131117073524/http://skeiron.org/tablets-dev/nokia_N900/ Images and Flashers for Maemo] | ||
* {{issue|1617}} issue about Wi-Fi Setup and Keyboard layout | * {{issue|1617}} issue about Wi-Fi Setup and Keyboard layout | ||
* [[User:Ollieparanoid/Dogfooding:N900|ollieparanoid's efforts to use the N900 as music player]] | |||
* [https://n900.quitesimple.org/rescueOS/rescueOS-1.3/ N900 rescueOS] | |||
* [https://www.electroschematics.com/mobile-phone-battery-emulator/ Mobile phone battery emulator] describes how to create a mock battery for Nokia phones of the n900 type so the phone can be run from a PSU | |||
== Helpful Links for Porting == | == Helpful Links for Porting == | ||
* [https://neo900.org/stuff/block-diagrams/n900/n900.html Device schematic] | * [https://neo900.org/stuff/block-diagrams/n900/n900.html Device schematic] | ||
* [http://plan9.stanleylieber.com/hardware/n900/n900.schematics.pdf Very detailed schematic] | * [http://plan9.stanleylieber.com/hardware/n900/n900.schematics.pdf Very detailed schematic] | ||
* [https://github.com/archlinuxarm-n900/alarm-n900/wiki/Hardware-support Arch Linux ARM - N900 hardware components list] | * <s>[https://github.com/archlinuxarm-n900/alarm-n900/wiki/Hardware-support Arch Linux ARM - N900 hardware components list]</s> | ||
* [http://mlab.taik.fi/paja/?p=1263 N900 sensor access in Maemo] | * [http://mlab.taik.fi/paja/?p=1263 N900 sensor access in Maemo] | ||
* [http://natisbad.org/N900/n900-commented-hardware-specs.html Hardware component specs / list] | * [http://natisbad.org/N900/n900-commented-hardware-specs.html Hardware component specs / list] | ||
* [http://elinux.org/N900 Kernel status] | * [http://elinux.org/N900 Kernel status] |
Latest revision as of 17:42, 3 March 2025
![]() Nokia N900 running cmus | |
Manufacturer | Nokia |
---|---|
Name | N900 |
Codename | nokia-n900 |
Released | 2009 |
Type | slide-out keyboard handset |
Hardware | |
Chipset | TI OMAP 3430 |
CPU | 1x 600 MHz Cortex-A8 |
GPU | PowerVR SGX530 |
Display | 800x480 TFT resistive |
Storage | 32 GB |
Memory | 256 MB |
Architecture | armv7 |
Software | |
Original software | Maemo |
Original version | 5 (Fremantle) (Linux 2.6.28) |
postmarketOS | |
Category | community |
Pre-built images | yes |
postmarketOS kernel | Mainline Linux |
Unixbench Whet/Dhry score | 58.4 |
Flashing |
Broken |
---|---|
USB Networking |
Works |
Internal storage |
Works |
SD card |
Works |
Battery |
Works |
Screen |
Works |
Touchscreen |
Works |
Keyboard |
Works |
Multimedia | |
3D Acceleration |
Broken |
Audio |
Works |
Camera |
Partial |
Camera Flash |
No data |
IR TX |
Works |
Connectivity | |
WiFi |
Works |
Bluetooth |
Broken |
GPS |
Works |
Modem | |
Calls |
Partial |
SMS |
Works |
Mobile data |
Works |
Miscellaneous | |
FDE |
Works |
HDMI/DP |
No data |
Sensors | |
Accelerometer |
Works |
Ambient Light |
Works |
Proximity |
Works |
Hall Effect |
No data |
Haptics |
Works |
Barometer |
No data |
Primary Bootloader |
No data |
---|---|
Secondary Bootloader |
Works |
Mainline |
Works |
Internal Storage |
Works |
SD card |
Works |
USB Peripheral |
Works |
Display |
Works |
Keyboard |
Works |
Buttons |
Works |
This device is based on the TI OMAP 3430. See the SoC page for common tips, guides and troubleshooting steps |


Contributors
Users owning this device
- 0mega (Notes: Fremantle)
- Aslantis (Notes: very weird hardware problems)
- Baptx (Notes: QWERTY keyboard)
- Blacklight
- Craftyguy
- Danct12 (Notes: lost back case magnet, keyboard keys falling off)
- Donihalim (Notes: maemo5&pmos-i3wm)
- Drebrez
- Ecloud
- Eloy
- Etam
- Fizzo
- Icenowy
- IonAgorria (Notes: Maemo Leste - OK)
- Kierownik223 (Notes: Have 2, both with pmOS)
- Kreyren (Notes: Got two Rescues from an e-recycler fixed into near-mint condition from a very damaged state, second pending repairs and subject to OSS PCB engineering)
- Lantizia
- Linmob
- Maciej (Notes: US keyboard, fully working)
- MartijnBraam (Notes: Dead battery)
- Maufl
- MayeulC (Notes: FR layout)
- Mint (Notes: Broken back cover sensor and mostly broken microUSB port)
- Mtek89 (Notes: Running Maemo-Leste, but doesn't hold charge)
- Mykhal (Notes: unglued leg magnet)
- Nieldv
- Okias (Notes: Historical value)
- Ollieparanoid (Notes: see also dogfooding efforts)
- Omni (Notes: will bring to BornHack 2023 to give to someone who will make use of it)
- Ozzelot
- PanzerSajt
- Pavel
- Pbryan
- Proycon
- Pseudomind (Notes: currently misplaced)
- Qwertz (Notes: Maemo PR1.2+PMOS)
- R00t (Notes: all of them broken by now, good old times)
- Rapto
- Retourmy (Notes: FR layout)
- Retr0 (Notes: Running pmOS with i3wm)
- Rsquared (Notes: Running mainline)
- Russanandres (Notes: Triple boot (Android + Maemo + PMOS))
- Senorsmile (Notes: Still boots and seems to work)
- Sicelo
- Sulu
- Thejsa (Notes: Fully working w/ Polarcell battery, though has a cuffed screen and a few keyboard keys have worn off printing)
- Thiagaoplusplus
- UltrasonicMadness (Notes: Need to replace the battery)
- ULumia (Notes: RU keyboard)
- Yifei (Notes: good battery life)
Additional info
Cameras are supported in the kernel, but have very complex media pipelines. Megapixels has preliminary support for at least the rear/main camera.
The GPU is a PowerVR SGX530 which does not have FOSS drivers, so 3D acceleration does not work with the mainline kernel. However, the blobs, patched mesa, and patched wlroots that permit it to work on mainline with postmarketOS are maintained in the pvrports project. It packages the work of the linux openpvrsgx dev group , which maintains a "near-mainline" kernel fork with the required kernel driver.
Voice calls work, but need https://gitlab.com/libcmtspeechdata/libcmtspeechdata to route the speech data. Integrating this in pmOS is WIP.
There's bluetooth support at bluetooth-next, but that works on N950, not on N900. Bluetooth . The driver compiles fine and loads firmware correctly, then times out on the bluetooth 'read_BD_ADDR' HCI command.
The FM receiver, located inside the bluetooth chip, is enabled by a magic bluetooth packet, so it requires a working bluetooth stack to be available. Otherwise it is a regular i2c device and has simple routing to the codec. Its driver needed some work in the kernel and was eventually dropped. It should not be too difficult to get it working once chip is enabled.
OTG might work since the kernel has support. However, like Wileyfox_Swift_(wileyfox-crackling), there is a hardware limitation that prevents the N900 from automatically detecting that there's a connected device, and also detecting the USB version/speed it supports. With some work, it most likely should work with manual activation
Installation
Boot from the SD card
- Follow the instructions on the installation page for installing postmarketOS to the SD card. Running from internal storage is not recommended and probably has no real benefit since it is quite slow.
- If you do not already have u-boot installed, boot Maemo Fremantle (the stock OS) and install u-boot from pali. If this does not work from Hildon Application Manager, you may run
sudo apt-get install u-boot-flasher
in maemo terminal (see wiki#16 and pmbootstrap#1371). See Additional Info below for instructions on configuring pmos to boot by default. - Place the sdcard into the n900 and boot it with the keyboard slide open
- Choose the u-boot shell
- enter
run sdboot
into the shell
Configuring U-boot (optional)
In order to configure pmos to boot by default on the N900, using U-boot, you will need to boot into Maemo and create a /etc/bootmenu.d/10-pmos.item
file as the root user with these contents:
/etc/bootmenu.d/10-pmos.item
ITEM_NAME="postmarketOS" ITEM_SCRIPT="boot.scr" ITEM_DEVICE="${EXT_CARD}p1" ITEM_FSTYPE="ext2"
It can be set as the default boot option by creating a symlink:
root@Nokia-N900:~# ln -s /etc/bootmenu.d/10-pmos.item /etc/default/bootmenu.item
Finally, run u-boot-update-bootmenu
:
root@Nokia-N900:~# u-boot-update-bootmenu Default bootmenu entry is '/etc/bootmenu.d/10-pmos.item' Adding bootmenu entry for: 'Maemo 5 with attached kernel (Internal Nand)' Configuration file: /etc/bootmenu.d/10-pmos.item Adding bootmenu entry for: 'postmarketOS' Configuring this bootmenu entry as default Generating u-boot bootmenu script...
Note: This will set pmos as the default boot option. Maemo will still be accessible when booting the N900 with the keyboard slide out and selecting the relevant boot option in the u-boot boot menu.
Features
Wifi
You can use NetworkManager's console UI to connect to your network. Please note that nmtui
does not work properly when started from tmux
.
$ nmtui
With iwd
From the 5.15.13 kernel package onward, you are also able to use iwd
to manage wireless, if you so prefer.
Power saving / ping times
It should be possible to disable power saving for better ping times, see maemo-leste#172.
$ sudo apk add iw
$ sudo iw dev wlan0 set power_save off
Keyboard Backlight
There are 6 keyboard backlight LEDs that can be adjusted, they are found under /sys/class/leds/lp5523:kb{1-6}
. To adjust brightness, write a value, $VAL between 0 and 255, to the brightness
parameter as the root user:
for i in $(seq 1 6); do echo $VAL > /sys/class/leds/lp5523\:kb$i/brightness done
Keyboard layout
The keyboard layout is asked during pmbootstrap init
after you select the nokia-n900
device.
Available keymaps:
Console
- NOTE: during installation pmbootstrap will typically ask you for the desired keymap. The following is only for experimentation: normally all should just work fine after setting up the SD card from pmbootstrap. The following section may be dated and pmbootstrap has already done the job for you.
To obtain your desired language keymap file for the RX-51, such as this one:
- On the N900, install
kbd-bkeymaps
, either by usingpmbootstrap install --add kbd-bkeymaps
on the host system or by runningapk add kbd-bkeymaps
on the device itself.
- The keymap must be in binary format, bmap. This can be accomplished using the
loadkeys
tool:
$ apk add kbd kbd-bkeymaps
$ loadkeys -b rx51_us.map > rx51_us.bmap
$ gzip rx51_us.bmap
- Compress it and copy it to
/usr/share/bkeymaps/us/
on the N900.
- Log into the N900, and run
sudo setup-keymap
, then selectus
and finallyrx51_us
.
(TODO: Need to pull 'official' vconsole keymaps from Maemo5 if they exist..)
X11
- NOTE: during installation pmbootstrap will typically ask you for the desired X11 xkb keymap. The following is only for experimentation: normally all should just work fine after setting up the SD card from pmbootstrap. The following section may be dated and pmbootstrap has already done the job for you.
In X11 you can use setxkbmap
to configure the desired layout.
Right now it's configured to use the nokiarx51/us
layout by default (see 40-xkb.conf) then the pmbootstrap script will patch this file to set the Option "XkbLayout"
to "nn"
where "nn" is your country code.
Info: Tab is ctrl+i |
Console switching
You can use the
key in combination with the blue arrow
Volume Up/Down
to switch to a different virtual terminal.
If you installed postmarketOS with a UI, you first have to enable again the other VT by editing the /etc/inittab
file and uncomment the following lines:
...
# Set up a couple of getty's
tty1::respawn:/sbin/getty 38400 tty1
tty2::respawn:/sbin/getty 38400 tty2
tty3::respawn:/sbin/getty 38400 tty3
tty4::respawn:/sbin/getty 38400 tty4
tty5::respawn:/sbin/getty 38400 tty5
tty6::respawn:/sbin/getty 38400 tty6
...
Display
With DRM enabled (pmbootstrap!197), the display can be managed at this location: /sys/devices/platform/omapdrm.0/graphics/fb0/
For example, the display can be turned off by:
# echo 1 > /sys/devices/platform/omapdrm.0/graphics/fb0/blank
To adjust brightness:
# # Replace $VAL with a value from 0 to 255: # echo $VAL > /sys/class/backlight/acx565akm/brightness
GUI
i3wm
I3wm is the recommended UI. It is lightweight and fast, and we have a custom N900 configuration that optimizes for its keyboard (photos). The most important keybindings are described below, for details see i3wm.conf. This file gets installed to ~/.config/i3/config
and of course you can customize it. If you have good additions, please make a merge request so everybody benefits from an improved default config.
default mode
- shift + space: switch to "command mode"
command mode
- t: open terminal
- k: kill current program
- w: workspace mode
- r: restart i3wm (use after modifying the config)
- q: go back to "default mode"
workspace mode
- a/s/d/f/g: switch to workspace 1/2/3/4/5
- q: go back to "command mode"
Other
Display brightness
With the current configuration, you can adjust the display brightness using the volume keys while holding the Shift key
Xfce4
Xfce4 also works very well on the N900
Sxmo (dwm or sway)
Sxmo also supports the Nokia N900, and also includes a fully-featured deviceprofile. However, note that sxmo has very high CPU usage on the N900, evidently due to the daemons that keep the environment working. It is recommended to disable as many of its daemons as possible, e.g. conky.
Others
There are also Mate, etc.
Misc: Middle click and right click
Obviously, you can't middle click with a touchscreen, but this can be annoying when it's one of the few ways to paste in the terminal. This script simulates a middle click:
xdotool mousedown --clearmodifiers 2
xdotool mouseup 2
xdotool keyup alt
xdotool keyup ctrl
xdotool keyup shift
For simulating right click button you can use this command:
xdotool click 3
You can bind it to any key you wish. XF86WebCam
is a good choice since it's fairly easy to reach and isn't used for anything.
Battery
Charging
Battery charging is fully supported by the kernel and does not need any special configuration.
Normally, the N900 will auto-detect the connected charger type, and pull an appropriate current from it. However, in the event that this does not work, you can adjust it manually as follows:
~$ echo 'host' | sudo tee /sys/class/power_supply/bq24150a-0/mode # sets current limit to 500mA
~$ echo 'dedicated' | sudo tee /sys/class/power_supply/bq24150a-0/mode # sets current limit to 1800mA
You can also directly set the current limit by writing one of:
100 500 800 1800
to /sys/class/power_supply/bq24150a-0/current_limit
. Any other value written will be rounded to the next higher number from this list.
Be sure that the charger/port can supply the amount of current safely
Hint: To disable the LED charging indication, do:
echo 0 > /sys/class/power_supply/bq24150a-0/stat_pin_enable
.
Datasheet for the bq24150 charging chip
Battery Capacity Reporting
To calibrate the battery and get a more accurate capacity report:
- Charge it up fully, using a wall power adapter.
- Unplug the device, then allow the battery to run all the way down. This may take quite a while to happen (>24hrs, but can be made shorter by running a CPU intensive workload). Do not let it charge at all during this time. This means you may not use USB for example, as this automatically causes the device to start charging, albeit slowly.
- When the voltage reaches 3248mV (the EDV1 threshold burned into the fuel gauge's EEPROM), the battery charge gauge chip will be calibrated. You may charge it up again to use the device. Note it may require a number of learning cycles to more accurately learn the battery capacity.
Unfortunately, it is not possible to calibrate an N900 that has a non-functional USB port (which is rather common). In this case, all battery utilities will permanently report a 0% capacity. The battery status will still be monitored by the kernel/udev, and when it gets low, the system will automatically be shutdown gracefully.
Datasheet for the bq27200 charge gauge chip
Temperature
There's battery temperature sensor.
$ cat /sys/devices/platform/68000000.ocp/48072000.i2c/i2c-2/2-0055/power_supply/bq27200-0/temp ; \
cat /sys/devices/virtual/thermal/thermal_zone0/temp
324
32400
Clock
Setting the hardware clock
If your hardware clock doesn't have the time set you can set it with:
$ date -s "2017-08-14 16:34:50"
# Write the current system time to the hardware clock
$ hwclock -w
Setting the hardware alarm clock
Realtime clock at /dev/rtc0 is on the twl4030 (PMU), and allows setting an alarm to wake the device from sleep, poweroff states.
Control trough rtcwake
(Manual Page).
# Suspends the device to memory for 10 seconds
rtcwake --verbose --seconds 10 --mode mem
# Power off the device and power it on after $TIME, where $TIME is the number of seconds since epoch (1970-01-01)
rtcwake --verbose --time_t $TIME --mode no
/sbin/poweroff
Manual control from sysfs:
# To set the wakealarm directly, set $TIME to number of seconds since epoch (1970-01-01). Then poweroff or suspend:
echo $TIME > /sys/class/rtc/rtc0/wakealarm
# To set new wakealarm time, first reset time to 0!
echo 0 > /sys/class/rtc/rtc0/wakealarm
When setting number of seconds since epoch, make sure you account for your timezone and see how your realtime clock keeps the time (utc or local)! |
SMS
You can use ofono test scripts
sudo apk add ofono-scripts; cd /usr/lib/ofono/test
Here's an example using the test scripts to enable the modem and send an SMS:
# ./enable-modem # ./online-modem # ./send-sms 5033784582 "I like pizza." 0
USB Gadget
Mass Storage
The Mass Storage class exposes a block device as a flash drive on your host machine.
For example, to use the "MyDocs" partition as Mass Storage Device, make sure you unmount the partition first (if mounted), then execute:
echo /dev/mmcblk1p1 > /sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto/gadget/lun0/file
If you only need read permissions on the partition, you can set the read-only flag before exporting it:
echo 1 > /sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto/gadget/lun0/ro
GPRS
GPRS can be managed by NetworkManager.
Once you perform the following steps, the GPRS connection will be established by NetworkManager automatically on every boot. |
Stop ofono in order to set APN:
$ sudo rc-service ofono stop
Edit APN, where <IMSI> should be replaced in the following commands with the IMSI from your SIM card. Replace <APN> with the relevant APN for your cellular carrier (e.g. fast.t-mobile.com). This file should be created when ofono starts, so you should only need to add the APN.
/var/lib/ofono/<IMSI>/gprs
[Settings] Powered=true RoamingAllowed=false [context1] Name=Internet AccessPointName=<APN> Username= Password= AuthenticationMethod=chap Type=internet Protocol=ip
Start ofono and power on modem.
$ sudo rc-service ofono start $ sudo rc-service networkmanager stop $ sudo rc-service networkmanager start
$ ip addr show gprs0 10: gprs0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1400 qdisc pfifo_fast state UNKNOWN qlen 10 link/[821] inet 33.238.141.172/32 brd 33.238.141.172 scope global gprs0 valid_lft forever preferred_lft forever
GPS
Install the package gps-nokia-n900
, then run as follows:
sudo GPS_PTY_LINK=/tmp/n900-gps gps-nokia-n900 -d
The NMEA stream will be available at /tmp/n900-gps
.
The modem must be Powered on in order to get data from the GPS chip. While it is not absolutely required for the modem to be set Online, it is recommended to do so |
FM Transmitter
The N900 contains an Si4713 FM transmitter, it's controlled by video4linux. To start transmitting:
$ v4l2-ctl -d /dev/radio0 --set-ctrl=mute=0 --set-freq=95.21
Now there should be silence on 95.21Mhz instead of noise when tuning in with a radio
$ aplay -vv some-very-good-music.wav
Torch
The device has an ADP1653 flash controller, mainly for use with the camera. It drives two white power LEDs connected in series, and has an additional red indicator led (referred to as a privacy indicator). The ADP1653 has a driver in mainline kernel, and it probes fine. However, some DTS changes are needed to make it work, since the driver requires it to be tied to a camera.
In the meantime, the LEDs can be used as a torch manually using i2cset
.
However, BE WARNED: setting wrong values via i2c runs the risk of over-driving the LEDs and causing permanent hardware damage.
Install the prerequisites
$ sudo apk add i2c-tools
Unload the driver in case it is already loaded. We will use i2c manually
$ sudo modprobe -r adp1653
Enable the chip
$ echo 88 | sudo tee /sys/class/gpio/export
$ echo "out" | sudo tee /sys/class/gpio/gpio88/direction
$ echo 1 | sudo tee /sys/class/gpio/gpio88/value
Turn the torch on, using the lowest torch current - DO NOT use other values here or you risk burning the LED
Values between 1 and 7 enable the red privacy/recording led, with different intensity
0x8 is the lowest torch intensity, and we do not recommend going above it
$ sudo i2cset -y 2 0x30 0x0 0x8
Turn the torch off
$ sudo i2cset -y 2 0x30 0x0 0x0
Disable the chip
$ echo 0 | sudo tee /sys/class/gpio/gpio88/value
$ echo 88 | sudo tee /sys/class/gpio/unexport
Resources
- Device package
- Kernel package
- Kernel source
- Images and Flashers for Maemo
- #1617 issue about Wi-Fi Setup and Keyboard layout
- ollieparanoid's efforts to use the N900 as music player
- N900 rescueOS
- Mobile phone battery emulator describes how to create a mock battery for Nokia phones of the n900 type so the phone can be run from a PSU