Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:netzer:gpioserver [2011/12/20 08:49] – Fixed format. svesch | en:netzer:gpioserver [2025/06/11 20:42] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 5: | Line 5: | ||
Via the GPIO server all [[IO|IOs]] of Netzer can be addressed. | Via the GPIO server all [[IO|IOs]] of Netzer can be addressed. | ||
- | If the GPIO is activated, Netzer opens a TCP port (factory setting 65000) after restart. Activation and the port can be carried out by general settings via the website (see figure). The settings | + | If the GPIO is activated, Netzer opens a TCP port (factory setting 65000) after restart. |
+ | Activation and the port can be carried out by general settings via the website (see figure). | ||
+ | The settings become directly effective! | ||
- | {{commongpioserver.gif? | + | {{commongpioserver.png? |
For simple tests of the server and the protocol every terminal program may be used that is capable of building up connections via Raw TCP sockets, such as e.g. the Windows HyperTerminal. | For simple tests of the server and the protocol every terminal program may be used that is capable of building up connections via Raw TCP sockets, such as e.g. the Windows HyperTerminal. | ||
Upon successful connection establishment, | Upon successful connection establishment, | ||
- | |||
- | |||
- | ===== Authentification (from version 1.4 pro) ===== | ||
- | |||
- | For the GPIO server, authentification can be activated on the GPIO settings website. | ||
- | |||
- | {{gpioservercommon.gif? | ||
- | |||
- | For authentification, | ||
- | |||
- | After connection establishment, | ||
- | |||
- | < | ||
- | |||
- | After that, the password: | ||
- | |||
- | < | ||
- | |||
- | In the event of an incorrect entry the connection is interrupted by the GPIO server. If everything is okay, the protocol phase is entered into. | ||
Line 37: | Line 20: | ||
In the GPIO server, a simple protocol is implemented. | In the GPIO server, a simple protocol is implemented. | ||
- | Thanks to this protocol, digital inputs and outputs as well as ADC and PWM/pulse outputs can be read. Only digital outputs as well as PWM/pulse outputs can be written. Furthermore, | + | Thanks to this protocol, digital inputs and outputs as well as ADC and PWM/pulse outputs can be read. Only digital outputs as well as PWM/pulse outputs can be written. Furthermore, |
Reading or writing is done by commands. | Reading or writing is done by commands. | ||
Line 51: | Line 34: | ||
< | < | ||
- | a=? Server reply: a=1 | + | a=?\n |
- | e=? Server reply: e=03ff | + | Server reply: a=1 |
- | m=? Server reply: m=0 | + | |
- | x=? Server reply: x=0011 | + | e=?\n |
+ | Server reply: e=03ff | ||
+ | |||
+ | m=?\n | ||
+ | Server reply: m=0 | ||
+ | |||
+ | x=?\n | ||
+ | Server reply: x=0011 | ||
</ | </ | ||
- | Depending on whether the pin is configured digital or as ADC/PWM, the GPIO servier supplies binary or numerical values. The radix of numerical values can be changed between hexadecimal and decimal using the GPIO setting on the [[io# | + | Depending on whether the pin is configured digital or as ADC/PWM, the GPIO servier supplies binary or numerical values. |
The wildcard ID **x** always supplies the digital state of all pins, regardless of whether a pin supplies binary or numerical values. At bit level, the states of the individual pins as per the following table are possible: | The wildcard ID **x** always supplies the digital state of all pins, regardless of whether a pin supplies binary or numerical values. At bit level, the states of the individual pins as per the following table are possible: | ||
Line 73: | Line 63: | ||
</ | </ | ||
- | The wildcard ID **x** describes only the pins configured as digital outputs and not occupied by the serial server. | + | The wildcard ID **x** describes only the pins configured as digital outputs and not occupied by the [[serialserver|serial server]]. |
- | ===== Events | + | ==== Events ==== |
For every digital input, an event trigger may be activated on the GPIO configuration page. | For every digital input, an event trigger may be activated on the GPIO configuration page. | ||
Line 82: | Line 72: | ||
{{gpioevents.gif? | {{gpioevents.gif? | ||
- | Thus, the GPIO sever independently sends protocol messages in the event of an accordingly configured amendment. | + | Thus, the GPIO server |
+ | |||
+ | |||
+ | ==== Edge counter ==== | ||
+ | |||
+ | For the IO channels a, b, and c [[io# | ||
+ | They can be accessed via the special protocol ID **z**. | ||
+ | |||
+ | Reading the counter works like: | ||
+ | |||
+ | < | ||
+ | za=? Server response: za=0001 | ||
+ | zb=? Server response: zb=0000 | ||
+ | zc=? Server response: zc=0123 | ||
+ | </ | ||
+ | |||
+ | Counter values are transmitted as 16 bit hexadecimal numbers. | ||
+ | The value itself is stored in the lower 15 bits. | ||
+ | The MSB of the counter is the carry flag, which indicates a counter overrun or underrun. | ||
+ | If carry flag is set it remains set until reset manually. | ||
+ | |||
+ | Also writing of counter values is possible: | ||
+ | |||
+ | < | ||
+ | za=0 Server response: za=0000 | ||
+ | </ | ||
+ | |||
+ | Change of counter values is not transmitted automatically. | ||
+ | The user has to poll the server periodically to detect changes. | ||