https://wiki.archlinux.org/api.php?action=feedcontributions&user=Mirelsol&feedformat=atomArchWiki - User contributions [en]2024-03-29T09:44:18ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Conky&diff=460425Conky2016-12-29T06:36:18Z<p>Mirelsol: Suggest to add -p parameter to conky Exec</p>
<hr />
<div>[[Category:Status monitoring and notification]]<br />
[[fa:Conky]]<br />
[[de:Conky]]<br />
[[es:Conky]]<br />
[[fr:Conky]]<br />
[[it:Conky]]<br />
[[ja:Conky]]<br />
[[ru:Conky]]<br />
[[tr:Conky]]<br />
[[zh-CN:Conky]]<br />
{{Style|Lots of useless config dumps and unneeded complexity}}<br />
''Conky'' is a system monitor software for the X Window System. It is available for GNU/Linux and FreeBSD. It is free software released under the terms of the GPL license. Conky is able to monitor many system variables including CPU, memory, swap, disk space, temperature, top, upload, download, system messages, and much more. It is extremely configurable, however, the configuration can be a little hard to understand. ''Conky'' is a fork of torsmo.<br />
<br />
== Installation and configuration ==<br />
<br />
[[Install]] the {{Pkg|conky}} package. For alternative packages with more features, see [[#AUR packages]].<br />
<br />
Create a local configuration file:<br />
$ mkdir -p ~/.config/conky<br />
$ conky -C > ~/.config/conky/conky.conf<br />
<br />
Now you can edit {{ic|~/.config/conky/conky.conf}} to customize conky as you wish. For a few example configuration files, see [https://github.com/brndnmtthws/conky/wiki/User-Configs this page].<br />
<br />
When editing your config file, you will see immediately the effect of any change as soon as you save it. There is no need to log out/log in your X session. So best is to test all kind of options, one by one, save the configuration file and see the change on your ''conky'' window, and correct if your change is inappropriate.<br />
<br />
One of the nice features of ''conky'' is to pipe to your desktop some {{ic|/var/log/}} files to read all kinds of log messages. Most of these files can only be read by {{ic|root}}, but running ''conky'' as {{ic|root}} is not recommended, so you will need to add {{ic|''username''}} to the {{ic|log}} group:<br />
# usermod -aG log ''username''<br />
<br />
=== AUR packages ===<br />
<br />
In addition to the basic ''conky'' package, there are various [[AUR]] packages available with extra compile options enabled:<br />
<br />
* {{App|conky-cli|''Conky'' without X11 dependencies||{{AUR|conky-cli}}}}<br />
* {{App|conky-lua|''Conky'' with Lua support||{{AUR|conky-lua}}}}<br />
* {{App|conky-lua-nv|''Conky'' with both Lua and Nvidia support||{{AUR|conky-lua-nv}}}}<br />
* {{App|conky-nvidia|''Conky'' with Nvidia support||{{AUR|conky-nvidia}}}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Config file syntax changed ===<br />
<br />
Since Conky 1.10, configuration files have been written with Lua syntax, like so:<br />
<br />
conky.config = {<br />
-- Comments start with a double dash<br />
bool_value = true,<br />
string_value = 'foo',<br />
int_value = 42,<br />
}<br />
conky.text = [[<br />
$variable<br />
${evaluated variable}<br />
]]<br />
<br />
Some examples below may still use the old syntax, which looks like this:<br />
<br />
bool_value yes<br />
string_value 'foo'<br />
int_value 42<br />
<br />
A Lua script is available to convert from the old syntax to the new Lua syntax [https://github.com/brndnmtthws/conky/blob/master/extras/convert.lua here].<br />
<br />
If in doubt, or something doesn't work at all, you can start with the default config file:<br />
<br />
$ conky -C > conky.conf.default<br />
<br />
=== Enable real transparency in KDE4 and Xfce4 ===<br />
<br />
Since version 1.8.0 ''conky'' supports real transparency. To enable it add this line to {{ic|conky.conf}}:<br />
<br />
own_window_transparent = true,<br />
<br />
The above option is not desired with the {{ic|OWN_WINDOW_ARGB_VISUAL yes}} option.<br />
This replaces the {{Pkg|feh}} method described below.<br />
<br />
{{Note|1=[[Xfce]] requires enabled compositing, see [https://forum.xfce.org/viewtopic.php?pid=25939].}}<br />
<br />
=== Autostart with Xfce4 ===<br />
<br />
In {{ic|conky.conf}} file:<br />
background = true,<br />
<br />
This variable will fork ''conky'' to your background. If you want to make your window always visible on your desktop, sticky across all workspaces and not showing in your taskbar, add these arguments:<br />
own_window = true,<br />
own_window_type = 'override',<br />
<br />
The {{ic|override}} takes ''conky'' out of the control of your window manager.<br />
<br />
Add a {{ic|~/.config/autostart/conky.desktop}}:<br />
[Desktop Entry]<br />
Encoding=UTF-8<br />
Version=0.9.4<br />
Type=Application<br />
Name=conky<br />
Comment=<br />
Exec=conky -d<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
<br />
You may want to add ''-p 10'' to the ''Exec'' parameter so that it starts drawing ''conky'' after the desktop is up (''-p 10'' means pause for 10 seconds at startup before doing anything).<br />
<br />
=== Prevent flickering ===<br />
<br />
''Conky'' needs Double Buffer Extension (DBE) support from the X server to prevent flickering because it cannot update the window fast enough without it. It can be enabled in {{ic|/etc/X11/xorg.conf}} with {{ic|Load "dbe"}} line in {{ic|"Module"}} section. The {{ic|xorg.conf}} file has been replaced (1.8.x patch upwards) by {{ic|/etc/X11/xorg.conf.d}} which contains the particular configuration files. ''DBE'' is loaded automatically.<br />
<br />
To enable double buffering, add the option<br />
<br />
double_buffer = true,<br />
<br />
to your {{ic|conky.conf}}.<br />
<br />
=== Custom colors ===<br />
<br />
Aside the classic preset colors (white, black, yellow...), you can set your own custom color using the color name code. To determine the code of a color, use a color selector app. The basic {{Pkg|gcolor2}} package in the [[official repositories]] will give you the color name. It is made of six hexadecimal digits (0-9, A-F).<br />
Add this line in your configuration file for a custom color:<br />
<br />
color0 = 'white', --convention for standard named colors<br />
color1 = '00CC00', --convention for hex colors: no pound sign<br />
<br />
Then, when editing the {{ic|TEXT}} section, use custom color number previously defined, for example {{ic|${color3} }}.<br />
<br />
=== Dual Screen ===<br />
<br />
When using a dual screen configuration, you will need to play with two options to place your ''conky'' window. Let's say you are running a 1680X1050 pixels resolution, and you want the window on middle top of your left monitor, you will use this:<br />
alignment = 'top_left',<br />
gap_X = 840,<br />
<br />
The {{ic|alignment}} option is trivial, and {{ic|gap_X}} option is the distance, in pixels, from the left border of your screen.<br />
<br />
The {{ic|xinerama_head}} option might also need to be set.<br />
<br />
=== Do not minimize on Show Desktop ===<br />
<br />
'''Using Compiz:''' If the 'Show Desktop' button or key-binding minimizes Conky along with all other windows, start the Compiz configuration settings manager, go to "General Options" and uncheck the "Hide Skip Taskbar Windows" option.<br />
<br />
If you do not use Compiz, try editing {{ic|conky.conf}} and adding/changing the following line:<br />
<br />
own_window_type = 'override',<br />
<br />
or<br />
<br />
own_window_type = 'desktop',<br />
<br />
Refer to ''conky''s man page for the exact differences. But the latter option enables you to snap windows to ''conky''s border using resize key-binds in e.g. Openbox, which the first one does not.<br />
<br />
=== Integrate with GNOME ===<br />
<br />
Some have experienced problems with ''conky'' showing up under [[GNOME]].<br />
<br />
* Add these lines to {{ic|conky.conf}}:<br />
<br />
own_window yes<br />
own_window_type conky<br />
own_window_transparent yes<br />
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager<br />
<br />
If you still experience problems with transparency. You could add these lines.<br />
own_window_argb_visual yes<br />
own_window_argb_value 255<br />
<br />
=== Integrate with Razor-qt ===<br />
<br />
With ''conky'''s default configuration, its window might disappear from the desktop when you click on the latter. Add these lines to: <br />
<br />
{{hc|conky.conf|own_window yes<br />
own_window_class Conky<br />
own_window_type normal<br />
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager<br />
own_window_transparent yes<br />
}}<br />
<br />
=== Display package update information ===<br />
<br />
* [[Pacman]] provides its own script called {{ic|checkupdates}} which displays package updates from the official repos. Use {{ic|<nowiki>${execpi 3600 checkupdates | wc -l}</nowiki>}} to display the total number of packages.<br />
* [https://bbs.archlinux.org/viewtopic.php?id=68104 Paconky] - Displays package update information in a user-defined format. The output of this program can be included in Conky with the {{ic|<nowiki>${execpi}</nowiki>}} command.<br />
* [https://bbs.archlinux.org/viewtopic.php?id=53761 Scrolling Notifications] - Prints scrolling update notifications. From the author of ''paconky''.<br />
* [https://bbs.archlinux.org/viewtopic.php?id=57291 Perl Script] - Simpler and earlier script from the author of ''paconky''. Prints only the number of packages needing an update.<br />
* [https://bbs.archlinux.org/viewtopic.php?id=37284 Python Script] - Fairly configurable update notification program in [[Python]].<br />
* [https://bbs.archlinux.org/viewtopic.php?pid=483742#p483742 Bash Script] - [[Bash]] script for users that have enabled ShowSize.<br />
<br />
=== Display weather forecast ===<br />
<br />
See [https://bbs.archlinux.org/viewtopic.php?id=37381 this thread].<br />
<br />
=== Display a countdown timer ===<br />
[https://github.com/orschiro/scriptlets/tree/master/ConkyTimer ConkyTimer] is a simple countdown timer that displays the remaining time of a defined task.<br />
<br />
Start the timer using {{ic|conkytimer "<task description>" <min>}}.<br />
<br />
=== Display RSS feeds ===<br />
<br />
''Conky'' has the ability to display RSS feeds natively without the need for an outside script to run and output into Conky. For example, to display the titles of the ten most recent Planet Arch updates and refresh the feed every minute, you would put this into your {{ic|conky.conf}} in the {{ic|TEXT}} section:<br />
<br />
${rss https://planet.archlinux.org/rss20.xml 1 item_titles 10 }<br />
If you want to display Arch Forum rss feed, add this line:<br />
${rss https://bbs.archlinux.org/extern.php?action=feed&type=rss 1 item_titles 4}<br />
where 1 is in minutes the refresh interval (15 mn is default),4 the number of items you wish to show.<br />
<br />
=== Display rTorrent stats ===<br />
<br />
See [https://bbs.archlinux.org/viewtopic.php?id=67304 this thread].<br />
<br />
=== Display your WordPress blog stats ===<br />
<br />
This can be achieved by using the in python written extension named [http://evilshit.wordpress.com/2013/04/20/conkypress-a-wordpress-stats-visualization-tool-for-your-desktop/ ConkyPress].<br />
<br />
=== Display number of new emails ===<br />
==== Gmail ====<br />
===== method 1 =====<br />
Create a file named {{ic|gmail.py}} in a convenient location (this example uses {{ic|~/.scripts/}}) with the following [[Python]] code:<br />
<br />
{{hc|gmail.py|<nowiki><br />
#!/usr/bin/env python<br />
<br />
from urllib.request import FancyURLopener<br />
<br />
email = 'your email' # @gmail.com can be left out<br />
password = 'your password'<br />
<br />
url = 'https://%s:%s@mail.google.com/mail/feed/atom' % (email, password)<br />
<br />
opener = FancyURLopener()<br />
page = opener.open(url)<br />
<br />
contents = page.read().decode('utf-8')<br />
<br />
ifrom = contents.index('<fullcount>') + 11<br />
ito = contents.index('</fullcount>')<br />
<br />
fullcount = contents[ifrom:ito]<br />
<br />
print(fullcount + ' new')<br />
</nowiki>}}<br />
<br />
===== method 2 =====<br />
The following script does less "by hand", and uses more of the capabilities of Python.<br />
<br />
{{hc|gmail.py|<nowiki><br />
#! /usr/bin/env python<br />
<br />
import urllib.request<br />
from xml.etree import ElementTree as etree<br />
<br />
# Enter your username and password below within quotes below, in place of ****.<br />
# Set up authentication for gmail<br />
auth_handler = urllib.request.HTTPBasicAuthHandler()<br />
auth_handler.add_password(realm='mail.google.com',<br />
uri='https://mail.google.com/',<br />
user= '****',<br />
passwd= '****')<br />
opener = urllib.request.build_opener(auth_handler)<br />
# ...and install it globally so it can be used with urlopen.<br />
urllib.request.install_opener(opener)<br />
<br />
gmail = 'https://mail.google.com/gmail/feed/atom'<br />
NS = '{http://purl.org/atom/ns#}'<br />
with urllib.request.urlopen(gmail) as source:<br />
tree = etree.parse(source)<br />
fullcount = tree.find(NS + 'fullcount').text<br />
<br />
print(fullcount + ' new')<br />
</nowiki>}}<br />
<br />
Add the following string to your {{ic|conky.conf}} in order the check your Gmail account for new email every five minutes (300 seconds) and display:<br />
${execpi 300 python ~/.scripts/gmail.py}<br />
<br />
===== method 3 =====<br />
<br />
The same way, but with using {{ic|curl}}, {{ic|grep}} and {{ic|sed}}:<br />
<br />
<nowiki>$ curl -s -u '''email''':'''password''' https://mail.google.com/mail/feed/atom | grep fullcount | sed 's/<[^0-9]*>//g'</nowiki><br />
<br />
replace ''email'' and ''password'' with your data.<br />
<br />
===== method 4 =====<br />
<br />
Alternatively, you can use [http://www.stunnel.org/ stunnel] which is provided by the {{Pkg|stunnel}} package.<br />
<br />
The following configuration is taken from [https://github.com/brndnmtthws/conky/wiki/FAQ Conky's FAQ]<br />
<br />
Modify {{ic|/etc/stunnel/stunnel.conf}} as follows, and then [[start]] {{ic|stunnel.service}}:<br />
# Service-level configuration for TLS server<br />
[imap]<br />
client = yes<br />
accept = 143<br />
connect = imap.gmail.com:143<br />
protocol = imap<br />
sslVersion = TLSv1<br />
# Service-level configuration for SSL server<br />
[imaps]<br />
client = yes<br />
accept = 993<br />
connect = imap.gmail.com:993<br />
<br />
The only thing left is our {{ic|conky.conf}}:<br />
imap localhost username * -i 120 -p 993<br />
TEXT<br />
Inbox: ${imap_unseen}/${imap_messages}<br />
<br />
Here I used {{ic|*}} as the password for ''conky'' to ask for it at start, but you do '''not''' have to do it.<br />
<br />
==== IMAP + SSL using Perl ====<br />
<br />
''Conky'' has built in support for IMAP accounts but does not support SSL. This can be provided using this script from [http://www.unix.com/shell-programming-scripting/115322-perl-conky-gmail-imap-unread-message-count.html this forum post]. This requires the Perl/CPAN Modules Mail::IMAPClient and IO::Socket::SSL which are in the {{AUR|perl-mail-imapclient}} and {{Pkg|perl-io-socket-ssl}} packages<br />
<br />
Create a file named {{ic|imap.pl}} in a location to be read by ''conky''. In this file, add (with the appropriate changes):<br />
#!/usr/bin/perl<br />
<br />
# gimap.pl by gxmsgx<br />
# description: get the count of unread messages on imap<br />
<br />
use strict;<br />
use Mail::IMAPClient;<br />
use IO::Socket::SSL;<br />
<br />
my $username = 'example.username'; <br />
my $password = 'password123'; <br />
<br />
my $socket = IO::Socket::SSL->new(<br />
PeerAddr => 'imap.server',<br />
PeerPort => 993<br />
)<br />
or die "socket(): $@";<br />
<br />
my $client = Mail::IMAPClient->new(<br />
Socket => $socket,<br />
User => $username,<br />
Password => $password,<br />
)<br />
or die "new(): $@";<br />
<br />
if ($client->IsAuthenticated()) {<br />
my $msgct;<br />
<br />
$client->select("INBOX");<br />
$msgct = $client->unseen_count||'0';<br />
print "$msgct\n";<br />
}<br />
<br />
$client->logout();<br />
<br />
Add to {{ic|conky.conf}}:<br />
${execpi 300 ~/.conky/imap.pl} <br />
or wherever you saved the file.<br />
<br />
If you use Gmail you might need to [http://www.google.com/accounts/IssuedAuthSubTokens?hide_authsub=1 generate] an application specific password.<br />
<br />
Alternatively, you can use stunnel as shown above: [[#Gmail]]<br />
<br />
==== IMAP using PHP ====<br />
Another alternative using PHP. PHP needs to be installed and {{ic|1=extension=imap.so}} must be uncommented in {{ic|/etc/php/php.ini}}.<br />
<br />
Then create a file named {{ic|imap.php}} in a location to be read by ''conky''. Make the file executable:<br />
$ chmod +x imap.php<br />
<br />
In this file, add (with the appropriate changes):<br />
<br />
#!/usr/bin/php<br />
<?php<br />
// See http://php.net/manual/function.imap-open.php for more information about<br />
// the mailbox string in the first parameter of imap_open.<br />
// This example is ready to use with Office 365 Exchange Mails,<br />
// just replace your username (=email address) and the password.<br />
$mbox = imap_open("{outlook.office365.com:993/imap/ssl/novalidate-cert}", "username", "password");<br />
<br />
// Total number of emails<br />
$nrTotal = imap_num_msg($mbox);<br />
<br />
// Number of unseen emails. There are other ways using imap_status to count<br />
// unseen messages, but they don't work with Office 365 Exchange. This one does.<br />
$unseen = imap_search($mbox, 'UNSEEN');<br />
$nrUnseen = $unseen ? count($unseen) : 0;<br />
<br />
// Display the result, format as you like.<br />
echo $nrUnseen.'/'.$nrTotal;<br />
<br />
// Not needed, because the connection is closed after the script end.<br />
// For the sake of clean public available scripts, we are nice to<br />
// the imap server and close the connection manually.<br />
imap_close($mbox);<br />
<br />
Add to {{ic|conky.conf}}:<br />
<br />
${execpi 300 ~/.conky/imap.php} <br />
<br />
or wherever you saved the file.<br />
<br />
This script displays A/B where A is the number of unseen emails and B is the total number of mails in the mailbox. There are a lot of other informations available through a lot of PHP functions like with imap_Status (http://php.net/manual/function.imap-status.php). Just see the PHP docs about IMAP: http://php.net/manual/ref.imap.php.<br />
<br />
=== Show graphic of active network interface ===<br />
<br />
To test if a network inferface is currently active, you can use the test conky variable {{ic | if_existing}} on the {{ic | operstate}} of the interface. Here's an example for wlo1 :<br />
<br />
{{bc |draw_graph_borders yes <br />
${if_existing /sys/class/net/wlo1/operstate up}<br />
${color #0077ff}Net Down:$color ${downspeed wlo1} ${color #0077ff}Net Up:$color ${upspeed wlo1}<br />
${color #0077ff}${downspeedgraph wlo1 32,155 104E8B 0077ff} $alignr${color #0077ff}${upspeedgraph wlo1 32,155 104E8B 0077ff}<br />
${endif}<br />
}}<br />
<br />
This is the expected result :<br />
<br />
http://i.imgur.com/pQQbsP6.png<br />
<br />
=== Fix scrolling with UTF-8 multibyte characters ===<br />
<br />
The current version of ''conky'' (1.9.0) suffers from a [https://github.com/brndnmtthws/conky/issues/129 bug] where scrolling text increments by byte, not by character, resulting in text containing multibyte characters to disappear and reappear while scrolling. A package with a patch fixing this bug can be found in the AUR: {{AUR|conky-utfscroll}}<br />
<br />
== User-contributed configuration examples ==<br />
<br />
=== A sample rings script with nvidia support===<br />
<br />
See [https://gist.github.com/anonymous/85d052c0c23e58bc3666].<br />
<br />
== A note about symbolic fonts ==<br />
<br />
Many of the more decorated {{ic|conky.conf}}'s use the fonts PizzaDude Bullets and Pie Charts for Maps. They are available from the AUR as {{AUR|ttf-pizzadude-bullets}} and {{AUR|ttf-piechartsformaps}}{{Broken package link|{{aur-mirror|ttf-piechartsformaps}}}} respectively, or they can be found and downloaded with a quick search and manually installed using the instructions in [[Fonts]].<br />
<br />
== Fonts appear smaller than they should with Infinality ==<br />
<br />
If you notice that your ''conky'' fonts appear smaller than they should, or they do not align properly, it could be caused by a default setting in the infinality freetype2 patch. This setting can cause some programs to display fonts at 72 DPI instead of 96 even if the rest of your system is set to 96. If you notice a problem open {{ic|/etc/fonts/infinality/infinality.conf}} search for the section on DPI and change 72 to 96.<br />
<br />
== Universal method to enable true transparency ==<br />
<br />
Transparency is a strange beast in ''conky'', but there is a way to universally apply true transparency with any environment or window manager by using ''xcompmgr'' and ''transset-df''. [[Pacman#Installing specific packages|Install]] {{Pkg|xcompmgr}} and {{Pkg|transset-df}}.<br />
<br />
{{Note|This may conflict with any other compositing manager you are already using.}}<br />
<br />
Check ''xcompmgr'' documentation to help you decide which compositing options you would like to enable. The following is a common standard command.<br />
<br />
$ xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &<br />
<br />
Make sure ''conky'' is running with {{ic|conky &}}. Use ''transset-df'' to enable transparency on the ''conky'' window. Set '.5' to any value in the range 0 - 1.<br />
<br />
$ transset-df .5 -n Conky<br />
<br />
This should give your ''conky'' window true transparency. If you get an error like:<br />
<br />
No Window matching Conky exists!<br />
<br />
verify that ''conky'' is running, and use ''xprop'' and click on the ''conky'' window to find the name you should pass to {{ic|transset-df}}.<br />
<br />
{{hc|$ xprop &#124; grep WM_NAME|2=WM_NAME(STRING) = "Conky (ArchitectLinux)"}}<br />
<br />
In this case, ''conky'' is right, but for you it may be different, so be sure to use your output instead. If {{ic|conky.conf}} has an option {{ic|own_window_type}} set to {{ic|panel}}, then this ''xprop'' invocation may show no output. Try using {{ic|dock}}, {{ic|normal}}, {{ic|override}} or {{ic|desktop}} instead.<br />
<br />
Use this in {{ic|~/.xinitrc}} to have transparent ''conky'' after [[X]] starts up:<br />
<br />
xcompmgr -c -t-5 -l-5 -r4.2 -o.55 &<br />
conky -d; sleep 1 && transset-df .5 -n Conky<br />
<br />
== See also ==<br />
<br />
* [https://github.com/brndnmtthws/conky Official website]<br />
* [http://conky.sourceforge.net/config_settings.html Official Conky variables for configuration]<br />
* [http://conky.sourceforge.net/variables.html Official Conky objects]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=39906 Conky Configs on arch forums]<br />
* [http://freecode.com/projects/conky/ Conky] on [[wikipedia:Freecode|Freecode]]<br />
* [irc://chat.freenode.org/conky #conky] IRC chat channel on [[wikipedia:Freenode|freenode]]<br />
* [http://novel.evilcoder.org/wiki/index.php?title=ConkyFAQ&oldid=12463 FAQ]</div>Mirelsolhttps://wiki.archlinux.org/index.php?title=Talk:PhpPgAdmin&diff=333673Talk:PhpPgAdmin2014-09-03T14:18:22Z<p>Mirelsol: </p>
<hr />
<div>== PhpPgAdmin v 5.0.3-1 couldn't find config.inc.php at first ==<br />
I had to do the following before my phppgadmin installation would pick up any changes to /etc/webapps/phppgadmin/config.inc.php<br />
{{bc|rm /usr/share/webapps/phppgadmin/conf/config.inc.php<br />
ln -s /etc/webapps/phppgadmin/config.inc.php /usr/share/webapps/phppgadmin/conf/}}<br />
== I can't to open the http://localhost/phppgadmin/ ==<br />
<br />
I get the following error message:<br />
<br />
printHeader('', null, true); $rtl = (strcasecmp($lang['applangdir'], 'rtl') == 0); $cols = $rtl ? '*,'.$conf['left_width'] : $conf['left_width'].',*'; $mainframe = '' ?> printFooter(false); ?><br />
<br />
What is the solution?<br />
--[[User:Cspal|Cspal]] ([[User talk:Cspal|talk]]) 13:55, 16 August 2014 (UTC)<br />
<br />
:It seems that the page isn't parsed by PHP. Did you follow [[LAMP#PHP]], as suggested in the intro of this article?<br />
:--[[User:Lonaowna|Lonaowna]] ([[User talk:Lonaowna|talk]]) 14:16, 16 August 2014 (UTC)<br />
<br />
<br />
== client denied by server configuration: /usr/share/webapps/phppgadmin/ ==<br />
With Apache 2.4.10-1 and phppgadmin 5.1-3 I had to add this to /etc/httpd/conf/extra/httpd-phppgadmin.conf:<br />
{{bc|Allow from all}} otherwise I got this error.</div>Mirelsolhttps://wiki.archlinux.org/index.php?title=SQLite&diff=245274SQLite2013-01-27T09:29:47Z<p>Mirelsol: /* Related Packages */</p>
<hr />
<div>[[Category:Database management systems]]<br />
== About ==<br />
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain.<br />
<br />
== Features ==<br />
From: [http://www.sqlite.org/features.html SQLite Features]<br />
* Transactions are atomic, consistent, isolated, and durable even after system crashes and power failures.<br />
* Zero-configuration - no setup or administration needed.<br />
* Implements most of SQL92. <br />
* A complete database is stored in a single cross-platform disk file.<br />
* Supports terabyte-sized databases and gigabyte-sized strings and blobs. <br />
* Small code footprint: less than 325KiB fully configured or less than 190KiB with optional features omitted.<br />
* Faster than popular client/server database engines for most common operations.<br />
* Simple, easy to use API.<br />
* Written in ANSI-C. TCL bindings included. Bindings for dozens of other languages available separately.<br />
* Well-commented source code with 100% branch test coverage.<br />
* Available as a single ANSI-C source-code file that you can easily drop into another project.<br />
* Self-contained: no external dependencies.<br />
*Cross-platform: Unix (Linux and Mac OS X), OS/2, and Windows (Win32 and WinCE) are supported out of the box. Easy to port to other systems.<br />
* Sources are in the public domain. Use for any purpose.<br />
* Comes with a standalone command-line interface (CLI) client that can be used to administer SQLite databases.<br />
<br />
== Installation ==<br />
$ pacman -S sqlite<br />
<br />
=== Related Packages ===<br />
* '''extra/sqlite-doc''' - most of the static HTML files that comprise this website, including all of the SQL Syntax and the C/C++ interface specs and other miscellaneous documentation<br />
* '''extra/php-sqlite''' - sqlite3 module for PHP (don't forget to enable it in /etc/php/php.ini)<br />
* '''community/gambas2-gb-db-sqlite3''' - Gambas2 Sqlite3 database access component<br />
* '''community/sqliteman''' - The best developer's and/or admin's GUI tool for Sqlite3 in the world<br />
<br />
== Using sqlite3 command line shell ==<br />
The SQLite library includes a simple command-line utility named sqlite3 that allows the user to manually enter and execute SQL commands against an SQLite database.<br />
<br />
==== Create a database ====<br />
sqlite3 archdatabase<br />
<br />
==== Create Table ====<br />
sqlite> create table tblone(one varchar(10), two smallint);<br />
<br />
==== Insert Data ====<br />
sqlite> insert into tblone values('helloworld',20);<br />
sqlite> insert into tblone values('archlinux', 30);<br />
<br />
==== Search Database ====<br />
sqlite> select * from tblone;<br />
helloworld|20<br />
rchlinux|30<br />
<br />
See the [http://www.sqlite.org/sqlite.html sqlite docs].<br />
<br />
== Using sqlite in shell script ==<br />
See forum [https://bbs.archlinux.org/viewtopic.php?id=109802 post]<br />
<br />
== External Links ==<br />
* [http://www.sqlite.org SQLite homepage]<br />
* [http://www.squidoo.com/sqlitehammer SQLite Hammer]<br />
* [http://oreilly.com/catalog/9780596521196 Using SQLite - Oreilly Book]<br />
* [http://www.amazon.com/Definitive-Guide-SQLite-Mike-Owens/dp/1590596730 SQLite - Apress Book]</div>Mirelsolhttps://wiki.archlinux.org/index.php?title=Arduino&diff=210474Arduino2012-06-19T19:43:29Z<p>Mirelsol: /* Error when launching Arduino IDE */</p>
<hr />
<div>[[Category:Development]]<br />
[[Category:Mathematics and science]]<br />
Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It is intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. More information is availible on the [http://www.arduino.cc/ Arduino HomePage].<br />
<br />
==Installation==<br />
<br />
* Install {{AUR|arduino}} from the [[Arch User Repository|AUR]].<br />
* Add yourself to the {{ic|uucp}} [[Users and Groups|group]]. (More information in the next section: "Accessing serial")<br />
<br />
==Configuration==<br />
<br />
===Accessing serial===<br />
<br />
The arduino board communicates with the PC via a serial connection or a serial over USB connection. So the user needs read/write access to the serial device file. [[Udev]] creates files in /dev/tts/ owned by group uucp so adding the user to the uucp group gives the required read/write access.<br />
<br />
gpasswd -a <user> uucp<br />
<br />
{{Note|You will have to logout and login again for this to take effect.}}<br />
<br />
Briefly run the {{ic|arduino}} command and stop it, then modify {{ic|~/.arduino/preferences.txt}} .<br />
<br />
Change serial port from COM1 to your serial port. With your arduino board connected, you can find out what your serial port is with:<br />
<br />
ls /dev/ttyUSB* /dev/ttyACM*<br />
<br />
If in doubt, unconnect the board and look which of these disappears, and/or monitor {{ic|/var/log/everything.log}}.<br />
<br />
The line to change in {{ic|~/.arduino/preferences.txt}} should look something like this when you are done:<br />
<br />
serial.port=/dev/ttyACM3<br />
<br />
Rerun {{ic|arduino}}. If you get a message like "Arduino Uno on COM1" message in the GUI's lower right corner, connection has been established.<br />
<br />
== stty ==<br />
<br />
Preparing<br />
stty -F /dev/ttyACM0 cs8 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts<br />
<br />
Sending commands through Terminal without new line after command<br />
echo -n "Hello World" > /dev/ttyACM0<br />
<br />
Reading what your Arduino has to tell you<br />
cat /dev/ttyACM0<br />
<br />
==Working with Uno/Mega2560==<br />
<br />
The Arduino Uno and Mega2560 have an onboard USB interface (an Atmel 8U2) that accepts serial data, so they are accessed through /dev/ttyACM0 created by the cdc-acm kernel module when it is plugged in.<br />
<br />
The 8U2 firmware may need an update to ease serial communications. See [http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286350399] for more details and reply #11 for a fix. The original arduino bbs, where you can find an image explaining how to get your Uno into DFU, is now in a read-only state. If you do not have an account to view the image, see [http://www.scribd.com/doc/45913857/Arduino-UNO].<br />
<br />
You can perform a general function test of the Uno by putting it in loopback mode and typing characters into the arduino serial monitor at 115200 baud. It should echo the characters back to you. To put it in loopback, short pins 0 -> 1 on the digital side and either hold the reset button or short the GND -> RESET pins while you type.<br />
<br />
== Running Arduino Uno ==<br />
<br />
Once Arduino is running you must ensure you have selected the correct board from the Tools->Boards menu item:<br />
Arduino Uno<br />
<br />
Secondly you must ensure you have selected the correct serial port from the Tools->Serial Port menu item as explained above.<br />
<br />
Once these are done you should be able to write and upload sketches to your Arduino Uno without any issues.<br />
<br />
==Alternatives for IDE==<br />
<br />
===ArduIDE===<br />
<br />
ArduIDE is a Qt-based IDE for Arduino. {{aur|arduide-git}} is available in the [[AUR]].<br />
<br />
If you prefer working from terminal, below there are some other options to choose from.<br />
<br />
===gnoduino===<br />
<br />
{{aur|gnoduino}} is an implementation of original Arduino IDE for GNOME available in the [[AUR]]. The original Arduino IDE software is written in Java. This is a Python implementation and it is targeted at GNOME but will work on xfce4 and other WM. Its purpose is to be light, while maintaining compatibility with the original Arduino IDE. The source editor is based on gtksourceview.<br />
<br />
===Scons===<br />
<br />
Using [http://www.scons.org/ scons] together with [http://code.google.com/p/arscons/ arscons] it is very easy to use to compile and upload Arduino projects from the command line. Scons is based on python and you will need python-pyserial to use the serial interface. Install everything with<br />
<br />
# pacman -S python-pyserial scons<br />
<br />
That will get the dependencies you need too. You will also need Arduino itself so install it as described above. Create project directory (eg. test), then create a arduino project file in your new directory. Use the same name as the directory and add .pde (eg. test.pde). Get the [http://arscons.googlecode.com/git/SConstruct SConstruct] script from arscons and put it in your directory. Have a peek in it and, if necessary, edit it. It is a python script. Edit your project as you please, then run<br />
<br />
$ scons # This will build the project<br />
$ scons upload # This will upload the project to your Arduino<br />
<br />
===Makefile===<br />
Update 2011-03-12. Arduino Is not shipping a Makefile with version (22). The Makefile from the [http://code.google.com/p/dogm128/source/browse/libraries/Dogm/examples/SpaceTrash/Makefile.uno_dogs102 dogm128] project works for me though.<br />
<br />
Instead of using the arduino IDE it is possible to use another editor and a Makefile.<br />
<br />
Set up a directory to program your Arduino and copy the Makefile into this directory. A copy of the Makefile can be obtained from /usr/share/arduino/hardware/cores/arduino/Makefile<br />
<br />
You will have to modify this a little bit to reflect your settings. The makefile should be pretty self explainatory. Here are some lines you may have to edit.<br />
<br />
PORT = usually /dev/ttyUSBx, where x is the usb serial port your arduino is plugged into<br />
TARGET = your sketch's name<br />
ARDUINO = /usr/share/arduino/lib/targets/arduino<br />
<br />
Depending on which library functions you call in your sketch, you may need to compile parts of the library. To do that you need to edit your SRC and CXXSRC to include the required libraries.<br />
<br />
Now you should be able to make && make upload to your board to execute your sketch.<br />
<br />
===Arduino-CMake===<br />
<br />
Using [https://github.com/queezythegreat/arduino-cmake arduino-cmake] and [http://www.cmake.org/cmake/resources/software.html CMake] you can build Arduino firmware from the command line using multiple build systems. CMake lets you generate the build system that fits your needs, using the tools you like. It can generate any type of build system, from simple Makefiles, to complete projects for Eclipse, Visual Studio, XCode, etc.<br />
<br />
Requirements:<br />
* [http://www.archlinux.org/packages/?sort=&q=cmake CMake]<br />
* [https://aur.archlinux.org/packages.php?ID=8388 Arduino SDK]<br />
* [http://www.archlinux.org/packages/?sort=&q=gcc-avr gcc-avr]<br />
* [http://www.archlinux.org/packages/?sort=&q=binutils-avr binutils-avr]<br />
* [http://www.archlinux.org/packages/?sort=&q=avr-libc avr-libc]<br />
* [http://www.archlinux.org/packages/?sort=&q=avrdude avrdude]<br />
<br />
==Troubleshooting==<br />
<br />
===delay() function does not work===<br />
{{Out of date|the current arduino-git package is reported in the talk page as not being affected by this issue.|section=Update troubleshooting?}}<br />
There are some cases where the delay() function does not work, causing programs such as the example [http://www.arduino.cc/en/Tutorial/Blink Blink] to malfunction. <br />
It appears that the Arch compiler sometimes generates code that writes to addresses before the start of memory. RAM starts at address 0x200 on the mega, but the Blink code has the delay() timer variables located at 0x100-0x10b. This only seems to happen when the code contains no initialized global variables (.data segment in asm-speak) - the linker is told that the data segment starts at 0x200, but if there is nothing to go in it it generates an incorrect start address for the uninitialized global variables (.bss segment). Since the timer variables are uninitialized globals (or globals initialized to zero) they end up at an illegal address.<br />
<br />
There are currently two ways to bypass this issue.<br />
<br />
* Use '''Serial.begin(9600);''' in '''setup()''' function. [[http://forums.adafruit.com/viewtopic.php?f=25&t=21075 Source post]] <br />
<br />
{{bc|<br />
/*<br />
Blink<br />
Turns on an LED on for one second, then off for one second, repeatedly.<br />
<br />
This example code is in the public domain.<br />
*/<br />
<br />
void setup() { <br />
// initialize the digital pin as an output.<br />
// Pin 13 has an LED connected on most Arduino boards:<br />
pinMode(13, OUTPUT); <br />
Serial.begin(9600);<br />
}<br />
<br />
void loop() {<br />
digitalWrite(13, HIGH); // set the LED on<br />
delay(1000); // wait for a second<br />
digitalWrite(13, LOW); // set the LED off<br />
delay(1000); // wait for a second<br />
}<br />
}}<br />
<br />
* Use an initialized global variable. [[http://arduino.cc/forum/index.php/topic,49900.msg363688.html#msg363688 Source post]]<br />
<br />
{{bc|<nowiki><br />
char dummyvariablecuzmaintainerborkedthecompiler = 123; // force something into the .data segment with non-zero initializer<br />
/*<br />
Blink<br />
Turns on an LED on for one second, then off for one second, repeatedly.<br />
<br />
This example code is in the public domain.<br />
*/<br />
<br />
void setup() { <br />
dummyvariablecuzmaintainerborkedthecompiler++; // stops the linker from removing the global variable<br />
<br />
// initialize the digital pin as an output.<br />
// Pin 13 has an LED connected on most Arduino boards:<br />
pinMode(13, OUTPUT); <br />
}<br />
<br />
void loop() {<br />
digitalWrite(13, HIGH); // set the LED on<br />
delay(1000); // wait for a second<br />
digitalWrite(13, LOW); // set the LED off<br />
delay(1000); // wait for a second<br />
}</nowiki>}}<br />
<br />
Related pages:<br />
* http://arduino.cc/forum/index.php/topic,56841.0.html<br />
* http://arduino.cc/forum/index.php/topic,49900.0.html<br />
* http://arduino.cc/forum/index.php?topic=59409.0.html<br />
<br />
Fedora has the same problem with binutils 2.21 ([https://bugzilla.redhat.com/show_bug.cgi?id=688645 bug report]).<br />
Downgraded packages that work are binutils-avr 2.20.1-3 and gcc-avr 4.5.1-2. <br />
There is also an upstream bug report [http://sourceware.org/bugzilla/show_bug.cgi?id=12757 here] but no one has replied yet.<br />
<br />
===Error when launching Arduino IDE===<br />
If you run the Arduino IDE as a normal user (you should do that of course), you may get this error message :<br />
'''check_group_uucp(): error testing lock file creation Error details:Permission denied'''<br />
<br />
This is probably because you don't have write permissions on ''/run/lock directory''. Try this to see if this solves your problem :<br />
{{bc|<br />
sudo chmod 777 /run/lock<br />
}}<br />
<br />
/run/lock is created on boot by /usr/lib/tmpfiles.d/legacy.conf (both on systemd and initscripts). So if you want to keep the permissions you set, simply copy the file /usr/lib/tmpfiles.d/legacy.conf to /etc/tmpfiles.d/ and edit it there (set 0777 permissions).<br />
You can look here<br />
<br />
=== Error opening serial port ===<br />
You may see the serial port initially when the IDE starts, but the TX/RX leds do nothing when uploading. You may have previously changed the baudrate in the serial monitor to something it does not like. Edit ~/.arduino/preferences.txt so that serial.debug_rate is a different speed, like 115200.<br />
<br />
=== Arduino Mega2560 and new gcc-avr ===<br />
<br />
If you are using gcc-avr >= 4.3.5 then there is a C++ bug in the gcc-avr toolchain which builds bad firmware for the Atmel2560 processors. gcc-avr must be rebuilt using a patch found at [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45263]. You can read more about the problems at [http://andybrown.me.uk/ws/2010/10/24/the-major-global-constructor-bug-in-avr-gcc/].<br />
<br />
Here is the patch for gcc:<br />
{{bc|<br />
--- gcc-4.5.1.orig/gcc/config/avr/libgcc.S 2009-05-23 17:16:07 +1000<br />
+++ gcc-4.5.1/gcc/config/avr/libgcc.S 2010-08-12 09:38:05 +1000<br />
@@ -802,7 +802,9 @@<br />
mov_h r31, r29<br />
mov_l r30, r28<br />
out __RAMPZ__, r20<br />
+ push r20<br />
XCALL __tablejump_elpm__<br />
+ pop r20<br />
.L__do_global_ctors_start:<br />
cpi r28, lo8(__ctors_start)<br />
cpc r29, r17<br />
@@ -843,7 +845,9 @@<br />
mov_h r31, r29<br />
mov_l r30, r28<br />
out __RAMPZ__, r20<br />
+ push r20<br />
XCALL __tablejump_elpm__<br />
+ pop r20<br />
.L__do_global_dtors_start:<br />
cpi r28, lo8(__dtors_end)<br />
cpc r29, r17<br />
}}<br />
<br />
The easiest way to rebuild gcc-avr is using ABS and makepkg.<br />
<br />
=== Missing twi.o ===<br />
<br />
If the file /usr/share/arduino/lib/targets/libraries/Wire/utility/twi.o does not exist arduino may try to create it. Normal users do not have permission to write there so this will fail. Run arduino as root so it can create the file, after the file has been created arduino can be run under a normal user.<br />
<br />
== Bugs ==<br />
<br />
This section is targeted at the package maintainers.<br />
<br />
{| border="1"<br />
! Symptom !! Cause / Upstream bug report !! Patches / Workarounds !! Patched Packages / End-User solutions<br />
|-<br />
| delay() sleeps forever || ??? || [https://wiki.archlinux.org/index.php/Arduino#delay.28.29_function_doesn.27t_work workaround] || none<br />
|-<br />
| progmem error || [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49764 bug in gcc-avr (fixed, but unreleased)] || [http://arduino.cc/forum/index.php/topic,66710.msg491529.html#msg491529 workaround] || [https://aur.archlinux.org/packages.php?ID=50146 aur/gcc-avr-svn] or [https://aur.archlinux.org/packages.php?ID=8388 aur/arduino]<br />
|}<br />
<br />
==See also==<br />
<br />
* http://bbs.archlinux.org/viewtopic.php?pid=295312<br />
* http://regomodoslinux.blogspot.com/2007/10/how-to-install-arduino-ide-in-archlinux.html<br />
* http://gunnewiek.com/2011/open-pde-files-with-arduino-ide-in-linux/<br />
* https://bbs.archlinux.org/viewtopic.php?pid=981348</div>Mirelsolhttps://wiki.archlinux.org/index.php?title=Arduino&diff=210473Arduino2012-06-19T19:40:39Z<p>Mirelsol: Problem when launching Arduino IDE</p>
<hr />
<div>[[Category:Development]]<br />
[[Category:Mathematics and science]]<br />
Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It is intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. More information is availible on the [http://www.arduino.cc/ Arduino HomePage].<br />
<br />
==Installation==<br />
<br />
* Install {{AUR|arduino}} from the [[Arch User Repository|AUR]].<br />
* Add yourself to the {{ic|uucp}} [[Users and Groups|group]]. (More information in the next section: "Accessing serial")<br />
<br />
==Configuration==<br />
<br />
===Accessing serial===<br />
<br />
The arduino board communicates with the PC via a serial connection or a serial over USB connection. So the user needs read/write access to the serial device file. [[Udev]] creates files in /dev/tts/ owned by group uucp so adding the user to the uucp group gives the required read/write access.<br />
<br />
gpasswd -a <user> uucp<br />
<br />
{{Note|You will have to logout and login again for this to take effect.}}<br />
<br />
Briefly run the {{ic|arduino}} command and stop it, then modify {{ic|~/.arduino/preferences.txt}} .<br />
<br />
Change serial port from COM1 to your serial port. With your arduino board connected, you can find out what your serial port is with:<br />
<br />
ls /dev/ttyUSB* /dev/ttyACM*<br />
<br />
If in doubt, unconnect the board and look which of these disappears, and/or monitor {{ic|/var/log/everything.log}}.<br />
<br />
The line to change in {{ic|~/.arduino/preferences.txt}} should look something like this when you are done:<br />
<br />
serial.port=/dev/ttyACM3<br />
<br />
Rerun {{ic|arduino}}. If you get a message like "Arduino Uno on COM1" message in the GUI's lower right corner, connection has been established.<br />
<br />
== stty ==<br />
<br />
Preparing<br />
stty -F /dev/ttyACM0 cs8 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts<br />
<br />
Sending commands through Terminal without new line after command<br />
echo -n "Hello World" > /dev/ttyACM0<br />
<br />
Reading what your Arduino has to tell you<br />
cat /dev/ttyACM0<br />
<br />
==Working with Uno/Mega2560==<br />
<br />
The Arduino Uno and Mega2560 have an onboard USB interface (an Atmel 8U2) that accepts serial data, so they are accessed through /dev/ttyACM0 created by the cdc-acm kernel module when it is plugged in.<br />
<br />
The 8U2 firmware may need an update to ease serial communications. See [http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286350399] for more details and reply #11 for a fix. The original arduino bbs, where you can find an image explaining how to get your Uno into DFU, is now in a read-only state. If you do not have an account to view the image, see [http://www.scribd.com/doc/45913857/Arduino-UNO].<br />
<br />
You can perform a general function test of the Uno by putting it in loopback mode and typing characters into the arduino serial monitor at 115200 baud. It should echo the characters back to you. To put it in loopback, short pins 0 -> 1 on the digital side and either hold the reset button or short the GND -> RESET pins while you type.<br />
<br />
== Running Arduino Uno ==<br />
<br />
Once Arduino is running you must ensure you have selected the correct board from the Tools->Boards menu item:<br />
Arduino Uno<br />
<br />
Secondly you must ensure you have selected the correct serial port from the Tools->Serial Port menu item as explained above.<br />
<br />
Once these are done you should be able to write and upload sketches to your Arduino Uno without any issues.<br />
<br />
==Alternatives for IDE==<br />
<br />
===ArduIDE===<br />
<br />
ArduIDE is a Qt-based IDE for Arduino. {{aur|arduide-git}} is available in the [[AUR]].<br />
<br />
If you prefer working from terminal, below there are some other options to choose from.<br />
<br />
===gnoduino===<br />
<br />
{{aur|gnoduino}} is an implementation of original Arduino IDE for GNOME available in the [[AUR]]. The original Arduino IDE software is written in Java. This is a Python implementation and it is targeted at GNOME but will work on xfce4 and other WM. Its purpose is to be light, while maintaining compatibility with the original Arduino IDE. The source editor is based on gtksourceview.<br />
<br />
===Scons===<br />
<br />
Using [http://www.scons.org/ scons] together with [http://code.google.com/p/arscons/ arscons] it is very easy to use to compile and upload Arduino projects from the command line. Scons is based on python and you will need python-pyserial to use the serial interface. Install everything with<br />
<br />
# pacman -S python-pyserial scons<br />
<br />
That will get the dependencies you need too. You will also need Arduino itself so install it as described above. Create project directory (eg. test), then create a arduino project file in your new directory. Use the same name as the directory and add .pde (eg. test.pde). Get the [http://arscons.googlecode.com/git/SConstruct SConstruct] script from arscons and put it in your directory. Have a peek in it and, if necessary, edit it. It is a python script. Edit your project as you please, then run<br />
<br />
$ scons # This will build the project<br />
$ scons upload # This will upload the project to your Arduino<br />
<br />
===Makefile===<br />
Update 2011-03-12. Arduino Is not shipping a Makefile with version (22). The Makefile from the [http://code.google.com/p/dogm128/source/browse/libraries/Dogm/examples/SpaceTrash/Makefile.uno_dogs102 dogm128] project works for me though.<br />
<br />
Instead of using the arduino IDE it is possible to use another editor and a Makefile.<br />
<br />
Set up a directory to program your Arduino and copy the Makefile into this directory. A copy of the Makefile can be obtained from /usr/share/arduino/hardware/cores/arduino/Makefile<br />
<br />
You will have to modify this a little bit to reflect your settings. The makefile should be pretty self explainatory. Here are some lines you may have to edit.<br />
<br />
PORT = usually /dev/ttyUSBx, where x is the usb serial port your arduino is plugged into<br />
TARGET = your sketch's name<br />
ARDUINO = /usr/share/arduino/lib/targets/arduino<br />
<br />
Depending on which library functions you call in your sketch, you may need to compile parts of the library. To do that you need to edit your SRC and CXXSRC to include the required libraries.<br />
<br />
Now you should be able to make && make upload to your board to execute your sketch.<br />
<br />
===Arduino-CMake===<br />
<br />
Using [https://github.com/queezythegreat/arduino-cmake arduino-cmake] and [http://www.cmake.org/cmake/resources/software.html CMake] you can build Arduino firmware from the command line using multiple build systems. CMake lets you generate the build system that fits your needs, using the tools you like. It can generate any type of build system, from simple Makefiles, to complete projects for Eclipse, Visual Studio, XCode, etc.<br />
<br />
Requirements:<br />
* [http://www.archlinux.org/packages/?sort=&q=cmake CMake]<br />
* [https://aur.archlinux.org/packages.php?ID=8388 Arduino SDK]<br />
* [http://www.archlinux.org/packages/?sort=&q=gcc-avr gcc-avr]<br />
* [http://www.archlinux.org/packages/?sort=&q=binutils-avr binutils-avr]<br />
* [http://www.archlinux.org/packages/?sort=&q=avr-libc avr-libc]<br />
* [http://www.archlinux.org/packages/?sort=&q=avrdude avrdude]<br />
<br />
==Troubleshooting==<br />
<br />
===delay() function does not work===<br />
{{Out of date|the current arduino-git package is reported in the talk page as not being affected by this issue.|section=Update troubleshooting?}}<br />
There are some cases where the delay() function does not work, causing programs such as the example [http://www.arduino.cc/en/Tutorial/Blink Blink] to malfunction. <br />
It appears that the Arch compiler sometimes generates code that writes to addresses before the start of memory. RAM starts at address 0x200 on the mega, but the Blink code has the delay() timer variables located at 0x100-0x10b. This only seems to happen when the code contains no initialized global variables (.data segment in asm-speak) - the linker is told that the data segment starts at 0x200, but if there is nothing to go in it it generates an incorrect start address for the uninitialized global variables (.bss segment). Since the timer variables are uninitialized globals (or globals initialized to zero) they end up at an illegal address.<br />
<br />
There are currently two ways to bypass this issue.<br />
<br />
* Use '''Serial.begin(9600);''' in '''setup()''' function. [[http://forums.adafruit.com/viewtopic.php?f=25&t=21075 Source post]] <br />
<br />
{{bc|<br />
/*<br />
Blink<br />
Turns on an LED on for one second, then off for one second, repeatedly.<br />
<br />
This example code is in the public domain.<br />
*/<br />
<br />
void setup() { <br />
// initialize the digital pin as an output.<br />
// Pin 13 has an LED connected on most Arduino boards:<br />
pinMode(13, OUTPUT); <br />
Serial.begin(9600);<br />
}<br />
<br />
void loop() {<br />
digitalWrite(13, HIGH); // set the LED on<br />
delay(1000); // wait for a second<br />
digitalWrite(13, LOW); // set the LED off<br />
delay(1000); // wait for a second<br />
}<br />
}}<br />
<br />
* Use an initialized global variable. [[http://arduino.cc/forum/index.php/topic,49900.msg363688.html#msg363688 Source post]]<br />
<br />
{{bc|<nowiki><br />
char dummyvariablecuzmaintainerborkedthecompiler = 123; // force something into the .data segment with non-zero initializer<br />
/*<br />
Blink<br />
Turns on an LED on for one second, then off for one second, repeatedly.<br />
<br />
This example code is in the public domain.<br />
*/<br />
<br />
void setup() { <br />
dummyvariablecuzmaintainerborkedthecompiler++; // stops the linker from removing the global variable<br />
<br />
// initialize the digital pin as an output.<br />
// Pin 13 has an LED connected on most Arduino boards:<br />
pinMode(13, OUTPUT); <br />
}<br />
<br />
void loop() {<br />
digitalWrite(13, HIGH); // set the LED on<br />
delay(1000); // wait for a second<br />
digitalWrite(13, LOW); // set the LED off<br />
delay(1000); // wait for a second<br />
}</nowiki>}}<br />
<br />
Related pages:<br />
* http://arduino.cc/forum/index.php/topic,56841.0.html<br />
* http://arduino.cc/forum/index.php/topic,49900.0.html<br />
* http://arduino.cc/forum/index.php?topic=59409.0.html<br />
<br />
Fedora has the same problem with binutils 2.21 ([https://bugzilla.redhat.com/show_bug.cgi?id=688645 bug report]).<br />
Downgraded packages that work are binutils-avr 2.20.1-3 and gcc-avr 4.5.1-2. <br />
There is also an upstream bug report [http://sourceware.org/bugzilla/show_bug.cgi?id=12757 here] but no one has replied yet.<br />
<br />
===Error when launching Arduino IDE===<br />
If you run the Arduino IDE as a normal user (you should do that of course), you may get this error message :<br />
'''check_group_uucp(): error testing lock file creation Error details:Permission denied'''<br />
<br />
This is probably because you don't have write permissions on ''/run/lock directory''. Try this to see if this solves your problem :<br />
{{bc|<br />
sudo chmod 777 /run/lock<br />
}}<br />
<br />
/run/lock is created on boot by /usr/lib/tmpfiles.d/legacy.conf (both on systemd and initscripts). So if you want to keep the permissions you set, , simply copy the file /usr/lib/tmpfiles.d/legacy.conf to /etc/tmpfiles.d/ and edit it there (set 0777 permissions).<br />
You can look here<br />
<br />
=== Error opening serial port ===<br />
You may see the serial port initially when the IDE starts, but the TX/RX leds do nothing when uploading. You may have previously changed the baudrate in the serial monitor to something it does not like. Edit ~/.arduino/preferences.txt so that serial.debug_rate is a different speed, like 115200.<br />
<br />
=== Arduino Mega2560 and new gcc-avr ===<br />
<br />
If you are using gcc-avr >= 4.3.5 then there is a C++ bug in the gcc-avr toolchain which builds bad firmware for the Atmel2560 processors. gcc-avr must be rebuilt using a patch found at [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45263]. You can read more about the problems at [http://andybrown.me.uk/ws/2010/10/24/the-major-global-constructor-bug-in-avr-gcc/].<br />
<br />
Here is the patch for gcc:<br />
{{bc|<br />
--- gcc-4.5.1.orig/gcc/config/avr/libgcc.S 2009-05-23 17:16:07 +1000<br />
+++ gcc-4.5.1/gcc/config/avr/libgcc.S 2010-08-12 09:38:05 +1000<br />
@@ -802,7 +802,9 @@<br />
mov_h r31, r29<br />
mov_l r30, r28<br />
out __RAMPZ__, r20<br />
+ push r20<br />
XCALL __tablejump_elpm__<br />
+ pop r20<br />
.L__do_global_ctors_start:<br />
cpi r28, lo8(__ctors_start)<br />
cpc r29, r17<br />
@@ -843,7 +845,9 @@<br />
mov_h r31, r29<br />
mov_l r30, r28<br />
out __RAMPZ__, r20<br />
+ push r20<br />
XCALL __tablejump_elpm__<br />
+ pop r20<br />
.L__do_global_dtors_start:<br />
cpi r28, lo8(__dtors_end)<br />
cpc r29, r17<br />
}}<br />
<br />
The easiest way to rebuild gcc-avr is using ABS and makepkg.<br />
<br />
=== Missing twi.o ===<br />
<br />
If the file /usr/share/arduino/lib/targets/libraries/Wire/utility/twi.o does not exist arduino may try to create it. Normal users do not have permission to write there so this will fail. Run arduino as root so it can create the file, after the file has been created arduino can be run under a normal user.<br />
<br />
== Bugs ==<br />
<br />
This section is targeted at the package maintainers.<br />
<br />
{| border="1"<br />
! Symptom !! Cause / Upstream bug report !! Patches / Workarounds !! Patched Packages / End-User solutions<br />
|-<br />
| delay() sleeps forever || ??? || [https://wiki.archlinux.org/index.php/Arduino#delay.28.29_function_doesn.27t_work workaround] || none<br />
|-<br />
| progmem error || [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49764 bug in gcc-avr (fixed, but unreleased)] || [http://arduino.cc/forum/index.php/topic,66710.msg491529.html#msg491529 workaround] || [https://aur.archlinux.org/packages.php?ID=50146 aur/gcc-avr-svn] or [https://aur.archlinux.org/packages.php?ID=8388 aur/arduino]<br />
|}<br />
<br />
==See also==<br />
<br />
* http://bbs.archlinux.org/viewtopic.php?pid=295312<br />
* http://regomodoslinux.blogspot.com/2007/10/how-to-install-arduino-ide-in-archlinux.html<br />
* http://gunnewiek.com/2011/open-pde-files-with-arduino-ide-in-linux/<br />
* https://bbs.archlinux.org/viewtopic.php?pid=981348</div>Mirelsol