Doubts setting up own server


#1

Hello, I’m Eduardo from Argentina, I apologize in advance if I make mistakes writing, I don’t speak english very well.

I saw io.adafruit.com and I wanted to try setting up my own home server. I have 2 computers:

Server1: Apache, PHP and postgresql. LAN IP and ddns.

Server2: EMQX (emqtt.io). LAN IP and another ddns.

1) About EMQX User Authentication: it could be client id, user and passwd, mysql, postgresql, etc. I don’t know which one to choose. If I use the web server to provide user registration, Should I user postgresql ? or… Should I use just client id generated by user registration? Which one do you recommend me?

2) I didn’t saw the tutorial “Learn, How to save MQTT messages into a MySQL Database” yet because I don’t have the server well configured. Do I need to setup a db in Server2 or can I use the db from Server1 ?

3) EMQX has an api to publish/subscribe/etc. If I want to have in Server1 graphics and that stuff like adafruit, Do I need to have another web api in web server or just a simple page that use EMQX api to get the data?

4) This doubt depends on answer of 1 and 3, I want to each user only publish/subscribe to his own topic. Is that a EMQX configuration or if I use a web api is an api access control?

I think that’s all for now, if you have something else to recommend me, I will appreciate.
Thank you!

Eduardo.-


#2

Hi Eduardo,
I haven’t dealt with EMQX after setting up the server once during tutorial. I am not good at server side things. I only know some stuff which i got working for posting to mysql database using dreamfactory.

  1. The authentication interms of devices, we use username and password set in config files. I havent explored beyond that. If you know web development using erlang you can experiment and teach us too :slight_smile:
  2. The tutorial is how to get data on EMQ and save to database using REST API created by Dreamfactory. I create DB on same instance itself.
  3. You need to save data somewhere and need API for accessing it which dreamfactory provides. I dont think EMQ provides storage options inbuilt. Its just a broker.
  4. If you want him to publish or subscribe to his own topic then you have to give long complicated keys as topics otherwise it would be difficult to maintain the separation for users