Jump to content
David Schwartz

What would use use a TMS WebCore app for that's hosted on an IoT device?

Recommended Posts

This is a bit OT, but I'm curious about something. TMS WebCore now has a Miletus option that lets you build apps that run on Raspberry Pi hardware. 

 

I don't have a complete picture of what the Miletus wrapper does, but it's very similar in function to what Electron does.

 

My notion of it is that it's not much more than a web server that serves up an app written in Delphi that has been translated to javascript -- you have an HTML page that has a SCRIPT tag in the header that loads it into the browser where it runs.

 

If you did this more conventionally, it would be something like, say, a python scriopt running in a REST service that was controlled by a remote app. I don't know if you'd need a separate REST server running with a Miletus-hosted WebCore app.

 

But I guess the part in the browser communicates with something on the other end that allows you to "write-thru" to control things on the device.

 

A use-case that springs to mind most immediately for me is using it to implement some kind of "admin" panel for whatever is running on the device. These devices are generally headless anyway, so it solves that problem.

 

Eg, you could have an app written in whatever that controls something, and you might want a UI-based admin panel to adjust settings. This would be perfect for that purpose. (Think of connecting to your router or printer directly to adjust settings on them.)

 

If the device in question has BT or a WiFi connection, then it could communicate with and control other remote devices, and also control stuff directly using its built-in I/O pins. 

 

I'm just curious what other ideas for use-cases others might have for controlling IoT devices via a remote app like this running in a web browser?

 

Note that the "admin" aspect also implies (to me) using it to control things in your home that IoT is more known for, so you could build an entire control panel for all of the "smart" devices in your home.

 

What else?

Edited by David Schwartz

Share this post


Link to post

/off-topic

Your post title needs a little tweaking, me thinks. 
It is Miletus, not Melitus (which is diabetes).

/on-topic

Many industrial units have web interfaces built in - but these are one more attack vector - and if you are rolling your own - there is the issue of maintenance and even more stuff to deploy to the devices. Personally, I would not want to spend limited resources on an IoT unit on hosting a complex UI.

 

Yes, it can be done this way - but - should it be done this way?

Share this post


Link to post
10 minutes ago, Lars Fosdal said:

/off-topic

Your post title needs a little tweaking, me thinks. 
It is Miletus, not Melitus (which is diabetes).

fixed. thanks.

 

 

10 minutes ago, Lars Fosdal said:

Many industrial units have web interfaces built in - but these are one more attack vector - and if you are rolling your own - there is the issue of maintenance and even more stuff to deploy to the devices. Personally, I would not want to spend limited resources on an IoT unit on hosting a complex UI.

 

Yes, it can be done this way - but - should it be done this way?

Valid question, but this isn't my product. They built it because their users asked for it.

 

Maybe we're saying similar things. I'm curious what use-cases there are besides admin panels.

 

That said, if you're proficient in Delphi, it may be much faster to build something in Delphi than a static web site builder. And if there's any logic required behind the scenes, then the complexity of the traditional approach just doubled or tripled because you'll need to use another language (eg, js, python, php) for that purpose.

Share this post


Link to post

I'd be curious to see the resource requirements of a Miletus app.

 

/off-topic
Still a double use in the title.

 

 

Share this post


Link to post
2 hours ago, Lars Fosdal said:

Personally, I would not want to spend limited resources on an IoT unit on hosting a complex UI.

Complex UI for the web-server differs from non-complex UI only in size; though absolute numbers aren't that much. I doubt RPi would experience any issues transferring 10 Mb page especially considering that likely will happen only once - further user actions will fetch cached scripts.

Of course I mean modern UIs that are almost fully driven by clientside JS. Heavy old-school client-static (that is, generated on a server by templates) surely are a burden.

Edited by Fr0sT.Brutal

Share this post


Link to post
17 hours ago, Lars Fosdal said:

/off-topic
Still a double use in the title.

Sorry, I don't see any.

 

17 hours ago, Lars Fosdal said:

I'd be curious to see the resource requirements of a Miletus app.

Bruno said it's a hair under 8MB. But I don't know if that includes the code needed to emulate the VCL library.

Edited by David Schwartz

Share this post


Link to post
17 hours ago, Lars Fosdal said:

Personally, I would not want to spend limited resources on an IoT unit on hosting a complex UI.

It's just a payload loaded by the HTML page -- a chunk of javascript and maybe some images and icons, which could just as easily be hosted elsewhere if need be. 

 

Funny that I don't see comments like this about the plethora of js libs that average web pages haul in just to make pretty buttons and combo-boxes.

 

Not sure the difference between a "complex UI" and something less complex is going to be significant given the amount of scaffolding needed to host the VCL.

 

That issue aside, it still doesn't answer my question about what use-cases you can think of for this technology on IoT devices.

Share this post


Link to post

From my understanding of Miletus, it uses the standard OS browser anyway, so its just an option to make the web-app "installable".

The additional advantage of Miletus I see is, that it could open and add certain features to a web-app, that wouldn't be possible for a pure browser.

(Like IO/ access or controlling specific hardware, also time-critical tasks, or the like).

To make that option real, TMS would have to open Miletus, best of all as open source, so that it could be easily extended when needed.

That would be a real advantage over Electron.

Edited by Rollo62

Share this post


Link to post
5 hours ago, David Schwartz said:

That issue aside, it still doesn't answer my question about what use-cases you can think of for this technology on IoT devices.

To me this seem useless. If devices are linked into a network they're usually controlled by UI of a head unit or by an app (hi Xiaomi). If they're individual, they rarely require rich UI - raising Delphi server+uniGUI on a "smart" bulb just to change its color... rather silly. With all these messy JS frameworks classic nginx+PHP+user-side static pages are unfairly forgotten but they're still the best choice for simple admin consoles

  • Like 1

Share this post


Link to post
14 hours ago, Rollo62 said:

From my understanding of Miletus, it uses the standard OS browser anyway, so its just an option to make the web-app "installable".

The additional advantage of Miletus I see is, that it could open and add certain features to a web-app, that wouldn't be possible for a pure browser.

(Like IO/ access or controlling specific hardware, also time-critical tasks, or the like).

To make that option real, TMS would have to open Miletus, best of all as open source, so that it could be easily extended when needed.

That would be a real advantage over Electron.

The web-app runs as a js script inside the browser. If you close the browser then reopen it, or navigate away, it's gone. Nothing is persistent. And nothing is running on the site where it was loaded from.

 

However, there does seem to be a back-door they provide on the server it came from that's embedded in the Miletus platform that lets the app running remotely connect with resources on the server. 

 

I imagine they will eventually open it up, but for now it's not. They're still probably making changes that they don't want to proliferate by opening it up early.

 

I don't know diddly about Electron other than some stuff I read that indicates it's extremely bloated with lots of stuff that's not needed all the time. Miletus was inspired by Electron, but is apparently quite slimmed-down.

 

Very innovative IMHO!

Share this post


Link to post
14 hours ago, Fr0sT.Brutal said:

To me this seem useless. If devices are linked into a network they're usually controlled by UI of a head unit or by an app (hi Xiaomi). If they're individual, they rarely require rich UI - raising Delphi server+uniGUI on a "smart" bulb just to change its color... rather silly. With all these messy JS frameworks classic nginx+PHP+user-side static pages are unfairly forgotten but they're still the best choice for simple admin consoles

Well, if you look at everything Delophi produces as a "rich UI" and dismiss using Delphi to build even "dumb forms" then I guess your "classic nginx+PHP+user-side static pages" is going to look much simpler.

 

I built this in WebCore in about an hour. It's far from what I'd consider a "rich UI" although there's a lot that could be done to spiff it up. It's not the kind of thing I'd use WebCore + Miletus to build for an IoT device, but it shows the power available using Delphi to build browser-based web apps.

 

http://bestkeywordmixer.com

 

The JS file for this is 1.8 MB in size (debug version), which is comparable to the size of the standalone Delphi EXE. The Miletus core is just shy of 8MB.

 

Their example demo app is a weather thing that displays the temperature, humidity, and barometric pressure on your device. They built an iOS app to display it in an iPhone to demonstrate the REST API, although it would work just as well running it in the browser.

 

I don't know ... maybe it could be used to remotely turn some lights on and turn up the heat in the house as you're leaving work to come home, then open the garage door as you approached. I don't find that terribly useful.

 

However, if you're doing data collection and/or running some kind of equipment from remote devices, it could be very helpful to allow you to manage them remotely. 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×