ESP8266 Gyro_Database

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
samerou
Posts: 38
Joined: Mon Feb 11, 2019 12:51 pm

ESP8266 Gyro_Database

Post by samerou » Wed Mar 27, 2019 8:08 pm

dear all ,
Thank you for your support privatly or but respond to my questions but unfortuanlly I'm completly lost and getting my mind more messier ,
The probleme that I'm finding alot of information ( servers , uasyncio, mqtt,esp,...) but I can't find what I need to do So I decided to post Question with the exercice that I'm doing right now :

I'm using ESP8266 , gyro sensor and UpyCraft as plateform to develop with so What I'm trying to do is to send data provided by my sensor to an external server out my ESP8266 in order to use it later by another device or APP my data are like this :

Code: Select all

X     Y     Z     T


-71     161     97     43.3065

-70     66     75     43.4947

-46     167     82     43.4947
But I'm stuck in doing because I Don't have really the right informations to continue .
I read many sites and informations until my mind became full of manything without finding the right way to start
Thank you in advance ,
B.R

Samerou "Beginner"

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: ESP8266 Gyro_Database

Post by kevinkk525 » Wed Mar 27, 2019 10:56 pm

Do you need the data in realtime? Or just every few minutes?
How will the app/pc receive the data?
Does mqtt fit your purpose?
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

samerou
Posts: 38
Joined: Mon Feb 11, 2019 12:51 pm

Re: ESP8266 Gyro_Database

Post by samerou » Thu Mar 28, 2019 6:40 am

kevinkk525 wrote:
Wed Mar 27, 2019 10:56 pm
Do you need the data in realtime? Or just every few minutes?
How will the app/pc receive the data?
Does mqtt fit your purpose?
Thank you kevinkk for your reply
Yes I need the realtime data and I gonna develop an app later for extract those data in order to use them

And mqtt is good, so yes I think

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: ESP8266 Gyro_Database

Post by kevinkk525 » Thu Mar 28, 2019 7:34 am

MQTT is not the best way for realtime data but I don't know what's best in that case as you will probably want to stream that data directly to the app without a server in between?
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

samerou
Posts: 38
Joined: Mon Feb 11, 2019 12:51 pm

Re: ESP8266 Gyro_Database

Post by samerou » Thu Mar 28, 2019 7:52 am

kevinkk525 wrote:
Thu Mar 28, 2019 7:34 am
MQTT is not the best way for realtime data but I don't know what's best in that case as you will probably want to stream that data directly to the app without a server in between?
I can't use something like a server "similar to wampserver (Tables) and SQL " the server will be on my PC and I will send messages from my esp there.
Last Time I talked with @roberthh about sending messages to PC what he said is :
"What you can do is sending messages from the ESP8266 to a PC and write it to a file there. You would need a small server on the PC for that. This server may be a small python script If you connect by WiFi, the PC with its server may not even have to be local. Please note, that "Server", is a software, which provides a service (here: receiving data & storing it). "

I don't know how to achieve that , well I googled MQTT and I found that is used also for facebook messenger which is realtime app no ?

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: ESP8266 Gyro_Database

Post by kevinkk525 » Thu Mar 28, 2019 8:47 am

Depends on what you think is realtime. MQTT is very fast and probably the best to start with. If it doesn't offer enough performance, you could always change to something else.
At your level of knowledge, I'd definitely start with MQTT before writing something else.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

samerou
Posts: 38
Joined: Mon Feb 11, 2019 12:51 pm

Re: ESP8266 Gyro_Database

Post by samerou » Thu Mar 28, 2019 3:21 pm

kevinkk525 wrote:
Thu Mar 28, 2019 8:47 am
Depends on what you think is realtime. MQTT is very fast and probably the best to start with. If it doesn't offer enough performance, you could always change to something else.
At your level of knowledge, I'd definitely start with MQTT before writing something else.
Realtime ,everything you measure is published to server every second I think but could you please provide me something to follow and guide me with the first steps to do in order to reach my objectif

Thank you Kevinkk for your support

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: ESP8266 Gyro_Database

Post by kevinkk525 » Thu Mar 28, 2019 4:47 pm

https://github.com/micropython/micropyt ... qtt.simple which doesn't need you to know about asyncio.
Once you get that running, you can make it more robust with: https://github.com/micropython/micropyt ... qtt.robust

Public mqtt broker: https://github.com/mqtt/mqtt.github.io/ ... ic_brokers
Or if you want to install one locally on your raspberry pi or similar: https://mosquitto.org/
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

Post Reply