I modified the rfduino sample app.

Discuss the company and its products.
marc.graham
Posts: 1
Joined: 02:28, 23 Jan 2015

I modified the rfduino sample app.

Postby marc.graham » 03:01, 23 Jan 2015

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

DonPancoe
Posts: 25
Joined: 06:53, 20 Nov 2014
Location: Philadelphia, PA, USA
Contact:

Re: I modified the rfduino sample app.

Postby DonPancoe » 16:05, 23 Jan 2015

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
Last edited by DonPancoe on 18:04, 27 Jan 2015, edited 1 time in total.

DonPancoe
Posts: 25
Joined: 06:53, 20 Nov 2014
Location: Philadelphia, PA, USA
Contact:

Re: I modified the rfduino sample app.

Postby DonPancoe » 18:03, 27 Jan 2015

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

User avatar
micke
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: I modified the rfduino sample app.

Postby micke » 19:22, 17 Feb 2015

Thanks for sharing, the setup shown in the photo looks really cool :)

TimQ
Posts: 2
Joined: 22:59, 01 Mar 2015

Re: I modified the rfduino sample app.

Postby TimQ » 23:06, 01 Mar 2015

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.

DonPancoe
Posts: 25
Joined: 06:53, 20 Nov 2014
Location: Philadelphia, PA, USA
Contact:

Re: I modified the rfduino sample app.

Postby DonPancoe » 03:02, 02 Mar 2015

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

TimQ
Posts: 2
Joined: 22:59, 01 Mar 2015

Re: I modified the rfduino sample app.

Postby TimQ » 23:08, 04 Mar 2015

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.

tolson
Posts: 7
Joined: 03:33, 04 Mar 2015

Re: I modified the rfduino sample app.

Postby tolson » 04:09, 09 Mar 2015

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

marcomauro
Posts: 1
Joined: 12:59, 30 Jul 2015

Re: I modified the rfduino sample app.

Postby marcomauro » 13:07, 30 Jul 2015

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 !


Return to “General discussion”

Who is online

Users browsing this forum: No registered users and 3 guests