User Tools

Site Tools


supported_hardware:pigpio

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
supported_hardware:pigpio [2019/06/23 12:02] – [PI GPIO] James Sentmansupported_hardware:pigpio [2019/08/01 14:25] – [Software Serial Port] James Sentman
Line 2: Line 2:
  
 The [[http://abyz.me.uk/rpi/pigpio/|pi gpio]] library is included on every Raspberry Pi and can provide you with monitoring or control of all the GPIO pins. The XTension plugin currently supports input and output as well as PWM and Servo control. The [[http://abyz.me.uk/rpi/pigpio/|pi gpio]] library is included on every Raspberry Pi and can provide you with monitoring or control of all the GPIO pins. The XTension plugin currently supports input and output as well as PWM and Servo control.
 +
  
 ====Installation==== ====Installation====
Line 34: Line 35:
 ====Pin Types:==== ====Pin Types:====
 No units are created automatically by this plugin since there are so many pins it would be frustrating to have it create so many potentially unneeded units. Instead create a new Unit on your PIGPIO interface and set the Address of the unit to the pin number that you would like to control. XTension will ignore the pins that you do not have units configured for so they may be used by other processes without interference. No units are created automatically by this plugin since there are so many pins it would be frustrating to have it create so many potentially unneeded units. Instead create a new Unit on your PIGPIO interface and set the Address of the unit to the pin number that you would like to control. XTension will ignore the pins that you do not have units configured for so they may be used by other processes without interference.
 +
 +<HTML><p style="border-top:1px solid black;"></p></HTML>
  
 ===Digital Input:=== ===Digital Input:===
Line 50: Line 53:
 ==Debounce Micros:== ==Debounce Micros:==
 If you’re connecting the pin to a switch or a button you will need to set a debounce period. Any physical switch will have a few milliseconds during the transition where the actual read value will be switching wildly back and forth between on and off before it settles down. This value is the amount of time the reading must be stable in MICROseconds (not milliseconds) before the change will be reported. Without this you’re likely to get dozens or even hundreds of updates back and forth during the first fraction of a second after you press the button. A value of 10,000 is the default and seems good for most devices I’ve used it with. The value must be stable for 10 milliseconds before the change is reported. Value values are from 0 to 300,000. If you’re connecting the pin to a switch or a button you will need to set a debounce period. Any physical switch will have a few milliseconds during the transition where the actual read value will be switching wildly back and forth between on and off before it settles down. This value is the amount of time the reading must be stable in MICROseconds (not milliseconds) before the change will be reported. Without this you’re likely to get dozens or even hundreds of updates back and forth during the first fraction of a second after you press the button. A value of 10,000 is the default and seems good for most devices I’ve used it with. The value must be stable for 10 milliseconds before the change is reported. Value values are from 0 to 300,000.
 +
 +<HTML><p style="border-top:1px solid black;"></p></HTML>
 +
 +
  
 ===Digital Output:=== ===Digital Output:===
 Digital output pins have no other options to setup. They will be connected to ground when the Unit in XTension is off and to the positive voltage of the Pi when turned on. (unless you set them to reverse logic in XTension) Please read the documentation on the Pi to learn how much current you can pull from these pins, (it’s not very much at all) before you will burn them out. You can connect a single LED to a pin with the proper resistor, but not one to every pin without some other external hardware to take the load off the Pi itself. Digital output pins have no other options to setup. They will be connected to ground when the Unit in XTension is off and to the positive voltage of the Pi when turned on. (unless you set them to reverse logic in XTension) Please read the documentation on the Pi to learn how much current you can pull from these pins, (it’s not very much at all) before you will burn them out. You can connect a single LED to a pin with the proper resistor, but not one to every pin without some other external hardware to take the load off the Pi itself.
 +
 +<HTML><p style="border-top:1px solid black;"></p></HTML>
  
 ===Servo Control:=== ===Servo Control:===
Line 60: Line 69:
  
 The Servo pin Unit also supports the “rate” parameter of the [[dictionary:unitcontrol:turnon|Turn On]] and [[dictionary:unitcontrol:dim|Dim/Brighten]] verbs so that you can make the servo move more slowly. Yes, it makes little sense to say “dim myServo to 2500” but the set value verb does not include the rate parameter so use the dim or brighten command. The rate is the number of milliseconds between steps. Larger numbers are slower. The Servo pin Unit also supports the “rate” parameter of the [[dictionary:unitcontrol:turnon|Turn On]] and [[dictionary:unitcontrol:dim|Dim/Brighten]] verbs so that you can make the servo move more slowly. Yes, it makes little sense to say “dim myServo to 2500” but the set value verb does not include the rate parameter so use the dim or brighten command. The rate is the number of milliseconds between steps. Larger numbers are slower.
 +
 +<HTML><p style="border-top:1px solid black;"></p></HTML>
  
 ===PWM=== ===PWM===
Line 68: Line 79:
 The PWM unit type lets you choose the PWM frequency of the output. Slower rates may produce visible and annoying flicker in any led’s attached, but very high frequencies may cause ballasted lamps to overheat and either burn out or become a fire hazard. In my testing a value of 800hz was more than enough to make the flickering invisible to my eye. The PWM unit type lets you choose the PWM frequency of the output. Slower rates may produce visible and annoying flicker in any led’s attached, but very high frequencies may cause ballasted lamps to overheat and either burn out or become a fire hazard. In my testing a value of 800hz was more than enough to make the flickering invisible to my eye.
  
 +<HTML><p style="border-top:1px solid black;"></p></HTML>
 +
 +===Hardware Serial Port===
 +{{:supported_hardware:pgpio_hardware_serial.png?600 |}}The Hardware Serial unit type lets you use the built in UART in the Pi or any supported usb/serial adaptor. This is for use with “real” serial ports. For virtual “software” ports on any other GPIO pin see the Software Serial Port below. You need to know the path to the /dev entry for the serial port. For the built in serial port the value defaults to “/dev/ttyAMA0” Select the appropriate Baud rate from the popup. Not all baud rates may be supported on all hardware so take care to test if using a less standard value.
 +
 +The data is brought out to a TCP Socket listening on the port you enter in the “Route to Local TCP Port” setting. This connection will accept only a single client at a time and the port number must be unique on the system. You can connect to this with any application that could connect to a TCP Port or any of the XTension plugins with that capability. 
 +
 +As an aide to debugging you can select to have all data that passes through the port written to the XTension log. For binary protocols it may be helpful to use the “Write as hex instead of ascii” option.
 +
 +The Unit in XTension must have a unique Address even though the Units address is not used. If you create the Unit while the interface is running you may leave the address field empty and it will automatically fill it in with the same path to the serial port. If you are creating units without the interface running you must manually give them a unique address. Just a count of the other Hardware Serial units you’ve created so far would be enough.
 +
 +**IMPORTANT: The built in UART on the Pi is a TTL level serial device. It can ONLY be connected to other devices using a 3.3v serial level. If you connect it directly to a 5v device or to an RS232 device it will burn out the UART on the pi and possibly the entire pi. Use the appropriate level shifter or adaptor to safely connect a non 3.3v device to your Pi!**
 +
 +<HTML><p style="border-top:1px solid black;"></p></HTML>
 +
 +===Software Serial Port===
 +{{:supported_hardware:pigpio_software_serial.png?600 |}} The Software Serial Unit type lets you use any GPIO pins on the pi as a serial port. You can select any available pin for input or output or select None if you don’t need to either listen or talk to the device you’re working with. 
 +
 +The data is brought out to a TCP Socket listening on the port you enter in the “Route to Local TCP Port” setting. This connection will accept only a single client at a time and the port number must be unique on the system. You can connect to this with any application that could connect to a TCP Port or any of the XTension plugins with that capability.
 +
 +As an aide to debugging you can select to have all data that passes through the port written to the XTension log. For binary protocols it may be helpful to use the “Write as hex instead of ascii” option.
 +
 +All Units in XTension must have a unique address for every given device type. The Address for this unit is not used for routing messages but must still be unique among all the other Software Serial Units you may create. If you create the unit while the interface is running you can leave the Address field blank and it will fill it in with the format of (incoming pin number or “None”).(outgoing pin number or “None”) If you are creating units without the interface running you must manually supply a unique address for the unit. Just a count of the number of software serial units you’re creating is enough.
 +
 +**IMPORTANT: The built in UART on the Pi is a TTL level serial device. It can ONLY be connected to other devices using a 3.3v serial level. If you connect it directly to a 5v device or to an RS232 device it will burn out the UART on the pi and possibly the entire pi. Use the appropriate level shifter or adaptor to safely connect a non 3.3v device to your Pi!**
 +
 +<HTML><p style="border-top:1px solid black;"></p></HTML>
 ===More Info=== ===More Info===
 The pigpiod server has many more abilities than just the few pin types that I have supported in this first version. If you need virtual serial port passthrough, 1-wire support or support for the various i2c or other devices that can be connected through it please let me know and I will move that up my to do list. The pigpiod server has many more abilities than just the few pin types that I have supported in this first version. If you need virtual serial port passthrough, 1-wire support or support for the various i2c or other devices that can be connected through it please let me know and I will move that up my to do list.
Line 73: Line 111:
 ===History:=== ===History:===
  
-The PI GPIO plugin first appeared in XTension 9.4.16 +  * The PI GPIO plugin first appeared in XTension 9.4.16 
 +  * Hardware and Software serial passthroughs were added in XTension 9.4.20
supported_hardware/pigpio.txt · Last modified: 2023/04/10 12:57 by James Sentman