Page 1 of 1

ESP8266 Smartwatch as Controller

PostPosted: Wed Mar 02, 2016 18:59
by Jeija
Since my Lua HTTP API code has been merged just recently, I thought I could make a little video that shows how these features can be used.

In my case, I am using a DIY ESP8266-based WIFI Smartwatch with integrated gyroscope and accelerometer as a controller for minetest. I hope this is an inspiration to some modders to make good use of the new HTTP APIs. You could also use these APIs to extend your mods with collaboration features (store creations online, trade between game servers, access outside resources / webpages from within minetest and much more).

Click this picture to watch the video on YouTube:

Image

Re: ESP8266 Smartwatch as Controller

PostPosted: Wed Mar 02, 2016 20:28
by benrob0329
That's awesome!

Re: ESP8266 Smartwatch as Controller

PostPosted: Wed Mar 02, 2016 21:02
by jp
A good way to have cramps after 1h of playing. But nice prowess ;)

Re: ESP8266 Smartwatch as Controller

PostPosted: Thu Mar 03, 2016 01:25
by philipbenr
Cool. All you need now is a set of VR goggles to go with it. XD. would be fun though...

Re: ESP8266 Smartwatch as Controller

PostPosted: Thu Mar 03, 2016 08:08
by srifqi
... *speechless* ...

Re: ESP8266 Smartwatch as Controller

PostPosted: Thu Mar 03, 2016 09:36
by indriApollo
Your smartwatch is the server right ? And the game has to poll for directions on a rapid interval (or is it the other way around ?)

EDIT : You answer that in the video, I just had to listen till the end (sorry)

Re: ESP8266 Smartwatch as Controller

PostPosted: Tue Sep 20, 2016 12:47
by TitiMoby
Your work is amazing.
Now, the problem is I didn't find example of your Lua Http API.
The doc is a bit hard for me, is there any example somewhere ?

Re: ESP8266 Smartwatch as Controller

PostPosted: Wed Sep 21, 2016 09:43
by Jeija
Something like this should get you started:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local http_api = minetest.request_http_api()
if not http_api then
   print("ERROR: in minetest.conf, this mod must be in secure.http_mods!")
end

minetest.after(5, function()
   http_api.fetch({
      url = "http://example.org",
      timeout = 1
   }, function (res)
      print(dump(res))
   end)
end)

Re: ESP8266 Smartwatch as Controller

PostPosted: Wed Sep 21, 2016 21:36
by TitiMoby
Thanks a lot, I'll start like this and keep you informed when something happens ;)

Re: ESP8266 Smartwatch as Controller

PostPosted: Sun Sep 25, 2016 16:02
by TitiMoby
First step is done : Minetest is able to retrieve data from devices through MQTT.
To resume, I use [url-www.eclipse.org/ponte]Ponte[/url] to have a bridge between HTTP and MQTT worlds.

An Esp8266 Huzzah is publishing a message to the MQTT part of Ponte server.
Then the Minetest mod fetch it through the feed Url.

Image

I have to figure out how to push data from Minetest now.

Once more, thanks Jeija for the help