Commits

Sebastian Bub committed 330c967

fixed a hard bug: digital input ports were not read

Comments (0)

Files changed (4)

 * You can define a toggle time for an output port (i.e. if you want to turn
   a port on for a defined period of time, it can be done with a single request). 
 * You can set a simulation mode for testing your client.
-* Setting multiple ports in one requests are set one after another, but the code
+* Controlling multiple ports in one requests are set one after another, but the code
   is optimized and nothing unnecessary is done in between (it takes about 2-5ms on an idle Raspberry Pi to set all 17 ports, some artificial load (e.g.'find /' in the background) will slow it down to 10-15ms).
 * Cronjobs (exact to the second) for output ports are based on [quartz-scheduler.org](http://quartz-scheduler.org/documentation/quartz-2.1.x/tutorials/crontrigger). Output ports can be set conditionally and you have a simple but powerful semaphore mechanism.
 *   You may define your own variables with a prefix VIRTUAL which are persisted in memory (unknown virtual variables default to "0").
 
 ### Planned Features
 
+* Automated tests
 * If GPIO ports are used to represent binary output values, blocking single ports is dangerous: Delayed/Queue requests
-* Automated tests
 * Custom hooks (pre/post), e.g. for notifications
 * More status and configuration information requestable via json (disengageable)
 

gpio.conf.MUST_BE_CHANGED

 # if direction TI, no of max reads in loop; defaults to 100000 (it is about 2500ms)
 ti.max.counter=100000
 
-#GPIO.0 = P1-03
+###### GPIO.0 = P1-03 #####
 #GPIO.0.DIRECTION=OUT
 #GPIO.0.NAME=g0
 #GPIO.0.OUT.DEFAULT.STATE=0
 #GPIO.0.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.0.OUT.BLOCK.TIME=10000
 
-#GPIO.1 = P1-05
+##### GPIO.1 = P1-05 #####
 #GPIO.1.DIRECTION=OUT
 #GPIO.1.NAME=g1
 #GPIO.1.OUT.DEFAULT.STATE=0
 #GPIO.1.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.1.OUT.BLOCK.TIME=10000
 
-#GPIO.4 = P1-07
+##### GPIO.4 = P1-07 #####
 #GPIO.4.DIRECTION=OUT
 #GPIO.4.NAME=g4
 #GPIO.4.OUT.DEFAULT.STATE=0
 #GPIO.4.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.4.OUT.BLOCK.TIME=10000
 
-#GPIO.7 = P1-26
+##### GPIO.7 = P1-26 #####
 #GPIO.7.DIRECTION=OUT
 #GPIO.7.NAME=g7
 #GPIO.7.OUT.DEFAULT.STATE=0
 #GPIO.7.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.7.OUT.BLOCK.TIME=10000
 
-#GPIO.8 = P1-24
+##### GPIO.8 = P1-24 #####
 #GPIO.8.DIRECTION=OUT
 #GPIO.8.NAME=g8
 #GPIO.8.OUT.DEFAULT.STATE=0
 #GPIO.8.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.8.OUT.BLOCK.TIME=10000
 
-#GPIO.9 = P1-21
+##### GPIO.9 = P1-21 #####
 #GPIO.9.DIRECTION=OUT
 #GPIO.9.NAME=g9
 #GPIO.9.OUT.DEFAULT.STATE=0
 #GPIO.9.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.9.OUT.BLOCK.TIME=10000
 
-#GPIO.10 = P1-19
+##### GPIO.10 = P1-19 #####
 #GPIO.10.DIRECTION=OUT
 #GPIO.10.NAME=g10
 #GPIO.10.OUT.DEFAULT.STATE=0
 #GPIO.10.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.10.OUT.BLOCK.TIME=10000
 
-#GPIO.11 = P1-23
+##### GPIO.11 = P1-23 #####
 #GPIO.11.DIRECTION=OUT
 #GPIO.11.NAME=g11
 #GPIO.11.OUT.DEFAULT.STATE=0
 #GPIO.11.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.11.OUT.BLOCK.TIME=10000
 
-#GPIO.14 = P1-08
+##### GPIO.14 = P1-08 #####
 #GPIO.14.DIRECTION=OUT
 #GPIO.14.NAME=g14
 #GPIO.14.OUT.DEFAULT.STATE=0
 #GPIO.14.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.14.OUT.BLOCK.TIME=10000
 
-#GPIO.15 = P1-10
+##### GPIO.15 = P1-10 #####
 #GPIO.15.DIRECTION=OUT
 #GPIO.15.NAME=g15
 #GPIO.15.OUT.DEFAULT.STATE=0
 #GPIO.15.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.15.OUT.BLOCK.TIME=10000
 
-#GPIO.17 = P1-11
+##### GPIO.17 = P1-11 #####
 #GPIO.17.DIRECTION=OUT
 #GPIO.17.NAME=g17
 #GPIO.17.OUT.DEFAULT.STATE=0
 #GPIO.17.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.17.OUT.BLOCK.TIME=10000
 
-#GPIO.18 = P1-12
+##### GPIO.18 = P1-12 #####
 #GPIO.18.DIRECTION=OUT
 #GPIO.18.NAME=g18
 #GPIO.18.OUT.DEFAULT.STATE=0
 #GPIO.18.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.18.OUT.BLOCK.TIME=10000
 
-#GPIO.21 = P1-13 on rev 1.0
+##### GPIO.21 = P1-13 on rev 1.0 #####
 #GPIO.21.DIRECTION=OUT
 #GPIO.21.NAME=g21
 #GPIO.21.OUT.DEFAULT.STATE=0
 #GPIO.21.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.21.OUT.BLOCK.TIME=10000
 
-#GPIO.22 = P1-15
+##### GPIO.22 = P1-15 #####
 #GPIO.22.DIRECTION=OUT
 #GPIO.22.NAME=g22
 #GPIO.22.OUT.DEFAULT.STATE=0
 #GPIO.22.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.22.OUT.BLOCK.TIME=10000
 
-#GPIO.23 = P1-16
+##### GPIO.23 = P1-16 #####
 #GPIO.23.DIRECTION=OUT
 #GPIO.23.NAME=g23
 #GPIO.23.OUT.DEFAULT.STATE=0
 #GPIO.23.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.23.OUT.BLOCK.TIME=10000
 
-#GPIO.24 = P1-18
+##### GPIO.24 = P1-18 #####
 #GPIO.24.DIRECTION=OUT
 #GPIO.24.NAME=g24
 #GPIO.24.OUT.DEFAULT.STATE=0
 #GPIO.24.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.24.OUT.BLOCK.TIME=10000
 
-#GPIO.25 = P1-22
+##### GPIO.25 = P1-22 #####
 #GPIO.25.DIRECTION=OUT
 #GPIO.25.NAME=g25
 #GPIO.25.OUT.DEFAULT.STATE=0
 #GPIO.25.OUT.AUTO.TOGGLE.TIME=250
 #GPIO.25.OUT.BLOCK.TIME=10000
 
-#GPIO.27 = P1-13 on rev 2.0
+##### GPIO.27 = P1-13 on rev 2.0 #####
 #GPIO.27.DIRECTION=OUT
 #GPIO.27.NAME=g27
 #GPIO.27.OUT.DEFAULT.STATE=0

src/main/java/de/derbub/rpigpio/SingleContext.java

         for (String name : nameValuesUncheckedMap.keySet()) {
             String uncheckedValue = nameValuesUncheckedMap.get(name).trim();
             ConfiguredGpio gpio = configuredGpioMap.get(name);
-            if (gpio.getDirection().isInput()
-                && Direction.CONDITIONAL_INPUT.equals(uncheckedValue)) {
+            if (gpio.getDirection().isInput()) {
                 nameCheckedValuesMap.put(name, Direction.IN.getValue());
             }
             if (gpio.getDirection().isOutput()) {
 CRON_CONFIG=cron.conf
 RPI_GPIO_LOG=file:`pwd`/log4j.properties
 
-java -Dlog4j.configuration=$RPI_GPIO_LOG \
+# remote debugging parameter java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 \
+
+java \
+          -Dlog4j.configuration=$RPI_GPIO_LOG \
           -Dgpio.configuration=$GPIO_CONFIG \
           -Dcron.configuration=$CRON_CONFIG \
 		  -jar $WINSTONE_JAR \
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.