Skip to content

khamada611/ble_live_sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BleLiveSample

Demonstration(my Twitter)

This is a sample of Phoenix LiveView. This webserver gets Bluetooth Low Energy's hert rate sensor data, and view its results.

Image

Key technologies

My environment

System

  • Server : Ubuntu20.04 LTYS
  • Client : Chrome(MacOS and Android8.x tablet)
  • Device : iOS LightBlue
    • LightBlue is BLE(Bluetooth Low Enegry) tool of iOS.

Software (server side)

  • Node_js v12.18.2
  • Erlang 11.0.2
  • Elixir 1.10.4
  • Phoenix 1.5.3

How to build Phoenix server

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Install Node.js dependencies with cd assets && npm install
  • Creates a self-signed certificate etc mix phx.gen.cert
  • Start Phoenix endpoint with mix phx.server or iex -S mix phx.server

Now you can visit localhost:4001 from your browser.

  • In this example, this phx server use a self-signed certificate.

Ready to run in production? Please check deployment guides.

How to use thie server

  • Start this server
  • Get LightBlue to your iOS device.
  • Tap LightBlue
  • Tap 'Create Virtual Peripheral'
  • Tap 'Heart Rate' in list
  • Tap 'Save'
  • Confirm check mark of 'Hert Rate' .
  • Then display LightBlue application. don't use screen lock while this test
  • You visit https//xxx.xxx.xxx.xxx:4001 (xxx is server's IP) with using Chrome(*1)
  • Then you can check like this gif

(*1) suppoted chorme is .. https://www.chromestatus.com/feature/5264933985976320

More key technologies informations

About Phoenix

About LiveView

About WebBluetooth

Licences

ble_live_sample\assets\js\heartRateSensor.js is from

ble_live_sample\assets\static\images\puronama image files are called Puronama-chan. Puronama-chan is licenced character by by Pronama LLC.

You can use these image files FREEWARE ONLY.

P.S.

  • I'm beginner of web system, then these code maybe strange :-)
  • You can try this free software, but you will need to take full responsibility for your action.

About

Web bluetooth on Phoenix framework

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published