ESP8266 Smartwatch as Controller

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

ESP8266 Smartwatch as Controller

by Jeija » Wed Mar 02, 2016 18:59

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
 

User avatar
benrob0329
Member
 
Posts: 1192
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
In-game: benrob03

Re: ESP8266 Smartwatch as Controller

by benrob0329 » Wed Mar 02, 2016 20:28

That's awesome!
 

User avatar
jp
Member
 
Posts: 705
Joined: Wed Dec 18, 2013 09:03
GitHub: kilbith

Re: ESP8266 Smartwatch as Controller

by jp » Wed Mar 02, 2016 21:02

A good way to have cramps after 1h of playing. But nice prowess ;)
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

Re: ESP8266 Smartwatch as Controller

by philipbenr » Thu Mar 03, 2016 01:25

Cool. All you need now is a set of VR goggles to go with it. XD. would be fun though...
 

User avatar
srifqi
Member
 
Posts: 508
Joined: Sat Jun 28, 2014 04:31
GitHub: srifqi
IRC: srifqi
In-game: srifqi

Re: ESP8266 Smartwatch as Controller

by srifqi » Thu Mar 03, 2016 08:08

... *speechless* ...
I'm from Indonesia! Saya dari Indonesia!
Terjemahkan Minetest!
Mods by me. Modifikasi oleh saya.

Pronounce my nick as in: es-rifqi (IPA: /es rifˈki/)
 

User avatar
indriApollo
Member
 
Posts: 144
Joined: Fri Sep 26, 2014 11:34
GitHub: indriApollo
IRC: indriApollo
In-game: SudoAptGetPlay

Re: ESP8266 Smartwatch as Controller

by indriApollo » Thu Mar 03, 2016 09:36

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)
 

TitiMoby
Member
 
Posts: 15
Joined: Mon Sep 19, 2016 09:00
In-game: titimoby

Re: ESP8266 Smartwatch as Controller

by TitiMoby » Tue Sep 20, 2016 12:47

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 ?
 

User avatar
Jeija
Member
 
Posts: 686
Joined: Fri Dec 23, 2011 21:46

Re: ESP8266 Smartwatch as Controller

by Jeija » Wed Sep 21, 2016 09:43

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)
 

TitiMoby
Member
 
Posts: 15
Joined: Mon Sep 19, 2016 09:00
In-game: titimoby

Re: ESP8266 Smartwatch as Controller

by TitiMoby » Wed Sep 21, 2016 21:36

Thanks a lot, I'll start like this and keep you informed when something happens ;)
 

TitiMoby
Member
 
Posts: 15
Joined: Mon Sep 19, 2016 09:00
In-game: titimoby

Re: ESP8266 Smartwatch as Controller

by TitiMoby » Sun Sep 25, 2016 16:02

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
 


Return to Minetest-Related

Who is online

Users browsing this forum: No registered users and 32 guests

cron