Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

A Netduino, an iPhone and a Bluetooth Low Energy Module

Netduino Low energy iPhone

  • Please log in to reply
10 replies to this topic

#1 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 24 August 2013 - 10:54 PM

A rainy day in North Yorkshire gave me the perfect excuse to break out the Netduino and start to play with the RedBear 4.0 low energy module.

 

Full post describing the experiment along with video can be found here.  You can also find a video of the application turning LEDs on and off on YouTube.

 

Regards,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 25 August 2013 - 12:49 AM

Wow, that's pretty detailed Mark. Very nice; thanks for sharing it with us! What is the next step with this? Chris

#3 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 25 August 2013 - 06:51 AM

I'm thinking about extending the previous post on IR and putting the two together to get a multifunction remote control.

 

I have a little more work on the iOS framework to get a better understanding of the Bluetooth 4.0 libraries so that I can work with other modules.  Perhaps get the iPhone talking to the PC.

 

Regards,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#4 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 25 August 2013 - 11:48 AM

Chris,

 

I did try connecting to the AGENT emulator using a SerialPort but got no where.  I could connect the iPhone to the BLEMini and then the BLEMini to an FTDI cable.  This appeared on the PC as COM3.  I verified that the iPhone application would talk to the PC using a console application and data was being sent through to the PC OK.

 

I then modified the AGENT emulator config to contain the following:

<PhysicalSerialPort id="COM1">    <ComPortHandle>Usart1</ComPortHandle>    <PhysicalPortName>COM3</PhysicalPortName></PhysicalSerialPort>

Compiling a simple test application worked OK but the events never got fired.  Application on the AGENT looked like this:

public class Program{    static Bitmap _display;    public static void Main()    {        SerialPort sp = new SerialPort("COM1", 57600, Parity.None, 8, StopBits.One);        sp.DataReceived += sp_DataReceived;        _display = new Bitmap(Bitmap.MaxWidth, Bitmap.MaxHeight);        _display.Clear();        Font fontNinaB = Resources.GetFont(Resources.FontResources.NinaB);        _display.DrawText("Hello world.", fontNinaB, Color.White, 10, 64);        _display.Flush();        sp.Open();        Thread.Sleep(Timeout.Infinite);    }    static void sp_DataReceived(object sender, SerialDataReceivedEventArgs e)    {        if (e.EventType == SerialData.Chars)        {            byte[] buffer = new Byte[32];            int amount = ((SerialPort) sender).Read(buffer, 0, 32);            if (amount > 0)            {                _display.Clear();                Font fontNinaB = Resources.GetFont(Resources.FontResources.NinaB);                _display.DrawText(buffer[0].ToString(), fontNinaB, Color.White, 10, 64);                _display.Flush();            }        }    }}

Regards,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#5 Juzzer

Juzzer

    Advanced Member

  • Members
  • PipPipPip
  • 135 posts
  • LocationHertfordshire, UK

Posted 25 August 2013 - 01:19 PM

Nice work Mark,

 

It's a rainy day in North Herts so if you have a Windows 8.1 image i can send you the equivalent in C# using the new low energy API's...

 

Cheers

Justin



#6 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 25 August 2013 - 03:00 PM

It's a rainy day in North Herts so if you have a Windows 8.1 image i can send you the equivalent in C# using the new low energy API's...

 

Thanks for the offer - you have PM.

 

Now I just have to get the 8.1 iso installed....

 

Cheers,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 25 August 2013 - 04:02 PM

Hi Mark, There used to be a bug in NETMF where the DataReceived event needed to be wired up _after_ the serial port was opened. We fixed that in Netduino, but I'm not sure if it's fixed in the emulator BSP. I'll check on that. If you'd like to work through the emulator issue over on the AGENT forums, we'd be happy to diagnose. It would be cool to see all of these working together. Chris

#8 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 25 August 2013 - 04:54 PM

Chris,

 

I was just trying it more out of curiosity.  I've moved the DataReceived binding and it still does not work.

 

Cheers,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#9 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 26 August 2013 - 08:29 PM

Hi Mark, Okay, we'll test this out and see what's up. Chris

#10 darkSol

darkSol

    Member

  • Members
  • PipPip
  • 13 posts

Posted 27 August 2013 - 02:03 PM

Awesome!

 

Now we just need an Internet -> Bluetooth passthrough of some sort so that the Netduino can do web requests/responses...

 

This would help a LOT with Agent work - and portable Netduino applications.

 

Keep up the good work!



#11 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 02 September 2013 - 12:20 PM

Now we just need an Internet -> Bluetooth passthrough of some sort so that the Netduino can do web requests/responses...

 

You mean like this (sorry it's blurry):

 

 

The first step is to connect to the iPhone and the Netduino using Bluetooth LE using the upper button.  The lower button gets the weather from Yahoo and then sends a summary of the data to the Netduino Plus 2.  The Netduino then displays the weather on the LCD screen.

 

The application running on the iPhone calls the Yahoo weather API to get the weather for York and Paris alternatively.

 

Regards,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter






Also tagged with one or more of these keywords: Netduino, Low energy, iPhone

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.