Sharktear's Content - Netduino Forums
   
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.

Sharktear's Content

There have been 9 items by Sharktear (Search limited from 29-April 23)


By content type

See this member's

Sort by                Order  

#46256 pratical enclosure for netduino plus using an old 8mm tape box

Posted by Sharktear on 26 February 2013 - 10:33 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi all,

I want to share my idea for a self made enclosure for my netduino plus.

I took the container of an old 8mm video tape and with an utility knife heated over a flame I cut off the excess plastic shaping the shape of the connectors (power, ethernet, etc ...), then with a file I finished edges. Found space in the container also an Xbee radio module and the wathdog circuit (thanks to Mario Vernari who shared the circuit here on the forum).

I hope it can be helpful to someone else.

Attached Thumbnails

  • NeSAGqdv3t0X3idEI2fRwmQWyVxosijwC01tuO23gCs.jpg
  • LDVuZ5pks9p-upde0xelQ5_nOPUC3VXv2BuxInMVQAE.jpg



#46252 Digital Out high state on power up

Posted by Sharktear on 26 February 2013 - 08:58 AM in Netduino Plus 2 (and Netduino Plus 1)

Yes I think it's the probably cause. Now I'm using the digital pin D6. From the netduino plus pinout I see that it can supply 8mA and probably this current on power up is more lower (when I set the pin high from my code it correctly trigger the relay). Maybe in my past tests I used another pin that supply a 16mA max current and on power up the current of this pin was much higher.

I'll try some other tests using other digital pin to see if I can reproduce the behaviour.

What are the two analog pin that do not have the pull high at power on behaviour? They can be used in digital output mode?

Thanks




#46231 Digital Out high state on power up

Posted by Sharktear on 25 February 2013 - 08:58 PM in Netduino Plus 2 (and Netduino Plus 1)

Yes, I know that. The strange thing is that now the high state on power up does not trigger a relè connected to a digital pin, but months ago this happened.




#46227 Digital Out high state on power up

Posted by Sharktear on 25 February 2013 - 07:11 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi all,

has anything changed with the 4.2 firmware on netduino plus about the high state of the digital out pins?

I have verified that the problem of the high state of the output pins still exist, so when the device start for a few seconds the output pins have an high state. Unlike before, however, the high state does not trigger a relay, as if it hadn't enough current to trigger the threshold of the transistor that drives the relay. I remember that in my previous test (several months ago), the relay was triggering and in fact I searched for a possible solutions to the problem. What has changed?




#45008 Communicating with XBee

Posted by Sharktear on 06 February 2013 - 11:43 AM in Netduino 2 (and Netduino 1)

Hi,

I'm searching for a library that work correctly in api mode for sending remote AT commands to a remote xbee end device. I need to set up the sleep mode of the xbee dinamically, with a sleeping period different for morning and night. Until now I used the Grommet's library already mentioned in this topic, but for this job it doesn't work... It contains a method to send remote command to an end device (SendAtRemoteCommand or similar name) but the value parameter of this methos is single byte value. I need to set up the end device with a sleeping period of 5 seconds, so I need to set SP=0x1F4 where 1F4 is equivalent to 500 (this value is multiplied by 10 from the device so I obtain 5000 ms)... the problem is that 1F4 not fit in a single byte and I need to split in a byte array... Googling I've found a method for splitting an hex value in a byte array but I'm not sure it works correctly. Then I've modified the method of the Grommet's xbee library to accept a byte array for the value parameter, but when I've tryed to send all remote at commands for a sleep period of 5 sec and 1 sec awake it doesn't work and the xbee module remain awake all the time. I've searched for code snippet similar to mine needs but without success.

Anybody has solved this problem or can help me to improve in the correct way? Is there a working way to convert an hex value like 0x1F4 directly with the micro framework?

Many thanks.




#37315 Cosm (ex Pachube) exactly fails twice on three

Posted by Sharktear on 17 October 2012 - 10:48 AM in Netduino Plus 2 (and Netduino Plus 1)

The problem is not on Cosm side, it's service works well, the problem is in the Netduino program. I think that the first call to Cosm (the one that works properly) leave the request socket connection open or in any undefined state, so the second call (after 5 minutes) fail (hangs in the request creation)... then after others 5 min. (with the third call) the code throws an exception and maybe close the request connection. After 5 min. the 4th call works fine, then the 5th and the 6th fails and so on... is cyclic.



#37289 Cosm (ex Pachube) exactly fails twice on three

Posted by Sharktear on 16 October 2012 - 06:29 PM in Netduino Plus 2 (and Netduino Plus 1)

Do you get any response at all?

"Common status codes include:

200 OK: request processed successfully.
401 Not Authorized: either you need to provide authentication credentials, or the credentials provided aren't valid.
403 Forbidden: Cosm understands your request, but refuses to fulfill it. An accompanying error message should explain why.
404 Not Found: either you're requesting an invalid URI or the resource in question doesn't exist (eg. no such feed).
422 Unprocessable Entity: Cosm was unable to create a feed because the EEML/JSON was not complete/valid (e.g. it didn't include a "title" element).
500 Internal Server Error: Something went wrong... Please post to the forum about it and we will investigate.
503 No server error: usually occurs when there are too many requests coming into Cosm - if you get this from an API request then the error message will be returned in XML in the response."

https://cosm.com/docs/v2/


No, any response. No error code because the execution never arrive at the response elaboration



#37271 Cosm (ex Pachube) exactly fails twice on three

Posted by Sharktear on 16 October 2012 - 08:04 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi,
I writed a class that update a temperature sample on Cosm service... the code comes from the book's (Internet of things) examples and strangely work fine once on three.
The class run in a thread that is called every 5 min (300000ms), but the cosm datastream is updated only every 15 minutes because 2 consecutive times the thread fail.
The code is as follows (running on Netduino Plus with 4.2.0.1 firmware:

using System;
using System.IO;
using System.Net;
using System.Text;
using Microsoft.SPOT;

namespace SharktearTests
{
    public static class CosmClient
    {
        const string baseUri = "http://api.cosm.com/v2/feeds/";
        const string apiKey = "HERE MY COSM APY KEY";
        const string feedId = "HERE THE FEED ID";

        public static void Send(string sample)
        {
            Debug.Print("time: " + DateTime.Now);
            Debug.Print("memory available: " + Debug.GC(true));
            try
            {
                using (var request = CreateRequest(apiKey, feedId, sample))
                {
                    request.Timeout = 5000;     // 5 seconds
                    // send request and receive response
                    using (var response =
                        (HttpWebResponse)request.GetResponse())
                    {
                        HandleResponse(response);
                    }
                }
            }
            catch (Exception e)
            {
                Debug.Print(e.ToString());
            }
        }

        static HttpWebRequest CreateRequest(string apiKey, string feedId,
            string sample)
        {
            byte[] buffer = Encoding.UTF8.GetBytes(sample);

            var request = (HttpWebRequest)WebRequest.Create
                (baseUri + feedId + ".csv");

            // request line
            request.Method = "PUT";

            // request headers
            request.ContentLength = buffer.Length;
            request.ContentType = "text/csv";
            request.Headers.Add("X-ApiKey", apiKey);

            // request body
            using (Stream stream = request.GetRequestStream())
            {
                stream.Write(buffer, 0, buffer.Length);
            }

            return request;
        }

        public static void HandleResponse(HttpWebResponse response)
        {
            Debug.Print("Status code: " + response.StatusCode);
        }
    }
}

I also tried the code that use sockets instead of top level class but this time the program fail on the following line:
IPHostEntry hostEntry = Dns.GetHostEntry(host);

here the complete source code:

using System;
using System.IO;
using System.Net;
using System.Text;
using Microsoft.SPOT;

namespace SharktearTests
{
    public static class CosmClient
    {
        const string baseUri = "http://api.cosm.com";
        const string apiKey = "HERE MY COSM APY KEY";
        const string feedId = "HERE THE SERVICE FEED ID";

        public static void Send(string sample)
        {
            Debug.Print("time: " + DateTime.Now);
            Debug.Print("memory available: " + Debug.GC(true));
            try
            {
                using (var request = CreateRequest(apiKey, feedId, sample))
                {
                    request.Timeout = 5000;     // 5 seconds
                    // send request and receive response
                    using (var response =
                        (HttpWebResponse)request.GetResponse())
                    {
                        HandleResponse(response);
                    }
                }
            }
            catch (Exception e)
            {
                Debug.Print(e.ToString());
            }
        }

        static HttpWebRequest CreateRequest(string apiKey, string feedId,
            string sample)
        {
            byte[] buffer = Encoding.UTF8.GetBytes(sample);

            var request = (HttpWebRequest)WebRequest.Create
                (baseUri + feedId + ".csv");

            // request line
            request.Method = "PUT";

            // request headers
            request.ContentLength = buffer.Length;
            request.ContentType = "text/csv";
            request.Headers.Add("X-ApiKey", apiKey);

            // request body
            using (Stream stream = request.GetRequestStream())
            {
                stream.Write(buffer, 0, buffer.Length);
            }

            return request;
        }

        public static void HandleResponse(HttpWebResponse response)
        {
            Debug.Print("Status code: " + response.StatusCode);
        }
    }
}


Any suggestion?



#31651 Help with Netduino Plus + Xbee

Posted by Sharktear on 06 July 2012 - 02:59 PM in Netduino Plus 2 (and Netduino Plus 1)

Hello everyone, I wanted a few tips to make the following project: One of several features that I wish I could run through my Netduino Plus is that it can open the doors of the house via an Android application or more generally through a generic http request. Currently I have developed a simple application for Netduino that work as web servers and waits for commands to execute. At this point I hooked up a 5v relay module and I was able to open and close its contacts over the web. The first problem I have in the next step is this: to open the doors of the house, living in a building where I can not put my hands directly on the doors relays, I decided to connect to the video entryphone and simulate the pressure on the open button. The thing is simple enough, maybe I could even just to trust instead of a transistor to a relay, connected to the poles of the video entryphone button, but to avoid doing harm and decoupling circuits for now I decided to use the relay. The problem here, I opened the video entryphone (brand new and I have been mounted in recent days) and it is a digital model (working with a communication bus to the external controller), this implies the fact of not having dedicated wires opening of the gates. However the problem is not that, because my goal is to hook up my relay in parallel to the video entryphone button, completely transparently to the rest of the operation thereof. The switch of the video entryphone button, however, has more than 2 poles, exacty 6 ... Therefore I can not figure out which of the 6-pin to connect with my 2-pole relay ... actually has 3 relay outputs NO-COM-NC (could be either a normally open to normally closed). Moreover, following the tracks of the PCB connected to pins of the button, I can not understand much, I think that still are used more than 2 pins. I enclose a photo and then asking for help ... I could certainly test the various links of the 2 states of the switch with a multimeter, but perhaps the pinout is standard and I'm doing more problems than it should ... I only want avoid trouble because the video entryphone is new and it cost like a mid-range smartphone ... :( I now turn to the second question: once I've managed to make it all work, I would like to make it "wireless" that is no longer physically connected to the relay Netduino, but make sure it receives commands via a XBee module connected to its twin interfaced to the Netduino. Basically I would have the netduino plus connected via ethernet cable to the home router, then connected to a Xbee module coupled to another module connected to the video entryphone. The first question is: has sense? There are ways cheaper but at the same time as versatile as Xbee to make a sensor / actuator wireless? 2 Xbee modules would cost if I remember correctly around 50 €... Moreover, being Netduino with signals from 3.3 V if I understand it I can connect the Xbee module without using his Shield for that from what I understand, but it simplifies the connection is not essential, is that correct? Many thanks to those who will answer me :-) Please forgive me for the bad english... I translate all with google from Italian and made some correction...

Attached Thumbnails

  • Cattura1.PNG
  • Cattura2.PNG




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.