Giter Site home page Giter Site logo

blendmicro-node's People

Contributors

shokai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

blendmicro-node's Issues

write 20byte/1packet

BLE has limit its packet size 20byte. and 30msec interval required.
BlendMicro.write function should have a Queue and split 20byte to send message.

connect multiple BLE devices

var devices = ["BlendMicro", "Blend2"];

devices.map(function(device_name){
  return new BlendMicro(device_name);
}).forEach(function(bm){
  bm.on("data", function(data){
    console.log(data.toString() + " - from " + bm.name);
  });

  setInterval(function(){
    bm.write(new Date().toString());
  }, 1000);
});

each devices running samples/echo/echo.ino

this is ok

  1. turn on device A and device B
  2. run node.js
  3. connect A and B

not work

  1. turn on A
  2. run node.js
  3. connect A
  4. turn on B
  5. cannot connect B

cause

each BlendMicro instance has same noble object. So when A has connected, it calls noble.stopScanning() and disturb B.

add BLENano sample code

translate BlendMicro code for BLENano

  • samples/echo/echo.ino
  • samples/read_adc/read_adc.ino

read RSSI

BlendMicro = require 'blendmicro'
bm = new BlendMicro()

bm.on 'connect', ->
  setInterval ->
    console.log bm.rssi
  , 1000

Reopen connection on close

Hi! I'm using the "echo.js" example with a Blend Micro board.

Sometimes it happens to me that the connection close after 20-30 seconds. I have to stop the echo.js (via CTRL+C) and restart it via $node echo.js and it start again.

On Arduino side I have this message error:

data transmmit success!  Length: 15    Data Credit available: 1
Evt Disconnected/Advertising timed out
Advertising started

How to reconnect it automatically?

bm.write not send data

Hello! I use the adc_read sketch and bm.write('Hello'). On blend micro i use Simple sketch from library rBL_nRF8001. Blend micro send data to node, node read data. bm.write not send data

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.