mcinnes01's Content - Netduino Forums - Page 2
   
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.

mcinnes01's Content

There have been 82 items by mcinnes01 (Search limited from 10-June 23)


By content type

See this member's


Sort by                Order  

#52600 Call for Secret Labs to Kick Start Go! Bus

Posted by mcinnes01 on 05 September 2013 - 09:43 PM in General Discussion

I would as ever still love to see 1-wire, maybe even a can-bus module? And perhaps a wifi module?

 

Although I feel a chicken and egg argument coming on....

 

Which **should** come first Go! Bus 1.5 or new modules?

 

If you develop a module you would have to write your own firmware which would be a port around Go! bus 1.0. Then what happens when the generic firmware comes out for the STMs with 1.5?

 

Chris if funding is not a route, but developing modules is, can users have an update on where Go Bus 1.5 is.

 

It would be helpful to see:

- An up to date feature set

- Current status of the features

- Current issues

- A detailed definition of the architecture and how the various functions that are complete work and how you expect or propose the outstanding features to fit in.

 

Are SL happy to share this level of detail and perhaps the code for users to contribute/test?

 

There are a fair few people with STM discovery boards, I guess testing can be done for Go! bus 1.5 with an N Go! + STM discovery right?

 

Thanks again and I hope we can spark some community interest back in to Go! :)

 

Andy




#52559 Home Automation

Posted by mcinnes01 on 04 September 2013 - 10:25 PM in General Discussion

Hi Mike,

 

What would you recommend in terms of hosting MQTT? I have played on my laptop with RSMB and Mosquitto. I ideally want to have MQTT running on my home server so I can access it from any of my home automation devices as this will be the central point where all messages are handled.

 

Many thanks,

 

Andy




#54162 Home Automation

Posted by mcinnes01 on 19 November 2013 - 03:45 AM in General Discussion

I have posted an update on my blog...




#54169 Home Automation

Posted by mcinnes01 on 19 November 2013 - 10:10 AM in General Discussion

Yes all the automation will be hardwired back to my 2 main distribution boards. It uses a fair amount more cable than usual but just provides a much more maintainable approach when its all in. Sadly my once nicely plastered walls which I was hoping to not need to do, now all need replastering. That being said I wouldn't recommend this approach unless you are building a house from scratch or are doing a full on refurb.

 

On top of all the electrical cable I am also running a kilometre of network cable in. Again I have 2 racks, one by each distribution board that will house a 96 bay patch panel each and a 48 port POE switch. The plan is to run CAT5 every where for sensors and any distributed intelligence. For example some of the CAT5 although terminated to the patch panel will then split off to my own control boards to carry signals from sensors like PIRs, temperature sensors and perhaps even carry control voltages for things like actuators. One idea I've had is to either get electronic Radiator valves that I can retro fit or the slightly more invasive approach which is to fit valves inline with each radiator. This way I can use ternperature sensors and motion detectors as well as my own granular time patterns to control my central heating. 

 

What I am doing is running a lot of CAT5 everywhere, some in the ceilings some in the floors etc, a lot will be unterminated but there for when I want to use it. Also I have 2 gang RJ45 faceplates everywhere as I will be using CAT5 for phones, web connections etc etc.




#52379 Home Automation

Posted by mcinnes01 on 26 August 2013 - 10:29 PM in General Discussion

Ok so a little time has passed but there have been some major advances in my home automation project...

 

Since my last posts I have played a little with mqtt in various flavours including mosquitto and rsmb...

 

I have also been on a Windows Azure and Web Services course...

 

And employed an electrician to start work at the end of september...

 

After reviewing many different technologies for home automation, as well as getting an estimate for the cost of my rewire I have made some key decisions...

 

Taking a lot of inspiration from super house  I have decided to go for a wired approach, using cat5e to carry pretty much all signals and low voltage around my house. Not only is cat5e relative cheap ~£36 for 305m, it provides shielding, twisted pairs and can carry low voltages happily upto the POE standard of 48v, which covers me for just about every eventuality.

 

Another key decision is that I have taking a radial wiring approach, otherwise known by "node-zero" or "star" wiring. Basically this means having a central point where all wiring comes back to, or in my case 2 points where all wiring comes back to. As my house is over 4 floors (basement, ground floor, first floor and attic) I am having 2 node-zeros; one in the attic and the other in the basement. What this means is the maximum run is only between 2 floors.

 

Essentially the idea is that everything has its own circuit which goes back to a distribution board; located in either the attic or basement. The wiring side of things is a little different than a convensional house; other than a standard consumer board with some RCDs etc, there is very little that reprisents a typical wiring system. From the consumer board 2 circuits (an 80amp for the basement and ground floor and 65amp for the first floor and attic) will come out going to 2 distribution boards. Here this supply will be split up in to functional circuits such as light for each floor, sockets for each floor, boiler, shower, cooker, garden from the relvant distribution board.

 

Each circuit then splits down to granularise the control, so the circuits will all have an RCD, but each component (socket, light etc) will have in most case a relay. And this is where my next decision comes in to play, I have decided to go for a complete home brew approach rather than paying the extortionate prices charged by HAL supplies which invoke some benefits and serveral contstraints each. Not only does price play a key role, but the ability to interface and control things the way I want. One downside to my home brew route is that this technology is untested and has not gurantees or support.

 

To combat this issue I am building a fallback in; there is a requirement in the UK to have a controlable light in each room, and so I am going to keep controls on the walls that are "dumb" controls. Rather than carrying 240v these will however be cat5e carrying 24v, this will have the ability to override my control boards should any software or electronic issues arrise. Some benefits of my approach include using wired control, this removes issues related to wireless and other signals over power. Also using cat5 provides a nice shielded delivery method. Also having my intelligence centrallised (be it centralised to 2 locations) means that I have 2 points of failure, which may sound bad, but is certainly less invasive when distributed intelligence goes wrong and you have to start ripping up floor board or plaster. I will easily be able to replace and identify any broken hardware and my hardware is cheaper as less intelligence (netduinos) are needed. Also having the manual, logic free, electronic overides will provide a failsafe.

 

My control boards are going to be din mounted using something like Cambden Boss enclosures and  will use a din mounted 24v supply and cat5e to connect the control boards to a centralise netduino module. See my other post for more details.

 

I have decided to go for mqtt as my message protocol as inspired by Mike. The Azure and web services course I went on last week gave me some great inspiration for having a service oriented architecture and using queues.

 

I have also built a low power server that runs flat out at around 36 Watts and is completely solid state with no fans or moving parts. This is running server 2012 datacentre core edition, which I am enjoying a steep learning curve on how to configure my first domain and Hyper-V environment. I plan to run several virtual servers on this to create my own Azure like distributed environment, all be it without the ability to automatically scale out across more VMs.

 

Over the coming months I plan to share my project exploits and actively welcome anyones input, ideas, opinions and support. Once I get my server up and running I plan to get mqtt running. I am still to find any detailed information on how to host mqtt and would appreciate any guidance on how to do this or configure the Hyper-V role on server 2012 datecentre core edition.

 

Thanks again,

 

Andy




#52621 Home Automation

Posted by mcinnes01 on 06 September 2013 - 10:47 PM in General Discussion

Cool thanks Mike, I will give it a whirl. Just getting to grips with server 2012 and hyper V.




#52372 Netduino Go Future

Posted by mcinnes01 on 26 August 2013 - 05:22 PM in Netduino Go

Hi Chris,

 

Thanks for the reply, does that mean we are likely to see perhaps an ethernet module this side of christmas which if I remeber correctly uses the STM32? Is there any update on how your testing is going in terms GoBus 1.5 running happily on the STM32?

 

Cheers,

 

Andy




#52089 Netduino Go Future

Posted by mcinnes01 on 11 August 2013 - 02:41 PM in Netduino Go

Hi Chris,

 

What needs to happen to get things like SD shields that use SPI and things like serial wifi modules to work with the shield base? Are these planned for the next release?

 

Are there going to be any interfaces for AGENT to work with GO!?

 

Cheers,

 

Andy




#52106 Netduino Go Future

Posted by mcinnes01 on 12 August 2013 - 09:45 PM in Netduino Go

Maybe a bluetooth module would inject the much needed interest back in to the netduino Go! project, by allowing it to piggyback off the energy that has been put in to Agent? It would drive interest both ways from people who have an Agent watch wanting to control hardware and people who control hardware wanting another interface device by using the Agent smart watch. I understand secret labs are working hard to make sure they deliver their more commercial product, Agent, for Christmas to all of us backers. Does this mean once the watch is up and the production line running, some energy will go back in to the Go! line? I really hope so, I can't wait to do something useful with my Go! :)

 

Andy




#52128 Netduino Go Future

Posted by mcinnes01 on 13 August 2013 - 06:59 PM in Netduino Go

Cheers Mark!

 

It looks interesting, but sadly this will take the spi up on the shield base which I use for other things and with the lack of multi shield support this doesn't leave much scope ;)

 

#Subtext# I was also trying to provoke some interest from Chris and maybe a response?

 

#Off Topic# How was Manchester mini maker faire and where did you hear about it? I missed hearing about it till too late :(

 

Andy




#52329 Netduino Go Future

Posted by mcinnes01 on 24 August 2013 - 08:41 PM in Netduino Go

Is there any road map for go! bus 1.5 to be available in some form that will allow things like the ethernet module and multi shield base support, to come out before Christmas this year?

 

I'm fully automating my house in the next month and it would be great to have Go! as the core, using either ethernet or wifi on a shield base (serial), plus multiple shield bases for extra SPI, Serial etc etc and maybe since the plus 2 has it....the long waited 1-Wire support?

 

Andy




#56345 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 24 February 2014 - 07:38 PM in Project Showcase

Ok will do, I will give it a spin now.

 

Cheers,

 

Andy




#56342 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 24 February 2014 - 07:12 PM in Project Showcase

I should have spotted that, my bad.

 

I updated the code but get a new error on the AddSPI:

The thread '<No Name>' (0x2) has exited with code 0 (0x0).A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dllAn unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dllAdditional information: key exists

It occur on the line _cfg.Add(key, cfg);

            public void AddSPI(int key, SPI.Configuration cfg)            {                lock (_cfg)                    _cfg.Add(key, cfg);            }



#56347 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 24 February 2014 - 08:12 PM in Project Showcase

Success on 1 chip :)

 

 

 

 




#56819 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 15 March 2014 - 04:43 PM in Project Showcase

Hi Hanz,

 

No offence taken, I am taking your advice and investigating a little more before I repost. I have made a better test subject with a load of leds and am just reworking my changes to the code to get a proper test in. I should have some findings shortly so I will post back when I have something more substantial.

 

Many thanks,

 

Andy




#56340 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 24 February 2014 - 06:32 PM in Project Showcase

Hi Hanz,

 

Firstly thanks for taking the time to help :)

 

I have updated to your latest code and still get the problem with the same pin being in use. I was a little unsure on what I needed to do in terms of pin number (point 1). Also I'm not sure what I need to do with the hardware address, does this need to be 0 for the creation of both MCP23S17s?

The thread '<No Name>' (0x2) has exited with code 0 (0x0).A first chance exception of type 'MCP23S17Lib.MCP23S17.MCP23S17Exception' occurred in Testspi1.exeAn unhandled exception of type 'MCP23S17Lib.MCP23S17.MCP23S17Exception' occurred in Testspi1.exeAdditional information: MCP23S17: Pin already in use: Pin_0x0

Many thanks,

 

Here is my current code:

using System.Threading;using SecretLabs.NETMF.Hardware.Netduino;using MCP23S17Lib;namespace Testspi1{    public class Program    {        // Number of registers        private static uint icCnt = 2;        // Pins per register        private static uint icPins = 16;        //Total pins        private static uint pinCnt = icCnt * icPins;        // Sleep        private static int sleep = 200;        public static MCP23S17.OutputPort[] Outs = new MCP23S17.OutputPort[pinCnt];        public static MCP23S17[] chip = new MCP23S17[icCnt];        public static void Main()        {            // create a new instance of the driver class using pin 17 for !CS and pin 18 for IRQ            for (int ic = 0; ic < icCnt; ic++)            {                chip[ic] = new MCP23S17(SPI_Devices.SPI1, Pins.GPIO_PIN_D10, Pins.GPIO_NONE, (byte)ic, 7000);                // Define all outputs                for (int pin = 0; pin < pinCnt; pin++)                    Outs[16 * ic + pin] = chip[ic].CreateOutputPort((MCP23S17.Pins)(1 << pin), false);            }            while(true)            {                foreach (MCP23S17.OutputPort o in Outs)                {                    o.Value = true;                    Thread.Sleep(sleep);                    o.Value = false;                }            }        }    }



#56592 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 02 March 2014 - 11:10 PM in Project Showcase

Carrying the multi SPI conversation on here...

 

Do you think it is possible to incorporate Steffan's multi spi mgr in to your MCP23S17 driver?

 

Thus making it possible to share with MIP without modifying MIP?

 

On another topic...

 

I was considering the use of the bus.

 

If I wanted to dynamically group pins/ports and abstract this further to allow me to create groups or "buses" across chips do you think this is possible.

 

Let me elaborate...

 

Am I correct in saying the use of a bus is to allow for multiple port changes to be made in one write, thus increasing speed and efficiency?

 

If this is correct, then I also understand that I can't make a bus spanning multiple chips, however if for example I wanted to change the state of 10 pins 5 on each chip, then I could create a class that identifies which pins are on which bus and perform 2 writes one for each bus?

 

This is obviously going to be more efficient than 10 separate writes and gives me the ability, for example to "turn off all lights" or "turn off everything".

 

Many thanks,

 

Andy




#56350 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 24 February 2014 - 10:01 PM in Project Showcase

Yes and multi spi works too. Slight issue to work out with my code. The idea of a continuous array of output ports span multiple ics is great, but I'm not sure how I would access the relevant pins for example:

 

(Left power 2 value, right array position)

 

1 - 1
2 - 2
4 - 3
8 - 4
16 - 5
32 - 6
64 - 7
128 - 8
256 - 9
512 - 10
1024 - 11
2048 - 12
4096 - 13
8192 - 14
16384 - 15
32768 - 16
1 - 17
2 - 18
4 - 19
8 - 20
16 - 21
32 - 22
64 - 23
128 - 24
256 - 25
512 - 26
1024 - 27
2048 - 28
4096 - 29
8192 - 30
16384 - 31
32768 - 32
 



#56213 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 19 February 2014 - 11:30 PM in Project Showcase

Out of interest, like the netmf toolbox for the 595s, there is a "chain" method, that allows you to chain multiple 595s; is there a similar function in your fantastic library?

 

Also on pin assignment, I am using a standard netduino 1, I am using the SPI pins (D11,12,13) and D10 as CS. Would I be right in saying D12 should be the IRQ in my situation?

 

Also as the board I have has 2 MCP23S17 chips on it and seemingly no options to add additional CS, can I use just the 1 CS?

 

The boards have (MOSI, MISO, SCK, CS, VCC, GND)

 

Thanks again,

 

Andy




#56228 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 20 February 2014 - 04:40 PM in Project Showcase

Hi

 

I have this board by majenko http://cgi.ebay.ie/w...em=191068114141

 

They have an arduino library here https://github.com/m...kotech/MCP23S17

 

I have also emailed them to find out if they have any details on the pins as requested.

 

I will let you know as soon as I do, do you think I can get the board working for the first chip with your code for testing until I have the details re pins 1,2,3 and whilst you work your bug out?

 

In terms of the examples they all included the irq pin, do just put a "null" in when the irq pin is not needed? 

 

Many thanks

 

Andy




#56209 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 19 February 2014 - 10:27 PM in Project Showcase

Thanks Hanzibal!

 

I have a dual board I bought on ebay, I will let you know how I get on.

 

Thanks again, fantastic work.

 

Andy




#56233 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 20 February 2014 - 08:07 PM in Project Showcase

Hi,

 

I've heard back, waiting on the IRQ pins information and maybe a schematic but got this about the chaining. There are basically 2 little solder pads that can be bridged to get the different values.

 

"[color=rgb(0,0,0);font-family:arial, sans-serif;font-size:13px;]On the left-hand chip (Bank 0) A0 is pulled to ground through 10K?. On the right hand chip (Bank 1) A0 is pulled up to Vcc.[/color]

[color=rgb(0,0,0);font-family:arial, sans-serif;font-size:13px;]On both chips A1 and A2 are both pulled down to ground through 10K?, and the two solder jumpers BA0 and BA1 can be shorted to link A1 and A2 to Vcc respectively.[/color]

[color=rgb(0,0,0);font-family:arial, sans-serif;font-size:13px;]So, by default, the left chip is 0b000 and the right chip is 0b001. Shorting BA0 yields the two addresses 0b010 and 0b011, etc. The 4 combinations of BA0/BA1 (00, 01, 10 and 11) give you the addresses for 4 boards (BA = Board Address)."[/color]

 

No worries on the driver, I'm really grateful for the hard work you have put in to it so far. I will have a go with it as it is a let you know how I get on in the mean time and hopefully you will find a way around the chaining issue. I'm no real C++ developer, but I wonder if the majenko driver for arduino offers any ideas?

 

Thanks again,

 

Andy




#56235 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 20 February 2014 - 08:24 PM in Project Showcase

Will do thanks again. :)




#56247 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 21 February 2014 - 10:48 AM in Project Showcase

Hi Hanz,

 

The board is sounding like a fantastic design as I slowly eke out more details about it.

 

The board has 6 pins either side.

 

VCC                                        I0A (IRQ pin A on chip 1)

GND                                        I0B (IRQ pin B on chip 1)

CS                                           I1A (IRQ pin A on chip 2)

SCK                                        I1B (IRQ pin B on chip 2)

MOSI                                       BA1 (used for altering the address of chip 2)

MISO                                       BA0 (used for altering the address of chip 1)

 

$_1.JPG

 

I will let you know my results :)

 

Andy




#56248 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 21 February 2014 - 11:35 AM in Project Showcase

Hi Hanz,

 

I think I am doing something wrong?

 

With the board I have attached the pins to directly to a standard netduino 1 as follows:

 

Vcc = 3.3v

Gnd = Gnd

CS = D10

SCK = D13

MISO = D12

MOSI = D11

 

// UPDATED code corrected power of 2

    public class Program    {        // Number of registers        private static uint icCnt = 1;        // Pins per register        private static uint icPins = 16;        //Total pins        private static uint pinCnt = icCnt * icPins;        // Sleep        private static int sleep = 200;        public static MCP23S17.OutputPort[] Outs = new MCP23S17.OutputPort[pinCnt];        public static MCP23S17[] chip = new MCP23S17[icCnt];        public static void Main()        {            // create a new instance of the driver class using pin 17 for !CS and pin 18 for IRQ            for (byte ic = 0; ic < icCnt; ic++)            {                chip[ic] = new MCP23S17(SPI_Devices.SPI1, Pins.GPIO_PIN_D10, Pins.GPIO_NONE, ic, 7000);            }                        // Define all outputs            uint i = 0;            for (uint Counter = 0; Counter < pinCnt; ++Counter)            {                if (Counter / 16 == i + 1) { i = i + 1; }                int iPin = 1 << (int)(Counter-(i*icPins));                Outs[Counter] = chip[i].CreateOutputPort((MCP23S17.Pins)iPin, false);            }            while(true)            {                foreach (MCP23S17.OutputPort o in Outs)                {                    o.Value = true;                    Debug.Print(o.Name.ToString() + " is ON");                    Thread.Sleep(sleep);                    o.Value = false;                    Debug.Print(o.Name.ToString() + " is OFF");                }            }        }

I noticed that there were a few pins that were just sat high on chip 2 when I turned GPIO_Pin1 on chip 1 on, on its own (i.e. without any loop)

 

 

Thanks again,

 

Andy





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.