| BUILD_SERMUX | Enable serial multiplexer support in eLua.
| SERMUX_PHYS_ID | The ID of the physical UART interface used by the serial multiplexer.
| SERMUX_PHYS_SPEED | Communication speed of the multiplexer UART interface.
| SERMUX_FLOW_TYPE | Flow control type on the physical serial multiplexer interface, see link:arch_platform_uart.html#flow_control_type[here] for details.
If not specified it defaults to \'no flow control'.
| SERMUX_NUM_VUART | The number of virtual UART interfaces. This number can't be higher than 8.
| SERMUX_BUFFER_SIZES | An array of *SERMUX_NUM_VUART* integers that specify the buffer sizes for the virtual
UART interfaces. Note that a virtual UART *MUST* have a buffer associated with it. The sizes are specified as
All that's left now is to run the terminal emulator. In Linux:
------------------------
screen /dev/ttyp0 115200
------------------------
In Windows simply start TeraTerm or your preffered terminal emulator on port COM11 at 115200 baud.
Reset your eLua board, and you're ready to go! *mux* will send all the RFS requests
to the RFS server via its internal channel and will redirect all console I/O to */dev/ptyp0* (or COM10)
which in turn gets automatically redirected to */dev/ttyp0* (or COM11).
Notes
~~~~~
Some things you should consider when using the serial multiplexer:
- the code is still in beta. It works well most of the time, but sometimes it simply crashes. If this happens, please consider submitting a bug report.
- if your eLua board has two hardware serial ports that you can use and the PC has also two free serial ports, consider disabling the serial multiplexer completely. Run RFS on a hardware
port and the system console on the other hardware port instead. This is both more realiable and more efficient.
- to avoid problems with the serial multiplexer use this sequence to start it:
1. start *mux*
2. start the terminal emulator
3. reset the eLua board
- using hardware flow control is strongly encouraged. To do this:
1. make sure that your eLua board has support for hardware flow control (see link:refman_gen_uart.html#platform_uart_set_flow_control[here] for details).
2. specify the correct *SERMUX_FLOW_TYPE* value at build time (it should be *PLATFORM_UART_FLOW_RTS | PLATFORM_UART_FLOW_CTS*).
3. make sure that the serial cable connecting the PC and the eLua board also supports flow control. Some simple serial connection cables have only the RX, TX and GND wires.
RTS/CTS flow control requires at least RX, TX, RTS, CTS and GND wires arranged in a null-modem configuration.
4. start *mux* specifying _rtscts_ as part of the _<transport>_ parameter (see above).
- the serial multiplexer "protocol" is an extremely simple one, it doesn't make provisions for error correction or detection, and it might loose
synchronization if there are errors on the serial line. So, if it starts behaving abnormally, you might want to restart *mux* (and *rfs_server*
if you're running it with *mux*) and reset your eLua board.
- some serial ports built around USB to RS232 adapters seem to confuse *mux* sometimes. If *mux* won't work after you tried all the above
instructions, or if *mux* terminates unexpectedly, unplugging and plugging the USB cable of the RS232 adapter and restarting *mux*
will most likely solve your problem.
- if you get an *"Error on select, aborting program"* error from *mux*, keep in mind that this is normal if you run a terminal emulator (*screen*)
under Linux on a virtual UART and then close it (by exiting *screen*). However, it is not normal if it happens under other circumstances in Linux,
or if it happens in Windows. In these cases, please consider submitting a bug report.
- if the serial multiplexer is enabled on the eLua board it's not possible to use the board with a regular terminal emulator anymore (without
running *mux*), although it might appear so. eLua will send some output to the terminal emulator, but it won't be able to accept any input from it.
- if you find a bug in *mux* and wish to report it, try to reproduce the problem again, but this time run *mux* with *-v* (verbose).
The resulting logs may help us identify the problem.