Page 1 of 1

I modified the rfduino sample app.

Posted: 03:01, 23 Jan 2015
by marc.graham
Hi,

I took the liberty of updating the Evothings rfduino ledon-off demo app.

I added the ability to read a characteristic and enable notifications. (It just reports the state of a counter on the rfduino).

I did this as I was figuring out how to use the rfduino and Evothings studio so there are no guarantees I did it correctly.

The code is at https://github.com/MarcGraham/evothings-rfduino .

Any feedback would be welcome as I am in learning mode with this topic.

Marc

Re: I modified the rfduino sample app.

Posted: 16:05, 23 Jan 2015
by DonPancoe
I've been doing some work with Evothings and RFduino in recent weeks, using it to read a load cell and display the weight on my Nexus 7. I will give your code a look over the weekend and see if you did anything differently/better than I did.

Don

[edited for spelling]

Image

Re: I modified the rfduino sample app.

Posted: 18:03, 27 Jan 2015
by DonPancoe
Finally got a brief look at your github repository for the RFduino, and it reminded me that I hacked my app out of the original Arduino BLE app, which itself was based on the RedBearLabs BLE Shield, not the RFduino. I will definitely look more into your example in the coming week or so since tighter integration specifically with the RFduino might solve a number of connection quirks I've been facing.

Thanks,
Don

Re: I modified the rfduino sample app.

Posted: 19:22, 17 Feb 2015
by micke
Thanks for sharing, the setup shown in the photo looks really cool :)

Re: I modified the rfduino sample app.

Posted: 23:06, 01 Mar 2015
by TimQ
Hi Guys,

I've been getting to grips with the Rfduino over the last few weeks and just stumbled upon Evothings (It looks like my saviour!).

I'm trying to get sensor data to display in realtime on an app for monitoring purposes. We'd love to connect two Rfduino's to the app so that data can be easily compared. The image above looks perfect for this but I'm unsure how to replicate something similar.

Having a mechanical engineering background and fairly new to coding could anyone provide any help or further sample code for me to study? I'd really appreciate any advice.

Re: I modified the rfduino sample app.

Posted: 03:02, 02 Mar 2015
by DonPancoe
I got pretty much everything I needed to code the RFduino from this blog post.

There are probably some other changes I don't recall but the main difference is, where the example code says...

Code: Select all

Serial.begin(115200); // Arduino code for starting the serial port

Serial.println ( measure() - tare ); // Arduino code for writing a value to the serial port

Replace it with this...

Code: Select all

RFduinoBLE.begin(); // RFduino code to start the BLE radio

RFduinoBLE.sendInt(measure() - tare); // RFduino code for writing a value to the BLE radio


As soon you write your latest sensor value to the BLE radio, it sends a notification to your Evothings app to read the updated value and put it into the display. Here is the code from app.js that does it in my case...

Code: Select all

   startReading: function(deviceHandle)
   {
      console.log('Enabling notifications');

      // Turn notifications on.
      app.write(
         'writeDescriptor',
         deviceHandle,
         app.descriptorNotification,
         new Uint8Array([1,0]));

      // Start reading notifications.
      evothings.ble.enableNotification(
         deviceHandle,
         app.characteristicRead,
         function(data)
         {
            app.appendLoad([new DataView(data).getInt16(0, true)]);
         },
         function(errorCode)
         {
            console.log('enableNotification error: ' + errorCode);
         });
   },
   
   appendLoad: function(load)
   {
      var weight = load / 14.6;
      weight = Math.round( weight * 10 ) / 10;
      $("#RFload").val(load);
   },

--
Don

Re: I modified the rfduino sample app.

Posted: 23:08, 04 Mar 2015
by TimQ
Thanks for this Don, I've been pushed onto another project for the time being but hopefully I'll be able to make some progress when I resume with your advice.

Re: I modified the rfduino sample app.

Posted: 04:09, 09 Mar 2015
by tolson
marc.graham wrote:Hi,

I took the liberty of updating the Evothings rfduino ledon-off demo app.

I added the ability to read a characteristic and enable notifications. (It just reports the state of a counter on the rfduino).

I did this as I was figuring out how to use the rfduino and Evothings studio so there are no guarantees I did it correctly.

The code is at https://github.com/MarcGraham/evothings-rfduino .

Any feedback would be welcome as I am in learning mode with this topic.

Marc


Thanks Marc,
You gave me some ideas to get over a hump I was having. I've modified further to get feedback from the RFduino for status of the LEDs to change the APP buttons accordingly and include the RFduino button status. That version is here..
http://forum.rfduino.com/index.php?topi ... 77#msg3777

Re: I modified the rfduino sample app.

Posted: 13:07, 30 Jul 2015
by marcomauro
DonPancoe wrote:I've been doing some work with Evothings and RFduino in recent weeks, using it to read a load cell and display the weight on my Nexus 7. I will give your code a look over the weekend and see if you did anything differently/better than I did.

Don

[edited for spelling]

Image


Hi Don,

It is really interesting appication. I need something like that to start my own project. I am developing an air quality monitoring station.
It would be great having a simple app to show ambient parameter and control start and stop measurement.

If it is possible I'd like to take a look to your code
Thank you so much !