"local" thing not WebThing


#1

Hi all

think I’m missing something here - I have installed the gateway on a RPi3 and everything is running fine as far as I can tell.

I’m trying to work out how I add a “device” that is controlled via the Pi itself. In this particular case I’m running pigpiod and some python RF433 scripts to control power sockets so they’re just sending on/off but I’d like to also receive on/off signals and sending/receiving analogue values locally on the Pi.

I suppose I could expose web url’s with some code based around WebThing (presume I’d need to run a local webservice for each “device”) but this seems like a long route to achieve this and it’ll just take more resources on the Pi. I can install Mosquitto if that’s a potential route (I will be doing this for ESP8266/32 devices anyway) but the MQTT adaptor doesn’t seems to be available out of the box (can anyone point to how to set this up?).

Is there anything (ideally python code) to create device for a (number of) LocalThing’s that are controlled locally on the Pi?

TheBlackSheep


#2

I think I can answer my own question - I’m guessing I need to create an “adapter” and “device” and then an “add-on” to link the device into the framework , possibly modelled on the (node) gpio and (python) TPLink examples but for a generic “local” thing. Is this the correct route?


(Ben Francis) #3

Yep, you got it! This blog post might help.


(Kathy Giori) #4

There is a rather simple way to turn ESP8266 and ESP32 devices into native web things using MicroBlocks.


Get the IP address of the device on your network while it is plugged into your laptop running the MicroBlocks IDE, then you can disconnect and power it anywhere. Enter the IP address into the (+) Scan things page of the Mozilla Things Gateway UI.