Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to update ports when running c++ complied file through PHP #26

Open
kworsfold opened this issue Feb 23, 2014 · 1 comment
Open

Comments

@kworsfold
Copy link

Hi

I have created and complied, setting correct permissions making all users executable.

Problem is when run without line 'gz_spi_set(0x06);' it works fine through Web Interface, but when added I get...
[0] => error opening /dev/spidev0.0
[1] => ERROR while sending

When run using command line runs smoothly.

I am thinking this is a permissions problem within 'gz_spi.h' as it is unable to access 'spidev'

Can you help...

@campbellsan
Copy link
Contributor

Yes, that is a generic permissions issue. You would have the same error if you were using any SPI hardware not just Guzunty.

One possibility is to run your php daemon with root permissions, which is obviously a potential security risk, so you might not want to do this. I don't know enough about PHP to know how to make this change. You can try asking about this in your preferred generic RPi forum.

Another thing which may work would be to rebuild the gz library to use the alternative "/sys/class/spidev/spidev0.0" device. I think this approach may have performance implications, but I don't think they will be significant for most applications.

I may get a chance to try this approach over the next few days, or let me know how you get on with trying it yourself if you get there first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants