Skip to content
This repository was archived by the owner on Nov 12, 2019. It is now read-only.

Commit 98df7ee

Browse files
committed
Bump version for root-less access change.
2 parents 8383571 + 1348fa6 commit 98df7ee

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

Adafruit_DHT/Raspberry_Pi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def read(sensor, pin):
3131
# Signal no result could be obtained, but the caller can retry.
3232
return (None, None)
3333
elif result == common.DHT_ERROR_GPIO:
34-
raise RuntimeError('Error accessing GPIO. Make sure program is run as root with sudo!')
34+
raise RuntimeError('Error accessing GPIO.')
3535
elif result != common.DHT_SUCCESS:
3636
# Some kind of error occured.
3737
raise RuntimeError('Error calling DHT test driver read: {0}'.format(result))

Adafruit_DHT/Raspberry_Pi_2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def read(sensor, pin):
3131
# Signal no result could be obtained, but the caller can retry.
3232
return (None, None)
3333
elif result == common.DHT_ERROR_GPIO:
34-
raise RuntimeError('Error accessing GPIO. Make sure program is run as root with sudo!')
34+
raise RuntimeError('Error accessing GPIO.')
3535
elif result != common.DHT_SUCCESS:
3636
# Some kind of error occured.
3737
raise RuntimeError('Error calling DHT test driver read: {0}'.format(result))

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Install the library by downloading with the download link on the right, unzippin
1919
````
2020
sudo python setup.py install
2121
````
22+
You can ommit the sudo if you use raspberry pi.
2223

2324
See example of usage in the examples folder.
2425

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272

7373
# Call setuptools setup function to install package.
7474
setup(name = 'Adafruit_DHT',
75-
version = '1.2.0',
75+
version = '1.3.0',
7676
author = 'Tony DiCola',
7777
author_email = 'tdicola@adafruit.com',
7878
description = 'Library to get readings from the DHT11, DHT22, and AM2302 humidity and temperature sensors on a Raspberry Pi or Beaglebone Black.',

source/Raspberry_Pi/pi_mmio.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ volatile uint32_t* pi_mmio_gpio = NULL;
3737

3838
int pi_mmio_init(void) {
3939
if (pi_mmio_gpio == NULL) {
40-
int fd = open("/dev/mem", O_RDWR | O_SYNC);
40+
int fd = open("/dev/gpiomem", O_RDWR | O_SYNC);
4141
if (fd == -1) {
42-
// Error opening /dev/mem. Probably not running as root.
42+
// Error opening /dev/gpiomem.
4343
return MMIO_ERROR_DEVMEM;
4444
}
4545
// Map GPIO memory to location in process space.

source/Raspberry_Pi_2/pi_2_mmio.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ int pi_2_mmio_init(void) {
5353
uint32_t gpio_base = peri_base + GPIO_BASE_OFFSET;
5454
fclose(fp);
5555

56-
int fd = open("/dev/mem", O_RDWR | O_SYNC);
56+
int fd = open("/dev/gpiomem", O_RDWR | O_SYNC);
5757
if (fd == -1) {
58-
// Error opening /dev/mem. Probably not running as root.
58+
// Error opening /dev/gpiomem.
5959
return MMIO_ERROR_DEVMEM;
6060
}
6161
// Map GPIO memory to location in process space.

0 commit comments

Comments
 (0)