GithubHelp home page GithubHelp logo

dominikn / esp32-mpu9250-web-view Goto Github PK

View Code? Open in Web Editor NEW
81.0 4.0 34.0 16 KB

Visualizing MPU9250 3D orientation data on the web page hosted by ESP32

License: MIT License

C++ 71.03% HTML 23.44% C 5.52%
esp32 websockets webserver husarnet mpu9250 bno055 threejs

esp32-mpu9250-web-view's Introduction

ESP32-MPU9250-web-view

GitHub stars

Build firmware GitHub license

Visualizing MPU9250 3D orientation data on the web page hosted by ESP32. Using websockets and JSON to send orientation data (quaternion or Euler angles) to the web browser. Visualisation is done using Three.js library. Written using Arduino framework.

MPU9250 is one of the most popular IMU (Inertial Measurement Unit) available on the market. It combines not only 3D accelerometer, 3D gyro and 3D compass but also DMP (Digital Motion Processor). Thanks to DMP we can read orientation data in the form of Euler angles or quaternions directly from the chip.

A web page with a 3D cube visualizing orientation of MPU9250 is hosted by ESP32. Real time data from MPU9250 is sent to a web browser through a websocket. That data is then used by Three.js library (https://threejs.org/) to visualize orientation of the cube in a real time. The web page is available both in LAN and through the internet thanks to Husarnet (https://husarnet.com/).

To run the example, follow the next steps.

Connect MPU9250 to ESP32

Interface between ESP32 and MPU9250 is as follows:

ESP32 <-> MPU9250

P22   <-> SCL
P21   <-> SDA
P19   <-> INT

GND   <-> GND

Remember also to provide appropriate power supply both for ESP32 and MPU9250.

Configure Platform IO IDE

  • Clone the project repo on your disk and open it from Visual Studio Code with platformio installed
  • Open ESP32-MPU9250-web-view.ino file
  • modify line 39 with your Husarnet join code (get on https://app.husarnet.com -> [Create Network] -> [Add Element] -> [Join Code])
  • modify lines 18 - 27 to add your Wi-Fi network credentials
  • upload project to your ESP32 board.

If you face any issues in the process, please visit this site: https://docs.husarnet.com/docs/begin-esp32-platformio#get-platformio .

Open a web page hosted by ESP32

There are two options:

  1. log into your account at https://app.husarnet.com, find box3desp32 device that you just connected and click web UI button. You can also click box3desp32 element to open "Element settings" and select Make the Web UI public if you want to have a publically available address. In such a scenerio Husarnet proxy servers are used to provide you a web UI. Works with any web browser: desktop and mobile.

  2. P2P option - add your laptop to the same Husarnet network as ESP32 board. In that scenerio no proxy servers are used and you connect to ESP32 with a very low latency directly with no port forwarding on your router. Currenly only Linux client is available, so open your Linux terminal and type:

  • $ curl https://install.husarnet.com/install.sh | sudo bash to install Husarnet.
  • $ husarnet join XXXXXXXXXXXXXXXXXXXXXXX mylaptop replace XXX...X with your own join code, and click enter.

At this stage your ESP32 and your laptop are in the same VLAN network. The best hostname support is in Mozilla Firefox web browser (other browsers also work, but you have to use IPv6 address of your device that you will find at https://app.husarnet.com) and type: http://box3desp32:8000 You should see a web UI to controll your ESP32 now.

esp32-mpu9250-web-view's People

Contributors

dominikn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

esp32-mpu9250-web-view's Issues

Information Request

I was wondering how easy / difficult this would be to implement on a single device, and if it can run on an ESP-12E

The reason i ask, is i'm mid-way through creating a project, and i have been using the MPU-9250 to display raw numbers, i think it would be nicer to have a small web element to visualize the direction, roll, pitch, and yaw.

As i'm EXTREMELY new to all this, i was wondering if there's a simplified example, that stores the web assets in spiffs, and just displays the roll,pitch,yaw, and direction within the web page served by the esp itself.

Any help would be appreciated

Tried to compile, got a stack of toolchain errors.

compiler blows up with a big stack of errors starting with:

esp32dev\lib868\WiFiClientSecure\ssl_client.cpp.o


Am I alone here, or anyone else have trouble? The platformio.ini looks ok at first glance.

credentials.h

How to use ?

#if __has_include("credentials.h")
#include "credentials.h"
#else

ESP32s using web-view.ino occur error

Hi when i upload example web-view sketch the serial monitor to print these below

[0;32mI (297) heap_init: Initializing. RAM available for dynamic allocation:�[0m
�[0;32mI (297) heap_init: At 3FFAE6E0 len 00011920 (70 KiB): DRAM�[0m
�[0;32mI (299) heap_init: At 3FFC9BD8 len 00016428 (89 KiB): DRAM�[0m
�[0;32mI (305) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM�[0m
�[0;32mI (311) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM�[0m
�[0;32mI (318) heap_init: At 400919DC len 0000E624 (57 KiB): IRAM�[0m
assertion "false && "item should have been present in cache"" failed: file "/build/esp-idf/components/nvs_flash/src/nvs_item_hash_list.cpp", line 85, function: void nvs::HashList::erase(size_t)
abort() was called at PC 0x400e306b on core 0

Backtrace: 0x40087f9c:0x3ffb23d0 0x4008809b:0x3ffb23f0 0x400e306b:0x3ffb2410 0x400e8c4c:0x3ffb2440 0x400e8146:0x3ffb2460 0x400e8421:0x3ffb24a0 0x400e7780:0x3ffb24f0 0x400e737a:0x3ffb2540 0x400e7403:0x3ffb2560 0x400e742e:0x3ffb2580 0x400d79ec:0x3ffb25a0 0x40122d6f:0x3ffb25c0 0x400e5292:0x3ffb25f0

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:956
load:0x40078000,len:0
load:0x40078000,len:13076
entry 0x40078a58

how to do can solve this problem ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.