-->
Page 2 of 3

Re: Combining ESP8266 and MPU6050 and receive data via WiFi

PostPosted: Thu Oct 31, 2019 3:06 am
by Poki
This library has an example of using ESP8266 with MPU6050. It uses Processing on the PC side but you might be able to convert to Python.

https://github.com/jrowberg/i2cdevlib/t ... P6_ESPWiFi

Re: Combining ESP8266 and MPU6050 and receive data via WiFi

PostPosted: Tue Nov 05, 2019 12:59 am
by bukaida
Thanx Poki, but the code is more or less similar to my OP as both are derived from teapot project plus could not find out how to connect it to router anywhere inside the code [No Username/Password option anywhere]. I have a very little knowledge in this domain and my guide has no coding idea about this. Presently I am planning to install micro-python. Any idea whether it may help ? Kind'a stuck at this point.

Re: Combining ESP8266 and MPU6050 and receive data via WiFi

PostPosted: Tue Nov 05, 2019 4:42 am
by Poki
Sorry, I do not know anything about MicroPython.

1. Change this line to set the IP address of the computer running Processing.

https://github.com/jrowberg/i2cdevlib/b ... i.ino#L144

2. The example program uses WiFiManager so the WiFi router SSID and password can
be configured by the user without changing the source code. See the github
README page for the details.

https://github.com/tzapu/WiFiManager

To configure the ESP8266, use a phone or tablet or anything with WiFi to scan
for Access Points (APs). Connect to the AP named "mpu6050". A web page should
open to enter your WiFi router's SSID and password. If not, open a web browser
and enter "192.168.4.1" in the URL window. After the SSID and password have
been entered, the ESP8266 should connect to the WiFi router. It should also
start sending roll, pitch, and yaw to the the IP address set in step 1.

Re: Combining ESP8266 and MPU6050 and receive data via WiFi

PostPosted: Tue Nov 05, 2019 3:51 pm
by schufti
in the example linked above the wifi connection is made via "wifimanager" library (line 218++), see there to get a hint about its features.
The actual transmission to the client (PC) is made via udp packets if defined esp8266 (line 143++ initialisation, 293++ data) IP of client is hardcoded; I would switsch to udp-broadcast for easier operation.
How to receive udp on PC is topic for other forum ...