2025-12-11
New "bare" mode in ioninja-server
IO Ninja shines as a UI debugger for communications. It offers a slick and polished user interface, a logging engine that is both beautiful and lightning-fast, a sophisticated hex packet editor with packet templates, regex-based markup for auto-splitting streams into packets and highlighting data tidbits, and many other powerful UI features.
However, when it is time to automate things, you do not want a UI anymore (no matter how good it is). What you need instead is a simple CLI (command line interface) for interop with your scripts in Python (JS/Perl/Ruby/%your-faviorite-language%).
With this release, IO Ninja gives you exactly that.
Start ioninja-server with the --bare flag, specify which plugins to load, and pass their settings via simple .ini files (or a configuration script in Jancy). The server will automatically start a session and pump all events to stdout, ready for your script to consume and process as needed.
$ ioninja-server \
--bare \
--plugin serial-tap-pro \
--plugin-settings-file my-serial-tap-pro-cfg.ini \
--plugin modbus \
--plugin-settings-file my-modbus-cfg.ini \
| python my-script.py
Layers can be programmatically configured from IAS
IAS (in-app scripting) is a powerful facility that lets you write quick-and-dirty testing or automation scripts right inside IO Ninja. Such scripts can control the current session through the global g_session object. This is extremely handy whenever you need to perform session-specific actions programmatically — for instance, toggling the RTS line or adjusting the baud rate of a serial port:
g_session.m_baudRate = 115200;
for (;;) { // keep toggling RTS
g_session.m_rts = !g_session.m_rts;
sys.sleep(1000);
}
For this to work, a session must implement a so-called "dispatch interface" to export session-specific settings and actions to IAS. Most official session plugins already provide such an interface, and with this release, layers (protocol analyzers, filters, and so on) can do it as well!
g_modbus.m_protocol = io.ModbusProtocol.Rtu; // Modbus RTU
g_modbus.m_streamRoles = io.ModbusStreamRoles.RxHalfDuplex; // half-duplex RS485
g_modbus.m_halfDuplexMode = io.ModbusHalfDuplexMode.Alternate; // alternate Master/Slave
g_serialTap.m_baudRate = 115200;
g_serialTap.capture();
This can be used both from the "Script" pane inside the IO Ninja app and passed to ioninja-server in bare mode (as an alternative to configuration .ini files):
$ ioninja-server \
--bare \
--plugin serial-tap-pro \
--plugin modbus \
--ias my-script.js \
> /dev/tcp/$MY_IP/$MY_PORT
For a complete list of changes, see changelog.txt (also included in all installation packages).