webdm is installed, now what?
Michael Nelson
michael.nelson at canonical.com
Tue May 19 02:14:39 UTC 2015
On Sat, May 2, 2015 at 11:53 AM, Syd (Sydney) Logan <slogan at broadcom.com> wrote:
> Hi,
>
Hi Syd. I'm guessing from the email headers that you've long since
found your answers (was it caught in a moderation queue?). But I
happened to be following the snappy docs right now (also learning), so
thought I'd answer what I can...
>
>
> I'm pretty new to Ubuntu Core (like, I started yesterday :-). My
> understanding is that the UI for Ubuntu Core is provided via web apps
> written for webdm.
As the others mentioned, webdm is the web interface for the 'device
manager' - allowing you to browse available snappy apps and install
them on the device. So apps aren't written for webdm, but can be
installed by webdm (or the cli).
>
>
>
> There is a terse web page hosted by canonical that shows how to install
> webdm, and then point an external web browser via the device's IP address at
> port 4200. https://developer.ubuntu.com/en/snappy/guides/webdm/. I followed
> the directions, webdm installed using snappy, and webdm started up, as we
> can see from the output of systemctl list-units:
I just did the same snappy install webdm on an ec2 image (but this
could be an out-of-date image [1]) to try to reproduce your issues...
>
>
>
> (amd64)ubuntu at localhost:/var$ sudo systemctl list-units | grep webdm
>
> webdm_avahi_0.5.service
> loaded active running Avahi daemon
>
I see an additional webdm_snappy:
ubuntu at ip-x-x-x-x:~$ sudo systemctl list-units | grep webdm
webdm_avahi_0.1.1.service loaded active
running Avahi daemon
webdm_snappyd_0.1.1.service loaded active
running Snappy WebDM
Not sure why that was missing for you.
> When I try to connect at port 4200, I get basically a connection refused
> (http or https), using device's ivp4 address.
>
>
>
> Note that netstat actually doesn't show anything listening on 4200. Or under
> the name webdm:
>
>
>
> (amd64)ubuntu at localhost:/var$ sudo netstat -anp | grep 4200
>
Must be related to the missing webdm_snappy service, as I see:
ubuntu at ip-x-x-x-x:~$ sudo netstat -anp | grep 4200
tcp6 0 0 :::4200 :::*
LISTEN 967/snappyd
(and can connect)
> 1) Is webdm what I think it is, the web server part of what would amount to
> the lamp stack for Ubuntu Core?
Nope, it's just one webservice that you can add to the device. You'll
see in the store there are others (xkcd-webserver etc.). You can
create your own app serving http on a certain port.
>
> 2) If so, how do I develop apps for it that can invoke code and get
> responses (I need to issue calls to another service, calling python scripts
> that know how do that and reading their stdout would work fine, at some
> point I need to call a binary external to the web browser to do.) php
> popen-like functionality, or system if necessary?
You might find Barry's notes about creating python snaps useful:
http://www.wefearchange.org/2015/04/creating-python-snaps.html
>
> 3) If not, then what constitutes a GUI app for this platform, and how do I
> develop it?
A web service is certainly one way to provide a GUI for functionality
in your app, see Sergio's example here:
http://blog.sergiusens.org/posts/Ubuntu%20Core/
The benefit is that you've a GUI without needing any extra frameworks.
I assume that there is or will be work going on to add frameworks
(https://developer.ubuntu.com/en/snappy/guides/frameworks/) supporting
other non-web UIs for devices, but don't know anything about that.
>
> 4) Perhaps more important for now, when I follow the directions I get the
> service to start but it is not listening on 4200?
I'm assuming this is now fixed, but was probably an issue with the
webdm version when you installed.
>
> 5) Where do the web pages go for this thing? What is a "hello world" app and
> how would I go about implementing it?
See "Building hello-world for Ubuntu Core" at:
https://developer.ubuntu.com/en/snappy/tutorials/build-snaps/
-Michael
[1] but I did have some issues following the docs for the ec2 getting
started - which I've documented at
https://bugs.launchpad.net/developer-ubuntu-com/+bug/1456390
More information about the snappy-devel
mailing list