ITrain2MQTT/Sensors/3/1 -> will set the iTrain feedback at virtual z21 with adress# 3 to "ON" ITrain2MQTT/Sensors/2/0 -> will set the iTrain feedback at virtual z21 with adress# 2 to "OFF" Note: Objcts are matches with their adress and not by name. Hostname/Sensors/ SensorAdress/ SensorState.Hostname/Accessories/ AccessoryAdress/ AccessoryState.The gateway will automatically subscribe to all topics below this hirachy and forward it to the corresponding iTrain object: Hostname/Device/IPAdress/ IP adress of the gatewayįurther topics are created once they are first time pushed.The main Topic is always the hostname of the gateway (default: "iTrain2MQTT") Once connected to Wifi some default topics are created. So it is stricly recomended to use the gateway only in protected environment. Furthermore input validataion is very basic. Get accessory status, either boolean(0/1) or any integer number in range 0-256Ĭurrently no security credentials are supported.Set accessory status, either boolean(0/1) or any integer number in range 0-256 (currently broken, need iTrain update).Set feedback status, including loco id.Within iTrain this virtual objects can be used to trigger actions or to instance interact with physical objects assigned to other command stations. This allow to mirror the status of any object assigend to the virtual z21 at a MQTT broker. So this virtual z21 acts as a iTrain MQTT gateway. The workaround is to emulate a z21 command station which acts as a iTrain client and then push/receive messages to a MQTT broker. So a user based native integration is not possible. ITrain does not offer a public interface to directly access internal objects. Minimum but mandatory setting is the broker IP address. A sample for the syntax is provided as /src/security_example.hįurther settings can be done in the /src/settings.h file. Check this file also for mandatory third party libraries.īefore initial compile you need to create a /src/security.h file with your Wifi SSID and PIN. Please consult the platformio.ini to select the prefered configuration. Subsequent firmware downloads can be done via OTA (Wifi). The project is setup for VSCode IDE with the platformio framework installed.Ī initial firmware download to the uC need to be done via USB. The IP address of the MQTT broker wheer the gateway shall connect is configurable. The MQTT broker need to be setup as standalone service, it is not part of the project. A second connection is initiated to a MQTT broker. No special settings are necessary, all settings shall kept in default state. Please consult the iTrain manual about z21 integration details. From iTrain perspective it looks like a physical z21. The gateway connects to iTrain via Wifi by use of the Roco z21 protocol. At later state a conversion to Java in order to run as service on any PC is thinkable but not planned yet. This allow easy integration without struggling with PC operating system specialities. Implementation:įor simplification the gateway is prepared to run on a ESP8266uC. So this can bring both together and allow easy implementation of special custom hardware with iTrain. ![]() On the other hand the MQTT protocol is widely used in IoT applikations with tons of existing applikations and templates. Background is that most protocols used in model railroad environment are little bit complex and not easy to integrate in DiY uC projects. ![]() This project is a MQTT gateway for iTrain model railroad control software. in UDP packets and outputs these to a serial communications port (Com1-15). reads any NMEA data from one of the serial ports (Com1-15) and delivers the NMEA data to. Top Software Keywords Show more Show less crack serial number keygen key generator warez tools for windows utilities utility system net wintools net clean uninstaller uninstall scan files scan registry startup tweak tweaker up tweakui.
0 Comments
Leave a Reply. |