Skip to main content

Cerca

Elementi taggati con: relay


 

Raspberry Pi: Control Relay switch via GPIO


https://tutorials-raspberrypi.com/raspberry-pi-control-relay-switch-via-gpio

Immagine/foto

#230v #c++ #hardware & gpio #high voltage #python #reed switch #relay #switch

Often you want to control modules with a higher voltage with the Raspberry Pi. For this purpose, relays can be used on the Raspberry Pi: The relay “switch” is utilized by means of a low-voltage pulse. Since the Pi only tolerates a maximum of 5V (the GPIOs even only 3.3V) without relays, there is the risk that the Pi could burn out. However, if you have two separate circuits this can not happen.

In this tutorial, I will show how to control a relay with the Raspberry Pi and what has to be considered.

Required Hardware Parts


* 5V relay module

* Female – Female jumper cable

* an external circuit (e.g., batteries) and an application (eg, motors)

The relays are available as 2, 4, 8 and even 16 modules, depending on what you need. To avoid wasting too many GPIOs on the Pi it pays off to purchase a GPIO port expander with more than 4 channels.

Setup


The structure is very simple since all pins are labelled. Left (GND) comes to pin 6 of the Pi (GND), the right pin (VCC) comes to 3V3 (pin 1) of the Pis. Depending on how many of the relays you want to control, you need to connect a corresponding number of GPIOs to the IN pins. It is recommended to set a small resistor between the Pi and the relay, but it is not absolutely necessary with 3V3.

If you set 5V instead of 3.3V to VCC, you should definitely put one resistor each (~ 1kΩ) between the GPIOs and the IN pins.

On the other side are at each relay 3 connections (see picture below): Depending on whether the IN pin is a LOW (0V) or HIGH (3.3V or 5V) is applied either the switch between the centre and right, or Open centre and left. If you connect all 3 pins, you can use the relay as a kind of switch, leaving it free on the left or right has the effect of an on/off switch. Where VCC or ground are connected (middle or right/left) does not matter.

Immagine/foto

Either center-left or center-right is connected/”opened”.

If you want to connect devices with high voltages, you should either know exactly what you are doing or ask an electrician! 230V is life-threatening. Pay extra attention to the specifications of the relay and take, if possible, no dodgy parts from China (which doesn’t matter in the low-power range but at higher voltages you should spend a bit more and take proven products). I assume no liability for damages!

Raspberry Pi Relay Control


Also, the control is not very difficult, since only GPIOs have to be switched. You can use C++ (wiringPi) or Python for it. I am using Python and have used GPIO 17 (pin 11).
sudo python



import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM) # GPIO Numbers instead of board numbers



RELAIS_1_GPIO = 17

GPIO.setup(RELAIS_1_GPIO, GPIO.OUT) # GPIO Assign mode

GPIO.output(RELAIS_1_GPIO, GPIO.LOW) # out

GPIO.output(RELAIS_1_GPIO, GPIO.HIGH) # on

If 0V is present at the relay pin, the corresponding LED lights up, at a HIGH level the LED goes out. So if you want the relay to open at a HIGH level, you need to connect the middle and left pins to the circuit. The LED is off there. If the relay is to open, if the LED is also on, middle and right OUT pins are connected.

That’s it. I would like to know, in which applications have you found the use for the Raspberry Pi relays?

Immagine/foto

Der Beitrag Raspberry Pi: Control Relay switch via GPIO erschien zuerst auf Raspberry Pi Tutorials.
Raspberry Pi: Control Relay switch via GPIO

 

Improve #federation on #Diaspora with relay servers



It is not easy to enter federation with a small pod (with only few users), because your pod only receives posts from followed users and your post are sent only on pods where someone follows your pod users.

To improve exchange between your pod and others and I recommend to activate relay server in your config/diaspora.yml. It permits to receive posts from other pods even if you are not following any user on these pods (based on tags). It also publishes all your posts to the relay. To avoid to receive all posts, a good choice is to grab posts with pod user followed tags (see scope parameter).

Bigger pods are encouraged to publish their posts on relays to help small pods (outbound: send: true)

Just share this post with your #podmin to be sure #relay server is enabled on your #pod.

Here is a configuration sample extract from config/diaspora.yml :
<br> ## Settings related to relays<br> relay: ## Section<br> <br> ## Relays are applications that exist to push public posts around to<br> ## pods which want to subscribe to them but would not otherwise<br> ## receive them due to not having direct contact with the remote pods.<br> ##<br> ## See more regarding relays: https://wiki.diasporafoundation.org/Relay_servers_for_public_posts<br> <br> outbound: ## Section<br> ## Enable this setting to send out public posts from this pod to a relay<br> send: true<br> ## Change default remote relay url used for sending out here<br> url: 'https://relay.iliketoast.net/receive/public'<br> <br> inbound: ## Section<br> ## Enable this to receive public posts from relays<br> subscribe: true<br> <br> ## Scope is either 'all' or 'tags' (default).<br> ## - 'all', means this pod wants to receive all public posts from a relay<br> ## - 'tags', means this pod wants only posts tagged with certain tags<br> scope: tags<br> <br> ## If scope is 'tags', should we include tags that users on this pod follow?<br> ## These are added in addition to 'pod_tags', if set.<br> include_user_tags: true<br> <br> ## If scope is 'tags', a comma separated list of tags here can be set.<br> ## For example "linux,diaspora", to receive posts related to these tags<br> pod_tags: "diaspora, podmin"<br> <br>
Some clearer explanation here : https://wiki.diasporafoundation.org/Relay_servers_for_public_posts

Bad title - diaspora* project wiki

Bad title - diaspora* project wiki

 

Improve #federation on #Diaspora with relay servers



It is not easy to enter federation with a small pod (with only few users), because your pod only receives posts from followed users and your post are sent only on pods where someone follows your pod users.

To improve exchange between your pod and others and I recommend to activate relay server in your config/diaspora.yml. It permits to receive posts from other pods even if you are not following any user on these pods (based on tags). It also publishes all your posts to the relay. To avoid to receive all posts, a good choice is to grab posts with pod user followed tags (see scope parameter).

Bigger pods are encouraged to publish their posts on relays to help small pods (outbound: send: true)

Just share this post with your #podmin to be sure #relay server is enabled on your #pod.

Here is a configuration sample extract from config/diaspora.yml :
<br> ## Settings related to relays<br> relay: ## Section<br> <br> ## Relays are applications that exist to push public posts around to<br> ## pods which want to subscribe to them but would not otherwise<br> ## receive them due to not having direct contact with the remote pods.<br> ##<br> ## See more regarding relays: https://wiki.diasporafoundation.org/Relay_servers_for_public_posts<br> <br> outbound: ## Section<br> ## Enable this setting to send out public posts from this pod to a relay<br> send: true<br> ## Change default remote relay url used for sending out here<br> url: 'https://relay.iliketoast.net/receive/public'<br> <br> inbound: ## Section<br> ## Enable this to receive public posts from relays<br> subscribe: true<br> <br> ## Scope is either 'all' or 'tags' (default).<br> ## - 'all', means this pod wants to receive all public posts from a relay<br> ## - 'tags', means this pod wants only posts tagged with certain tags<br> scope: tags<br> <br> ## If scope is 'tags', should we include tags that users on this pod follow?<br> ## These are added in addition to 'pod_tags', if set.<br> include_user_tags: true<br> <br> ## If scope is 'tags', a comma separated list of tags here can be set.<br> ## For example "linux,diaspora", to receive posts related to these tags<br> pod_tags: "diaspora, podmin"<br> <br>
Some clearer explanation here : https://wiki.diasporafoundation.org/Relay_servers_for_public_posts

Bad title - diaspora* project wiki

Bad title - diaspora* project wiki

 

Improve #federation on #Diaspora with relay servers



It is not easy to enter federation with a small pod (with only few users), because your pod only receives posts from followed users and your post are sent only on pods where someone follows your pod users.

To improve exchange between your pod and others and I recommend to activate relay server in your config/diaspora.yml. It permits to receive posts from other pods even if you are not following any user on these pods (based on tags). It also publishes all your posts to the relay. To avoid to receive all posts, a good choice is to grab posts with pod user followed tags (see scope parameter).

Bigger pods are encouraged to publish their posts on relays to help small pods (outbound: send: true)

Just share this post with your #podmin to be sure #relay server is enabled on your #pod.

Here is a configuration sample extract from config/diaspora.yml :
<br> ## Settings related to relays<br> relay: ## Section<br> <br> ## Relays are applications that exist to push public posts around to<br> ## pods which want to subscribe to them but would not otherwise<br> ## receive them due to not having direct contact with the remote pods.<br> ##<br> ## See more regarding relays: https://wiki.diasporafoundation.org/Relay_servers_for_public_posts<br> <br> outbound: ## Section<br> ## Enable this setting to send out public posts from this pod to a relay<br> send: true<br> ## Change default remote relay url used for sending out here<br> url: 'https://relay.iliketoast.net/receive/public'<br> <br> inbound: ## Section<br> ## Enable this to receive public posts from relays<br> subscribe: true<br> <br> ## Scope is either 'all' or 'tags' (default).<br> ## - 'all', means this pod wants to receive all public posts from a relay<br> ## - 'tags', means this pod wants only posts tagged with certain tags<br> scope: tags<br> <br> ## If scope is 'tags', should we include tags that users on this pod follow?<br> ## These are added in addition to 'pod_tags', if set.<br> include_user_tags: true<br> <br> ## If scope is 'tags', a comma separated list of tags here can be set.<br> ## For example "linux,diaspora", to receive posts related to these tags<br> pod_tags: "diaspora, podmin"<br> <br>
Some clearer explanation here : https://wiki.diasporafoundation.org/Relay_servers_for_public_posts

Bad title - diaspora* project wiki

Bad title - diaspora* project wiki

 

Improve #federation on #Diaspora with relay servers



It is not easy to enter federation with a small pod (with only few users), because your pod only receives posts from followed users and your post are sent only on pods where someone follows your pod users.

To improve exchange between your pod and others and I recommend to activate relay server in your config/diaspora.yml. It permits to receive posts from other pods even if you are not following any user on these pods (based on tags). It also publishes all your posts to the relay. To avoid to receive all posts, a good choice is to grab posts with pod user followed tags (see scope parameter).

Bigger pods are encouraged to publish their posts on relays to help small pods (outbound: send: true)

Just share this post with your #podmin to be sure #relay server is enabled on your #pod.

Here is a configuration sample extract from config/diaspora.yml :
<br> ## Settings related to relays<br> relay: ## Section<br> <br> ## Relays are applications that exist to push public posts around to<br> ## pods which want to subscribe to them but would not otherwise<br> ## receive them due to not having direct contact with the remote pods.<br> ##<br> ## See more regarding relays: https://wiki.diasporafoundation.org/Relay_servers_for_public_posts<br> <br> outbound: ## Section<br> ## Enable this setting to send out public posts from this pod to a relay<br> send: true<br> ## Change default remote relay url used for sending out here<br> url: 'https://relay.iliketoast.net/receive/public'<br> <br> inbound: ## Section<br> ## Enable this to receive public posts from relays<br> subscribe: true<br> <br> ## Scope is either 'all' or 'tags' (default).<br> ## - 'all', means this pod wants to receive all public posts from a relay<br> ## - 'tags', means this pod wants only posts tagged with certain tags<br> scope: tags<br> <br> ## If scope is 'tags', should we include tags that users on this pod follow?<br> ## These are added in addition to 'pod_tags', if set.<br> include_user_tags: true<br> <br> ## If scope is 'tags', a comma separated list of tags here can be set.<br> ## For example "linux,diaspora", to receive posts related to these tags<br> pod_tags: "diaspora, podmin"<br> <br>
Some clearer explanation here : https://wiki.diasporafoundation.org/Relay_servers_for_public_posts

Bad title - diaspora* project wiki

Bad title - diaspora* project wiki

 

Social-Relay version 1.2.0



New version of the public content #relay server software. This version brings support for passing through also #Diaspora protocol Retraction messages (ie deletions of content). This is important since otherwise a post later deleted that the relay originally delivered would not be delivered. Issues exist in #Diaspora, #Friendica and #Hubzilla issue trackers to get retractions to be sent to the relays.

https://github.com/jaywink/social-relay/releases/tag/1.2.0

Next for the relay system I intend to separate the relay system documentation to it's own repository, since it's not really a part of Social-Relay which is just the server implementing it. Would love to get some opinions on various subjects there then, regarding how to proceed with things like decentralizing the relays and getting rid of the reliance on the-federation.info as a way to bootstrap lists of nodes. Preferably opinions from project admins since the decision on how to decentralize the relays has to be done the way the projects are fine implementing it.

Ping @Davìd M and @Jeremy Pope . Additionally please note the change in the requirement files. I simplified them a bit, changelog has details.

Changelog:

[1.2.0] - 2016-10-25



Added

  • Expose NodeInfo to allow registering relays to pod lists. Unfortunately, NodeInfo schema doesn't contain the relay software key so this NodeInfo document cannot be validated by consumers.
  • Network calls now use a custom user agent Social-Relay/<version> - https://github.com/jaywink/social-relay. Thanks @bmanojlovic for the patch.
  • Relay also Diaspora retraction and photo entities. The former follows the same way like and comment entities are relayed, ie the targets are the same as where the status_message or photo were relayed. photo follows same rules as status_message entities, ie according to subscriber wishes.

Changed

  • Replaced custom payload sending with the new helper from federation. This will not try to deliver to http targets at all. This means nodes that are not using https will not get deliveries. Really, these days, there is no reason to run a public website with http.

Removed

  • Removed suggestion to use pip-tools and convert requirements files to standard Python project requirements files. Didn't dig the workflow after all. To install dev dependencies use requirements/development.txt. For production, use requirements/production.txt, which also contains uWSGI. If you don't deploy using uWSGI, you can just use requirements/requirements.txt.

jaywink/social-relay

social-relay - Public post relay for the Diaspora federated social network protocol

 

Social-Relay version 1.2.0



New version of the public content #relay server software. This version brings support for passing through also #Diaspora protocol Retraction messages (ie deletions of content). This is important since otherwise a post later deleted that the relay originally delivered would not be delivered. Issues exist in #Diaspora, #Friendica and #Hubzilla issue trackers to get retractions to be sent to the relays.

https://github.com/jaywink/social-relay/releases/tag/1.2.0

Next for the relay system I intend to separate the relay system documentation to it's own repository, since it's not really a part of Social-Relay which is just the server implementing it. Would love to get some opinions on various subjects there then, regarding how to proceed with things like decentralizing the relays and getting rid of the reliance on the-federation.info as a way to bootstrap lists of nodes. Preferably opinions from project admins since the decision on how to decentralize the relays has to be done the way the projects are fine implementing it.

Ping @Davìd M and @Jeremy Pope . Additionally please note the change in the requirement files. I simplified them a bit, changelog has details.

Changelog:

[1.2.0] - 2016-10-25



Added

  • Expose NodeInfo to allow registering relays to pod lists. Unfortunately, NodeInfo schema doesn't contain the relay software key so this NodeInfo document cannot be validated by consumers.
  • Network calls now use a custom user agent Social-Relay/<version> - https://github.com/jaywink/social-relay. Thanks @bmanojlovic for the patch.
  • Relay also Diaspora retraction and photo entities. The former follows the same way like and comment entities are relayed, ie the targets are the same as where the status_message or photo were relayed. photo follows same rules as status_message entities, ie according to subscriber wishes.

Changed

  • Replaced custom payload sending with the new helper from federation. This will not try to deliver to http targets at all. This means nodes that are not using https will not get deliveries. Really, these days, there is no reason to run a public website with http.

Removed

  • Removed suggestion to use pip-tools and convert requirements files to standard Python project requirements files. Didn't dig the workflow after all. To install dev dependencies use requirements/development.txt. For production, use requirements/production.txt, which also contains uWSGI. If you don't deploy using uWSGI, you can just use requirements/requirements.txt.

jaywink/social-relay

social-relay - Public post relay for the Diaspora federated social network protocol

 

Tor: Volunteer - A few things everyone can do nowhttps://www.torproject.org/getinvolved/volunteer.html.en



Immagine/foto
#tor #getinvolved #help #onion #privacy #tails #torbrowser #relay #anonymous #censorship #security #encryption #volunteer

via Diaspora* Publisher -

Tor: Volunteer

Tor is a free software that prevents people from learning your location or browsing habits by letting you communicate anonymously on the Internet. It also helps you bypass censorship online. If you can't open the website, email gettor@torproject.org for instruction on how to get the Tor Browser.

 

Tor: Volunteer - A few things everyone can do nowhttps://www.torproject.org/getinvolved/volunteer.html.en



Immagine/foto
#tor #getinvolved #help #onion #privacy #tails #torbrowser #relay #anonymous #censorship #security #encryption #volunteer

via Diaspora* Publisher -

Tor: Volunteer

Tor is a free software that prevents people from learning your location or browsing habits by letting you communicate anonymously on the Internet. It also helps you bypass censorship online. If you can't open the website, email gettor@torproject.org for instruction on how to get the Tor Browser.