Guest post by Huaqiao Zhang, developer for VMware and contributor to EdgeX Foundry
Preface
When users start using EdgeX, they could quickly run the service framework according to the official documents of EdgeX Foundry. EdgeX is a headless framework; often running in environments where there is no user interface capability or on systems that don’t have a display. As a developer, this might be a bit inconvenient. I decided to use an HTTP client tool and call EdgeX’s Restful APIs to become familiar with the features. However, you might desire something that is easier and more friendly to use.
This is what gave me the idea to create a Web Console where users only need to operate in the browser instead of manually typing in a lot of commands with parameters and assemble complex JSON data. According to the EdgeX roadmap, the integration of EdgeX to various system management capabilities will soon allow those system management products, which often offer user interface consoles, to help users operate and manage EdgeX. Importantly, these management systems will help manage multiple instances of EdgeX and the platforms it runs. The Web Console that I created and contributed to the EdgeX, can serve as a tool for developers that want a better experience in interacting with the EdgeX microservices, or as a good starting point for those looking to create more extensive interfaces.
Why we need the Web Console
When a new user wants to add a new device to a gateway, if there isn’t a Web Console, he has to put some time and effort of learning the Restfull API of EdgeX Foundry and needs to confirm whether the relative data exist for DeviceService, DeviceProfile, DeviceAddress, etc. If not, he has to create it, then gets the ID or Name of that feature. Finally, he assembles complex JSON data and upload it. As another example, sending commands to a device could be even more complicated. All these could be hard for a new user or an on-site debugging engineer, but a Web Console would make it easier.
How to manage multiple gateway instances
When an enterprise uses EdgeX Foundry, multiple gateways can be deployed onsite. In most cases, each gateway has an internal IP address in the LAN rather than an Internet address. So, how to manage these gateways via a web console? There are two approaches:
- A Web Console is deployed to each gateway. In this case, users need to remember the address of each gateway to operate and maintain multiple web consoles. Each gateway has to cost some resources to run its own web console.
- Multiple gateways share one Web Console. In this case, there is a method to switch among all the gateways. All operation requests will be proxied to the selected gateway. With this approach, users only need to remember one address and maintain one Web Console.
Comparing the two options above, I prefer the later one. The limitation is that all gateways must be accessible to the host where Web Console is deployed. But in a company’s intranet, this should not be difficult.
Problems solved and basic implementation
The assumptions and expectations of multi gateway sharing Web Console are:
- Gateways can be anywhere, but for an enterprise, they may all be in the intranet.
- The host, which the Web Console is deployed on, can be one of the gateway or a PC that can access all gateways directly. So, the console should be very light weighted.
- All operation requests should be dynamically proxied to the gateway selected by the user.
- Multiple users could operate different gateways at the same time without affecting one another.
Based on these requirements, the fundamental architecture is shown below:
The basic user’s operation flow is shown as below:
- After login, a user will be navigated to the management page of the default gateway. If there are no gateways at all or none selected, most menu items will not be permitted to operate.
- When the user selects or creates one gateway, the metadata of gateway are stored into the local database in the web console.
- Once one given gateway is activated, all operations will be proxied to the target gateway, then the data will be returned to Web Console.
- Multi-user’s operations on different gateways will not affected one another.
Some necessary operations are illustrated below.
Check it out the video demo here: https://www.youtube.com/watch?v=2EOHR_gUeic.
Conclusion
This is just a prototype. I would like to gradually add some new features, such as a gateway location information using google map and video streaming. If you are interested in this web console for EdgeX Foundry, and want to join me on the effort, please ping me at https://twitter.com/Huaqiao_Zhang or the repos at GitHub: https://github.com/badboy-huaqiao/simple-local-gateway-console or https://github.com/badboy-huaqiao/edgex-foundry-web-console.
For more technical details, visit the EdgeX Foundry wiki page.
If you have questions or comments, visit the EdgeX Rocket.Chat and share your thoughts in the #community channel.