interface - single webpage async setup

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
User avatar
patvdleer
Posts: 46
Joined: Mon Jun 13, 2016 11:52 am
Location: Maastricht, NL, Europe
Contact:

interface - single webpage async setup

Post by patvdleer » Sun Sep 16, 2018 8:24 am

Hey Guys, any of you have any advise on setting up a simple single page web interface to control a machine that reports progress back?

I was thinking about setting up picoweb with a websocket and sending the updates async that way. Any help/advise is welcome!
NodeMCU v0.9 / V1 / V2 / V3
WeMos D1 Mini
WeMos Lolin32 v1.0.0
WeMos Lolin D32 Pro V2

User avatar
mattyt
Posts: 410
Joined: Mon Jan 23, 2017 6:39 am

Re: interface - single webpage async setup

Post by mattyt » Sun Sep 16, 2018 10:46 pm

Not much to add except that I have a need to do something very similar - and had identified picoweb/websocket as likely implementation candidates too (probably with a Vue/socket.io frontend). I'm probably not going to get started on my solution for a few weeks but I'll keep you posted with what I develop.

User avatar
patvdleer
Posts: 46
Joined: Mon Jun 13, 2016 11:52 am
Location: Maastricht, NL, Europe
Contact:

Re: interface - single webpage async setup

Post by patvdleer » Mon Sep 17, 2018 10:44 am

I'm thinking about setting up the same-ish thing as the WebREPL but I would like to provide the webpage via an HTTP server instead of heaving to download it separately.

The alternative might be something like the https://www.arduino.cc/en/Reference/Firmata but I think this would come done to basically the same thing
NodeMCU v0.9 / V1 / V2 / V3
WeMos D1 Mini
WeMos Lolin32 v1.0.0
WeMos Lolin D32 Pro V2

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: interface - single webpage async setup

Post by pythoncoder » Tue Sep 18, 2018 8:51 am

Another approach might be to use MQTT to communicate between the controlling device and the machine.

It would be easier to help if you clarified the physical setup. What is the controlling device? How is it linked to the machine? By WiFi? Does the controlling device need to present a web interface to the network or does the user interact with it directly?
Peter Hinch
Index to my micropython libraries.

User avatar
patvdleer
Posts: 46
Joined: Mon Jun 13, 2016 11:52 am
Location: Maastricht, NL, Europe
Contact:

Re: interface - single webpage async setup

Post by patvdleer » Tue Sep 18, 2018 3:55 pm

I'm making a machine to wrap wires, mainly for vaping, using a simple brushless motor and a stepper motor on a 3D printer like structure. This will be hooked up to a WeMos Lolin D32 Pro V2 which will be using wifi. Due to the amount of options (types of wires, thickness and such) a psychical interface isn't easy to build
NodeMCU v0.9 / V1 / V2 / V3
WeMos D1 Mini
WeMos Lolin32 v1.0.0
WeMos Lolin D32 Pro V2

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: interface - single webpage async setup

Post by pythoncoder » Tue Sep 18, 2018 5:00 pm

OK, so where is the user interface hosted? On a local PC or does it need to be internet accessible?

My point here is that if it's a local PC there doesn't need to be a webpage. You could write the UI in CPython. It would communicate with the D32 Pro using MQTT (paho) and run the UI using one of the CPython GUI libraries.
Peter Hinch
Index to my micropython libraries.

Post Reply