2

I would like to configure my gpio pins, but I cannot dipslay documentation over man gpio command. This is the result of command:

man: can't set the locale; make sure $LC_* and $LANG are correct
No manual entry for gpio
See 'man 7 undocumented' for help when manual pages are not available.

Can anybody tell me where is the problem?

> locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_GB.UTF-8
LANGUAGE=
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC=cs_CZ.UTF-8
LC_TIME=cs_CZ.UTF-8
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY=cs_CZ.UTF-8
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER=cs_CZ.UTF-8
LC_NAME=cs_CZ.UTF-8
LC_ADDRESS=cs_CZ.UTF-8
LC_TELEPHONE=cs_CZ.UTF-8
LC_MEASUREMENT=cs_CZ.UTF-8
LC_IDENTIFICATION=cs_CZ.UTF-8
LC_ALL=

I set LC_ALL by adding a line to .bashrc:

export LC_ALL="en_US.UTF-8"
goldilocks
  • 58,859
  • 17
  • 112
  • 227
dorinand
  • 127
  • 1
  • 4
  • 1
    You may want to use raspi-config (Internationalisation Options -> Set up language and regional settings) to correct the locale properly. This may require a reboot or a log out and back in again, I'm not sure. – goldilocks Jul 17 '16 at 14:06

3 Answers3

5

Presumably the gpio utility is not installed.

The gpio utility is bundled with the wiringPi library.

Install wiringPi (if using Raspbian) with

sudo apt-get install wiringpi

The gpio command should then work.


EDITED TO ADD

My assumption is wrong, the man pages are not installed with the Raspbian wiringPi package.

One work around is

git clone git://git.drogon.net/wiringPi

cd wiringPi

cd gpio

sudo cp gpio.1 /usr/local/man/man1
joan
  • 71,024
  • 5
  • 73
  • 106
  • I already have installed wiringpi. Do you havy any other idea how to solve this issue? – dorinand Jul 17 '16 at 14:28
  • No, you must have installed wiringPi in a non-standard way. – joan Jul 17 '16 at 14:37
  • Well, I admit I can't remember how I installed wiringPi. I unninstalled it right now by sudo apt-get --purge remove wiringpi command and install it again by sudo -apt-get install wiringpi. It did not help. – dorinand Jul 17 '16 at 14:59
  • @dorinand My apologies, I thought the man pages were installed as part of the wiringPi package. I've just re-installed myself and they are not. – joan Jul 17 '16 at 15:22
  • It is no problem. Do you have any idea how to solve this ? I can find documentation about gpio on the internet, but I would like to have it reacheable over terminal. – dorinand Jul 17 '16 at 15:43
  • @dorinand I have edited my answer to suggest a work around. – joan Jul 17 '16 at 15:49
  • I did it step by step but the problem persist. – dorinand Jul 17 '16 at 16:21
  • @dorinand I'm out of ideas. Does man work with any pages? e.g. does man strlen return a page? – joan Jul 17 '16 at 16:26
  • Yes, it is work fine. I use it normaly for other commands but it not working for gpio. Thank you enyway. When I will find out where is the problem, I will add a comment here. – dorinand Jul 17 '16 at 16:28
  • Does the command manpath show /usr/local/man? – joan Jul 17 '16 at 16:33
  • It shows this: manpath: can't set the locale; make sure $LC_* and $LANG are correct /usr/local/man:/usr/local/share/man:/usr/share/man:/usr/man – dorinand Jul 17 '16 at 16:35
  • All that I have left is to try @goldilocks suggestion of setting the locale properly with sudo raspi-config. – joan Jul 17 '16 at 16:48
4

You should fix the locale and other internationalisation options (using raspi-config and not trying to manually configure). This issue is unrelated to gpio.

gpio was NOT included with Wheezy and required manual installation but was included with Jessie. Unfortunately something in the update process seemed to have removed gpio in full or part as it uninstalled the wiringpi library.

I asked questions about this, but never managed to get a satisfactory answer. https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=148471&p=976588&hilit=+wiringpi#p976588

I "fixed" this with

sudo apt-get purge wiringpi
sudo apt-get install wiringpi

This is preferable to the manual installation procedure, as it will ensure the latest version is installed.

As joan has pointed out the man pages for gpio are not installed by the manual procedure or from the repository, but can be added.

Milliways
  • 59,890
  • 31
  • 101
  • 209
0

$ cd
$ git clone https://github.com/WiringPi/WiringPi.git
$ cd ~/wiringPi
$ ./build

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review – Chenmunka Apr 21 '23 at 16:33
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. – Community Apr 21 '23 at 16:34