changed path for exporting pins #6

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
@rexington

the devices/virtual path wasn't working, but this one does work.

changed path for exporting pins
the devices/virtual path wasn't working, but this one does work.
@DaWoody

This comment has been minimized.

Show comment
Hide comment
@DaWoody

DaWoody Mar 3, 2015

Must just say good job, it works! I am running a pi b +, with recent firmware etc, Did some manual changes to the file that was changed according to this commit, namely the file gpio-admin.c which can be found within the folder structure quick2wire-gpio-admin/src/gpio-admin.c and replaced the path as described in files changed (look at the tab files changed to get a visual). Did a "sudo make uninstall" from within the quick2wire-gpio-admin folder, then "sudo make install" and added the user "sudo adduser $USER gpio" (where $USER is your user..). Logout and login, and then voila it works! :) Just wanted to overexplain some stuff here incase somebody was struggling. But anyways thanks for this fix, good job 👍

DaWoody commented Mar 3, 2015

Must just say good job, it works! I am running a pi b +, with recent firmware etc, Did some manual changes to the file that was changed according to this commit, namely the file gpio-admin.c which can be found within the folder structure quick2wire-gpio-admin/src/gpio-admin.c and replaced the path as described in files changed (look at the tab files changed to get a visual). Did a "sudo make uninstall" from within the quick2wire-gpio-admin folder, then "sudo make install" and added the user "sudo adduser $USER gpio" (where $USER is your user..). Logout and login, and then voila it works! :) Just wanted to overexplain some stuff here incase somebody was struggling. But anyways thanks for this fix, good job 👍

@maxbanas

This comment has been minimized.

Show comment
Hide comment
@maxbanas

maxbanas Apr 9, 2015

Thanks all, worked for me too.

maxbanas commented Apr 9, 2015

Thanks all, worked for me too.

@windmaomao

This comment has been minimized.

Show comment
Hide comment
@windmaomao

windmaomao Apr 11, 2015

this works, especially after following DaWoody's comments.

this works, especially after following DaWoody's comments.

@lurch lurch referenced this pull request May 5, 2015

Open

Update gpio-admin.c #8

@xristocodos

This comment has been minimized.

Show comment
Hide comment
@xristocodos

xristocodos May 22, 2015

Thanks DaWoody you DaRealMVP

Thanks DaWoody you DaRealMVP

@solaron99

This comment has been minimized.

Show comment
Hide comment
@solaron99

solaron99 Jun 22, 2015

Thanks all,

Successfully rectified my group ownership issue after upgrading. I'm currently running version 3.18.5, model B+. I receive the following in Terminal:

Listening on port 3600
State on received.

The LED connected to GPIO pin #36 FLASH quickly ONCE and turns OFF when pressing 'ON' button on the web server page. The led functioned perfectly prior to the update.

Any suggestions? Thank you!

Thanks all,

Successfully rectified my group ownership issue after upgrading. I'm currently running version 3.18.5, model B+. I receive the following in Terminal:

Listening on port 3600
State on received.

The LED connected to GPIO pin #36 FLASH quickly ONCE and turns OFF when pressing 'ON' button on the web server page. The led functioned perfectly prior to the update.

Any suggestions? Thank you!

@singinglarvae

This comment has been minimized.

Show comment
Hide comment
@singinglarvae

singinglarvae Jul 24, 2015

Hello,

I just followed this fix, but I face exactly the same issue as solaron99 on another GPIO (#4) : the LED flash (and I can hear the relay switch) but quickly and then turns OFF after 1sec...

Hello,

I just followed this fix, but I face exactly the same issue as solaron99 on another GPIO (#4) : the LED flash (and I can hear the relay switch) but quickly and then turns OFF after 1sec...

@ccforward

This comment has been minimized.

Show comment
Hide comment

There's an answer to fix it.

https://github.com/nickfloyd/raspberry-beacons

@knocte

This comment has been minimized.

Show comment
Hide comment
@knocte

knocte Oct 19, 2015

Why this hasn't been merged yet?

knocte commented Oct 19, 2015

Why this hasn't been merged yet?

@knocte

This comment has been minimized.

Show comment
Hide comment
@knocte

knocte Oct 19, 2015

Actually there's a better fix: #7

knocte commented Oct 19, 2015

Actually there's a better fix: #7

@lurch

This comment has been minimized.

Show comment
Hide comment
@lurch

lurch Oct 19, 2015

This hasn't been merged yet because the entire quick2wire software stack has unfortunately been completely abandoned by the original authors.
The last code-commit to any of the https://github.com/quick2wire projects was back in June 2013 :-/

lurch commented Oct 19, 2015

This hasn't been merged yet because the entire quick2wire software stack has unfortunately been completely abandoned by the original authors.
The last code-commit to any of the https://github.com/quick2wire projects was back in June 2013 :-/

@jfig

This comment has been minimized.

Show comment
Hide comment
@jfig

jfig Nov 17, 2015

works, solves the problem

jfig commented on e1974dd Nov 17, 2015

works, solves the problem

@mstaffeld

This comment has been minimized.

Show comment
Hide comment
@mstaffeld

mstaffeld Jan 11, 2016

Thanks for the fix.

Thanks for the fix.

@crowelch

This comment has been minimized.

Show comment
Hide comment
@crowelch

crowelch Jan 15, 2016

Worked great thanks!

Worked great thanks!

@solaron99

This comment has been minimized.

Show comment
Hide comment
@solaron99

solaron99 Jan 18, 2016

Gentlemen,

I followed your suggestions but fail to resolve my issue.
The LED connected to GPIO pin #36 FLASH ONCE and turns OFF when pressing 'ON' button on the web server page. The LED turned on and REMAINED ON perfectly prior to updating to 3.18.11.

gpio-admin.c :

int size = snprintf(path, PATH_MAX, "/sys/class/gpio/gpio%u/%s", pin, filename);

pi-gpio.js :

var gpioAdmin = "gpio-admin",
sysFsPathOld = "/sys/devices/virtual/gpio", // pre 3.18.x kernel
sysFsPathNew = "/sys/class/gpio", // post 3.18.x kernel
sysFsPath;

app.js :

// Apply command GPIO #36

if (queryData.state == 'on') {
  gpio.open(36, "output", function(err) {     
    gpio.write(36, 1, function() {  
        gpio.close(36);             
            console.log("GPIO Pin 36: " + queryData.state + " received.");                
    });
});
}

if (queryData.state == 'off') {
gpio.open(36, "output", function(err) {     
    gpio.write(36, 0, function() {  
        gpio.close(36);    
        console.log("GPIO Pin 36: " + queryData.state + " received.");                
    });
});
} 

Any suggestions? Thank you!

Gentlemen,

I followed your suggestions but fail to resolve my issue.
The LED connected to GPIO pin #36 FLASH ONCE and turns OFF when pressing 'ON' button on the web server page. The LED turned on and REMAINED ON perfectly prior to updating to 3.18.11.

gpio-admin.c :

int size = snprintf(path, PATH_MAX, "/sys/class/gpio/gpio%u/%s", pin, filename);

pi-gpio.js :

var gpioAdmin = "gpio-admin",
sysFsPathOld = "/sys/devices/virtual/gpio", // pre 3.18.x kernel
sysFsPathNew = "/sys/class/gpio", // post 3.18.x kernel
sysFsPath;

app.js :

// Apply command GPIO #36

if (queryData.state == 'on') {
  gpio.open(36, "output", function(err) {     
    gpio.write(36, 1, function() {  
        gpio.close(36);             
            console.log("GPIO Pin 36: " + queryData.state + " received.");                
    });
});
}

if (queryData.state == 'off') {
gpio.open(36, "output", function(err) {     
    gpio.write(36, 0, function() {  
        gpio.close(36);    
        console.log("GPIO Pin 36: " + queryData.state + " received.");                
    });
});
} 

Any suggestions? Thank you!

@rmzamith

This comment has been minimized.

Show comment
Hide comment
@rmzamith

rmzamith Jul 26, 2016

@solaron99 , try removing the gpio.close(36); lines

@solaron99 , try removing the gpio.close(36); lines

@solaron99

This comment has been minimized.

Show comment
Hide comment
@solaron99

solaron99 Jul 26, 2016

great, thank you! Will keep you posted on the results -ron

On Jul 26, 2016, at 09:15, rmzamith notifications@github.com wrote:

@solaron99 , try removing the gpio.close(36); lines


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

great, thank you! Will keep you posted on the results -ron

On Jul 26, 2016, at 09:15, rmzamith notifications@github.com wrote:

@solaron99 , try removing the gpio.close(36); lines


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@rbosneag

This comment has been minimized.

Show comment
Hide comment
@rbosneag

rbosneag Sep 29, 2016

Finally got it working thanks to @DaWoody and @rexington !

It would be great to have a robust library with no requirements to abandoned packages, up to date with the latest Raspbian, with better support for RasPi 3 - just working.

I'm new to the Raspi world and really hoped there was better support for NodeJs. Other than these pi-gpio guys' great work there are no viable options to get up and running with building the next IoT awesome products.

Finally got it working thanks to @DaWoody and @rexington !

It would be great to have a robust library with no requirements to abandoned packages, up to date with the latest Raspbian, with better support for RasPi 3 - just working.

I'm new to the Raspi world and really hoped there was better support for NodeJs. Other than these pi-gpio guys' great work there are no viable options to get up and running with building the next IoT awesome products.

@lurch

This comment has been minimized.

Show comment
Hide comment
@lurch

lurch Sep 29, 2016

I dunno if it's what you're looking for, but https://gpiozero.readthedocs.io is very comprehensive and included in Raspbian by default.

lurch commented Sep 29, 2016

I dunno if it's what you're looking for, but https://gpiozero.readthedocs.io is very comprehensive and included in Raspbian by default.

@rbosneag

This comment has been minimized.

Show comment
Hide comment
@rbosneag

rbosneag Sep 29, 2016

Thanks for the tip, it looks very promising.
I was looking for a Javascript library but gpiozero could be a good source of inspiration for many projects and a good guide on GPIO.

Thanks for the tip, it looks very promising.
I was looking for a Javascript library but gpiozero could be a good source of inspiration for many projects and a good guide on GPIO.

@zengdongbao

This comment has been minimized.

Show comment
Hide comment
@zengdongbao

zengdongbao Dec 3, 2016

thanks guy! is work for me.

thanks guy! is work for me.

@solaron99

This comment has been minimized.

Show comment
Hide comment
@solaron99

solaron99 Feb 13, 2017

@rmzamith Your solution worked! Thank you.

@rmzamith Your solution worked! Thank you.

@jin5354 jin5354 referenced this pull request in jin5354/404forest Feb 22, 2017

Open

使用pi-gpio控制树莓派GPIO #25

@ghost

ghost approved these changes Dec 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment