Change settings of the primary RS232 interface
Five arguments are required. A sixth, optional argument can be used to change the operating mode.
Baudrate
Valid rates: 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800
Bits
Number of bits of one data words: 5, 6, 7, 8
Parity
O = odd, E = even, N = none
Stopbits
1 or 2
Flow control
N = none, SW = Xon/Xoff, HW = RTS/CTS
Mode (Optional)
This can be omitted or must be one of the keywords RS485 or RS485INV to switch the interface into RS485 mode. In RS485 mode, a transceiver chip must be connected that handles the physical bus. Therefore, the module automatically toggles a control line that most chips need to switch from RX to TX and vice versa. If RS485 is given, the Module drives the DTR control line from LOW to HIGH while sending. When RS485INV is given, that control line behaves inversely, that is, it goes from HIGH to LOW while sending.
Please Note: If the sixth argument is missing, the interface is switched to standard RS232 mode.
All arguments must be upper case.
ERR_OK (0) if command was accepted
ERR_ARGUMENT (4) if one or more arguments are wrong
RS232 115200 8 N 1 N
This configures the RS232 interface to use a baudrate of 115200bps, using 8 bits pet character, no parity, one stop bit and now flow control. Because there's no sixth argument, the inetrface runs in standard RS232 mode.
All new settings are effective after next reboot. This command only changes settings for the primary RS232 interface.
This command enables or disables logging of additional RS232 frame information.
The argument to RS232 ERRLOG can be either ON or OFF. If ERRLOG ON is given, the RS232 will also log RS232 framing information on input. Every received character causes a corresponding status byte to be stored in the input buffer that contains additional information.
The status byte consists of eight bits which mean the following (LSB first):
Bit 0
Not used, Always zero
Bit 1
Set on Overrun error. Overrun errors occur when the input FIFO is full and a new character arrives
Bit 2
Value of the parity bit (see remarks).
Bit 3
Set on framing error. Incoming serial data does not seem to be valid RS232 frames
Bit 4
Break detected. A Break means that the input line remains zero for the time of a full frame
Bit 5
Not used, Always zero
Bit 6
Not used, Always zero
Bit 7
Framing error or Parity error
RS232 ERRLOG ON
Enables logging of error bits.
The RS232 ERRLOG command first appears in version 4.38. If the value of the parity bit is needed, the Module must be configured for either odd or even parity. If the module is not configured for any parity, bit 2 of the status byte will always be zero.
All new settings are effective after next reboot.
This command prints out all RS232 settings in one single line. The Output reflects the arguments of the RS232 command (see above) in the same order. All items are separted by spaces.
The second to the last item is either RS232, RS485 or RS485INV. This depends on the last argument of the RS232 command when using 5 or 6 arguments.
The very last item is either NORMAL or ERRLOG. This depends on the settings made by RS232 ERRLOG (see above).
RS232?
Prints out e.g: 115200 8 N 1 N RS232 NORMAL