grovejc (5) [Avatar] Offline
#1
Hello,

I am curious as to what version of Raspbian / Kernel was used for the exercise in chapter 4. I am having a rough time trying to get the GPIO pins to work with the new 3.18 kernel. smilie

Thanks
Anonymous (122) [Avatar]
#2
So after some much needed sleep smilie, I was able to get this working without too much effort.

First, I had to implement this pull request for quick2wire:
https://github.com/quick2wire/quick2wire-gpio-admin/pull/6/files

Due to the state the pi was in, I had to release pin 7 by adding gpio.close(pin) before blink(pin, 2000). I ran helloIoTWorld.js once to release pin 7 and then removed gpio.close(pin) that I added.

Finally, I had to change
blink(pin, 2000)
to
blink(pin, 2000, 0)
Otherwise, the console would return "GPIO set to: undefined" once followed by "GPIO set to: NaN" until I killed the app.

I had actually gotten to the "undefined / NaN" issue fairly early but due to my lack of sleep I kept trying to mess with pi-gpio and gpio-admin instead.

grovejc (5) [Avatar] Offline
#3
Opps, forgot to log in. Perhaps I should get some more rest smilie.
domguinard (69) [Avatar] Offline
#4
Hi there,

Sorry to read you had troubles with that but glad sleeping helped (Vlad and I should consider this sleep thing as well smilie).

Thanks a lot for pointing at the pull request. Strangely enough in our case it did work without this. In the most recent version of Raspbian the quick2wire "hack" should not even be needed anymore to get access to the GPIOs.

The device on (devices.webofthings.io) is currently running: Linux raspberrypi 3.18.7+ #755 PREEMPT Thu Feb 12 17:14:31 GMT 2015 armv6l.

What about yours? Also: what model of Pi are you using (b+ or 2?), finally: did you try the exercise with on/off the and PIR sensor at the end of Chapter 4? Did this work out-of-the-box?

For us the on/off library has been more stable with regards to Raspbian updates and we are considering moving all examples to on/off. It is also more actively maintained...

Thanks again for your feedback and good luck with the rest of the book!
grovejc (5) [Avatar] Offline
#5
Sorry for the delay,

I'm using PI 2 Model B V1.1

Linux version 3.18.11-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015

ARMv7 Processor rev 5 (v7l)

I had no problem using a PIR sensor with the onoff library.

Look forward to some more chapters!

Thanks