How do I define GPIO pin 4 as an output?


#1

Hi there,

I am playing around with my Raspi B + PiBrella board and I want to use GPIO pin 4 as an output.
From the default instal it is defined as a serial port for 1-wire sensors only.

How do I configure Webiopi and Cayenne?
Many thanks,


#2

Hey there Martin,

Welcome! We have reserved GPIO 4 for automatic 1-wire sensors. If you connect 1-wire sensors to pin 4, then the sensor will automatically be discovered and put as a widget in your dashboard.

Webiopi is installed when Cayenne is installed. Can you clarify you question?

-B


#3

Hi B,

It is kinda working now…
I have disabled DeviceTree and I2C using Cayenne config. I have edited /ect/webiopi/config and made GPIO pin 4 an output. I can now switch the red LED on the Pibrella board on and off, using the Webiopi interface on 127.0.0.1:8000.
But I can’t add a Generic Output device on the Cayenne dashboard for this output. This is also true for another output on GPIO pin 27 (not in the dropdown list of choices). How do I make the Cayenne dashboard resemble the PiBrella board more?
THX,


#4

Hi Martin,

My recommendation is not to ‘mess’ with the webiopi config. We’ve noticed that it can lead to issues with Cayenne, since Cayenne is using a modified webiopi.

GPIO 4 is reserved specifically for automatically discovering 1-wire devices, so we have not listed it as available to add a widget for GPIO 4. Pin 27 should be available in the dropdown when adding a generic output, I’ve had to zoom out before so I can see the full dropdown list (with pin 27 at the bottom), maybe try this?

Admittedly, we’ve never had anyone tell us they are using a PiBrella! So I’m glad you are bringing this up. @eptak what do you think?


#5

Hi B,
The Pibrella is a nice little board for demonstrations, because it has a few LEDs, 4 protected inputs and 4 high power outputs for switching relais and motors. Yesterday I found GPIO pin 27 (for the green LED on Pibrella) and added a switch for it on the Cayenne dashboard. Thanks for the tip.

The Pibrella piezo buzzer on GPIO pin 18 doesn’t work on Cayenne for now, because I can’t get PWM to work on this pin. Any tips?


#6

I’ve gotten a piezo buzzer to work, but need to use a PWM like PCA9685. The native Pi PWM isn’t compatible with WebIOPi or Cayenne. Do you have a PWM? I have extra one I can send you :wink:

-B


#7

Dear B,

As I said I am just playing around with my Pibrella board. But I would like the spare PWM you have lying around… :wink: I will DM you.

I guess I am Helped…


#8

Helped! lol :slightly_smiling: