ni-c / heimcontrol.js

Home-Automation with node.js and Raspberry PI
MIT License
1.41k stars 297 forks source link

gpio input not working #4

Closed bkiss closed 11 years ago

bkiss commented 11 years ago

I want to use the raspberry-s gpio port for reading inputs also, output its working great.

I want to see the state of the relays, even after system restart, and for this i wanted to use some of the gpio ports to see if it's on or off.

First of all I cannot set on the gpio settings page the direction to input, every tine when i hit save, it comes back to output.

I went to the database, and i changed there, from output to input, but alway i have the down state, even if i see with command line gpio readall the changing state.

Thank you.

oefterdal commented 11 years ago

I have the same issue

ni-c commented 11 years ago

Works for me.

Might be a problem with the PI-GPIO Module (https://github.com/rakeshpai/pi-gpio/) and newer Raspberry Models: https://github.com/rakeshpai/pi-gpio/pull/2

oefterdal commented 11 years ago

I have the first revision

On 2. sep. 2013, at 18:14, Willi Thiel notifications@github.com wrote:

Works for me.

Might be a problem with the PI-GPIO Module (https://github.com/rakeshpai/pi-gpio/) and newer Raspberry Models: rakeshpai/pi-gpio#2

— Reply to this email directly or view it on GitHub.

bkiss commented 11 years ago

Thank you for your feedback,

I will check the pi-gpio code maybe we will find a solution. I use Model B with 512MB RAM.

Off-topic: I modified the arduino code to read DHT22 sensors with success.

Thank you again.

ni-c commented 11 years ago

I have installed the newest Raspian on my Raspberry to identify the problem, there might be some changes in the GPIO device. heimcontrol.js is looking in /sys/devices/virtual/gpio/gpio17/, but this device does not exist in the new Raspian version.

{ [Error: ENOENT, open '/sys/devices/virtual/gpio/gpio17/value']
  errno: 34,
  code: 'ENOENT',
  path: '/sys/devices/virtual/gpio/gpio17/value' }
pi@heimcontrol:/sys/devices/virtual/gpio$ ls -l
total 0
drwxr-xr-x 3 root root 0 Sep  7 17:38 gpiochip0
bkiss commented 11 years ago

Look, what i find:

https://github.com/quick2wire/quick2wire-gpio-admin

we need to export the gpio pins...

I will try, and i will come back ...

Barni

bkiss commented 11 years ago

After export, it's possible to set the direction in the gpio settings page, but in the main window does not sensing the state of the pin, it's always down. :(

I hope to help you with tis information.

bkiss commented 11 years ago

Ok,

If i export with the following command:

gpio-admin export 22

and set in the settings panel in web interface PIN 15 -- INPUT

Everything is ok.

Ps. yesterday the export was with sudo gpio-admin export 22 ---> maybe this was the problem.

For mongopi stabilty improovement: turn on journalling for mongopi, because without jurnalling mongod deamon doas not start after power failure, or without proper shutdown.

I think the case is closed.

Thank you for your help.