bask185
Posts: 120
Joined: Thu Mar 09, 2017 11:39 am
Location: Netherlands

What's the best way for setting up a server?

Mon Feb 19, 2018 12:00 pm

I have several d1 wemos wifi modules for my home automation and I want to use a raspberry to set up a server. What I want is the following:
I want a raspberry to host a server on my WLAN, all wifi peripherals must login as clients on this server. The clients must be able to communicate to eachother through this server.

For instance. When my alarmclock goes off, I want it to send one or two bytes to the server containing an ID and an instruction which relays these bytes to the wifi module of my thermostate (using the ID).

And I want to make a Qt or processing application for my TV (Ubuntu OS) as well as for my phone which acts as a client as well. Via this application I want to controll the LED lighting in my living room, the temperature the curtains etc etc.

What I would likec to know if my approach is a viable approach to begin with and what would the easiest way be to set up such a server? I was thinking of writing a C program but I heared there were better ways to achief it

broo0ose
Posts: 317
Joined: Wed Dec 14, 2011 3:59 pm
Location: Wirral, UK

Re: What's the best way for setting up a server?

Mon Feb 19, 2018 10:06 pm

I'd go for MQTT as a protocol, it works great for communication between these sorts of clients.
Mosquitto is an MQTT broker that will run on a Pi, whatever you are running on the Wemos modules will most likely have the ability to act as an MQTT client.

User avatar
DougieLawson
Posts: 34166
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: What's the best way for setting up a server?

Mon Feb 19, 2018 10:16 pm

Wemos D1 can do MQTT subscriptions and publishing with https://pubsubclient.knolleary.net
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.


Return to “Advanced users”