linwiz / Raspberry-Pi-Web-GPIO

PHP script to control Raspberry PI GPIO pins from the web
GNU General Public License v3.0
4 stars 1 forks source link

db schema for B+ changed so pinID is true board pin# #26

Closed Paku- closed 9 years ago

Paku- commented 9 years ago

This is just and idea how the board table should looks like.

Pls do not merge it it's just for your review.

Have no idea if the service script will work on it or no, pls look closer if we can use it. (you can grab branch from my repo)

In simple words the db should correspond to the true board logic ..

Other thing is that boards are compatible on the pin level so v1 up to v3 should work on the same table but using limited rows access.

Paku- commented 9 years ago

demo script change added in 4d3cb06

Paku- commented 9 years ago

I'm working on db and script hope you are not doing the same ...

Paku- commented 9 years ago

Does the script only sets pins in OUT mode if enabled ???

linwiz commented 9 years ago

yes

Paku- commented 9 years ago

So we have to cover the IN pins as well ...

linwiz commented 9 years ago

Eventually, yes but I am trying to take this one step at a time

Paku- commented 9 years ago

sure ...

linwiz commented 9 years ago

Was there a reason you chose WHERE concat('',pinNumberBCM * 1) = pinNumberBCM and not WHERE pinNumberBCM REGEXP '[0-9]+';?

Paku- commented 9 years ago

isn't it the same ??, just found somewhere it's faster .. and I hate regexpr as the bash as well (nor I'm good in it).... BTW it took me 1h to find how to put line elements into the array ... >>> arr=($this_pin) .. hate scripts ...

linwiz commented 9 years ago

The end result is the same, I didn't know concat was faster. I suck at regex as well but sometimes regex is the way to go.

Paku- commented 9 years ago

Have the idea how to make script faster but I am to short on bash knowledge,so will push my work here. Look at it you will finish it much faster ... The main idea is to limit mySQL CLI calls to just one inside the loop.

Paku- commented 9 years ago

Create new branch and merge it into it. Then after edit you can merge into ajax. (0f543c9)

Paku- commented 9 years ago

I am here so can help on git.

Paku- commented 9 years ago

or just checkout the db_update branch from my repo then pull the request. I will then send it to ajax ...

Paku- commented 9 years ago

@linwiz OK ??

linwiz commented 9 years ago

You're definitely helping. I like the work you are doing, and good catch on the speed update, maybe the other mysql calls can be done away with also.

Paku- commented 9 years ago

thanks .. can you finish it ??

linwiz commented 9 years ago

I think so lol

Paku- commented 9 years ago

but you have merge into ajax ... is there any option to merge into NEW branch (on github) ?? If no it's ok, but now ajax head is filled with broken code /not runnig/ so if any other dev would like to help, he will get not running code what's bad for master like branch ... good there are only two of us here :)

Paku- commented 9 years ago

Check out the details, so B and B+ (v2 and v3) boards are pinout compatible. It means we do not need separate tables for them we just have to limit the first select in the service so for v2 we only see pins 1-26 while for v3 1-40.

linwiz commented 9 years ago

In that case, the RPi Compute module with like 60 gpios can use the v2 table as well.