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/13 09:20] – English page adapted to German one holtmann | en:netzer:gpioserver [2025/06/11 20:42] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Settings ===== | ===== Settings ===== | ||
- | Via the GPIO servier | + | Via the GPIO server |
- | 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! | ||
- | {{:de:netzer:commongpioserver.gif? | + | {{commongpioserver.png? |
- | For simple tests of the server and the protocol every terminal program | + | For simple tests of the server and the protocol every terminal program |
- | Upon sucessful connection establishment, | + | |
- | + | Upon successful connection establishment, authentification | |
- | ===== Authentification (from version 1.4 pro) ===== | + | |
- | + | ||
- | For the GPIO server, authentification | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | 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 36: | 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. | ||
+ | |||
Invididual commands are separated from each other by Whitespaces (space characters, tab, word wrap etc. - all characters with the ASCII code <= 32). | Invididual commands are separated from each other by Whitespaces (space characters, tab, word wrap etc. - all characters with the ASCII code <= 32). | ||
Line 47: | Line 32: | ||
Reading of pins works as follows: | Reading of pins works as follows: | ||
+ | |||
< | < | ||
- | 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 [[de: | + | 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: | ||
+ | |||
^ Bit 15 ^ Bit 14 ^ Bit 13 ^ Bit 12 ^ Bit 11 ^ Bit 10 ^ Bit 9 ^ Bit 8 ^ Bit 7 ^ Bit 6 ^ Bit 5 ^ Bit 4 ^ Bit 3 ^ Bit 2 ^ Bit 1 ^ Bit 0 ^ | ^ Bit 15 ^ Bit 14 ^ Bit 13 ^ Bit 12 ^ Bit 11 ^ Bit 10 ^ Bit 9 ^ Bit 8 ^ Bit 7 ^ Bit 6 ^ Bit 5 ^ Bit 4 ^ Bit 3 ^ Bit 2 ^ Bit 1 ^ Bit 0 ^ | ||
| 0 | 0 | 0 | m | l | k | j | i | h | g | f | e | d | c | b | a | | | 0 | 0 | 0 | m | l | k | j | i | h | g | f | e | d | c | b | a | | ||
+ | Writing on pins is done analogously: | ||
- | Writing on pins is done analoguously: | ||
< | < | ||
a=1 Server reply: a=1 | a=1 Server reply: a=1 | ||
Line 69: | 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. | ||
- | {{:de:netzer: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. | ||