Debugging Simulators
The Powerhouse-Dynamics ConnectWare GitHub repository includes software simulators that are highly recommended tools for developing OKE (Open Kitchen Equipment) ports of the CWL (ConnectWare Library). The simulations can be used for debugging a new CWL port since they minimize the number of "moving parts" required to exercise an OKE system.
There are three independent simulators that can be run out of the box or modified to suit the needs of the developer. The compiled simulators are text-based Windows programs and are run from a command prompt. All three simulators can be run on different command terminals on the same computer.
The Simulators
OKC (Open Kitchen Cloud) Simulator
okc.exe is a software simulation of the cloud server that runs on a local computer using a terminal. This simulator provides a means of monitoring OKM (Open Kitchen Message) traffic to and from the cloud.
The simulated CWM and OKC communicate to each other via inter-process communication that simulates a network connection between them. The OKC simulator can only interface with the CWM simulator.
OKC Sim Use Cases
This simulator is quite useful for validating data integrity of messages sent through the communications network chain. Use of this tool can be expanded to include unit testing for future firmware developments, ensuring that changes made in firmware do not break the OKM protocol.
CWM (ConnectWare Module) Simulator
cwm.exe is a software simulation of the physical ConnectWare Module that runs on a local computer using a terminal. The CWM sits in between the OKC simulator and the OKE or OKE Simulator. The simulated CWM and OKC communicate to each other via inter-process communication that simulates a network connection between them.
The CWM simulation opens a serial comport on the Windows PC. This serial comport is used to connect to the developer’s equipment in the same manner that the physical CWM would connect.
CWM Sim Use Cases
The OKE typically provides the user interface for the equipment. The UI is responsible for providing access to network settings which reside in the CWM. The CWM Simulator provides the interaction with the OKE necessary to validate commands and messages used for network status and configuration changes necessary for installations. Using the CWM simulator, the developer can see the interaction of communications from both sides.
OKE (Open Kitchen Equipment) Simulator
This is a software simulation of a Kitchen appliance. The purpose of this from a developer point of view is for demonstration purposes. To show how the OKE should be communicating with the rest of the simulators. This can be a helpful starting place to guide a developer on what heartbeat messages are meant for and to follow along with the API porting guide.
There are two typical simulation scenarios:
Developer Scenario
Run the OKC and CWM simulators on a PC and connect the PC with a serial connection to a controller board. Use the setup instructions below for each simulator.
Demonstration Scenario
Run the OKC, CWM, and OKE simulators all on the same PC. The PC requires two serial ports connected with a NULL modem cable. Use the setup instructions below for each simulator.
Simulator Software Location
All the simulation software cane be found at the https://github.com/Powerhouse-Dynamics/connectware. If you have not requested access, please see the QuickStart page for details on gaining access for your integration.https://sitesage.atlassian.net/wiki/x/AwDqFw
The Powerhouse-Dynamics ConnectWare GitHub repository contains a folder called sim. These are the compiled for Windows simulators.
CWM Simulation Instructions
OKC Simulation Instructions
OKE Simulation Instructions
Building Custom Simulators on Windows
The simulators were built using Microsoft Visual Studio Community 2019 with the C/C++ tools. At the top level https://github.com/Powerhouse-Dynamics/connectware there is a solution file called ConnectWare.sln that contains projects for the three simulators.
Normally implementors will not need to rebuild the OKC or CWM simulators since precompiled versions are included in the sim directory. However, some implementors may find it useful to use and extend the OKE simulator as a way to prototype and debug parts of their application code.
To build the OKE simulator right click on the _OpenKitchenEquipment_OKE project in the Solution Explorer pane and click Set as StartUp Project. To change the default command line parameters, go to Project->Properties->Debugging and modify the Command Arguments field. On the toolbar you can launch the debugger by clicking the Local Windows Debugger option.