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.

monewwq1's Content

There have been 104 items by monewwq1 (Search limited from 02-May 23)


By content type

See this member's


Sort by                Order  

#19625 Netduino - WiFi

Posted by monewwq1 on 23 October 2011 - 03:54 AM in Project Showcase

Here is a video example I've been meaning to upload. It uses two Netduino's. Each Netduino contains a Gainspan GS1011MIP module and an RGB LED. The Netduino's are powered from 9v batteries, so they are completely wireless.

In this video, the Netduino's connect to each other via an ad-hoc Wi-Fi connection- there are no routers or computers involved in this demo. At the start, each Netduino powers up and sets its LED high. After a short initialization delay, the first Netduino then sends a TCP message to the other Netduino to set a random color for its LED. The second Netduino responds and sets its color. Then the second Netduino sends a TCP message to the first Netduino to set its LED to a random color. The first Netduino responds by setting its color and then sends a message back to the second Netduino, etc., etc...

The effect is a visual representation of the ad-hoc TCP messages between the two Gainspan modules. This could be the basis for a wireless sensor network. I did a rough test in the backyard and these modules can talk back and forth out to 150 feet apart in an open-air scenario.


I moved the modules around in the video just to demonstrate that it is completely wireless. It is kind of a long video, but still cool. My bag of Doritos and my iPad make a brief cameo appearance. Lol

Netduino: Gainspan ad-hoc Wi-Fi communications



#19643 Netduino - WiFi

Posted by monewwq1 on 23 October 2011 - 04:05 PM in Project Showcase

Thanks, but I have tried sending the AT command several times. I even took the time to ohm out the pinouts from the breakout board back to the module and everything seems to be good. I think it's a baud rate issue, but since it's out of the box it should have the default settings. Do you know of a way to reset to factory defaults without using AT commands?


Webenglar,

Have you tried different baud rates to see if you can match with the module?
Are you using 3.3v levels?
Do you have tx on the module going to rx on the computer and rx on the computer going to tx on the module?


I apologize if these questions seem real basic, but just wanted to make sure.

I will check if there is a way to reset to factory default without the uart and will let you know shortly.

Thanks,
Nick



#19623 Netduino - WiFi

Posted by monewwq1 on 23 October 2011 - 03:39 AM in Project Showcase

I just got a gainspan 1011 breakout board in the mail to give my netduino some wireless comm. I looked at the datasheet and it appeared all I had to do to it was put power and rs232 on it and start throwing AT commands down the serial connection. I'm using my netduino for powering the gainspan board. I'm using a rs232 cable with flying leads coming from my computer and a program called RealTerm (v2) for talking to it. I started with the my settings at 9600,8,n,1. When I send the "AT\r" command, I just get jibberish back. It looks like the baud settings are wrong, but those are the default settings from what I can tell. Does anybody have any ideas as to what I'm doing wrong?


According to the documentation, the module requires repeatedly sending the "AT\r" command until an "OK" response is received. Are you sending "AT\r" multiple times until you receive "OK"? If you are, and you're never getting an "OK", it sounds like a baud rate or wiring/setup issue.



#15767 Netduino - WiFi

Posted by monewwq1 on 22 July 2011 - 12:49 AM in Project Showcase

I bought a Netduino Plus but decided I really need to go wireless, so I picked up a Gainspan WiFi breakout board from Sparkfun (http://www.sparkfun.com/products/10505) and after some fiddling with the AT commands, I was able to get a WiFi connection going.



#19598 Netduino - WiFi

Posted by monewwq1 on 22 October 2011 - 03:30 PM in Project Showcase

Hi,

Can you tell me the commands I need to pass using the usb ttl device to firstly connect to my network and secondly do the firmware update.

I have connected to the device and have found my network but can't figure out how to connect to it?

Also I have no idea what I need to do to flash the new firrmware on to it?

I am using the tera term app that came with the firmware update files.

Thanks in advadance your help is much appreciated.

Andy


If you're using a USB-to-TTL connection, just connect it directly to the Gainspan. You do not need to connect to any network. You're using UART comms at that point.

If you have the full documentation, the FIrmware download should have provided a com port program to use for updating the firmware (note: this is not the Tera Term app; it is another app in the download files. SOrry, I don't remember the name of it at the moment).



#19615 Netduino - WiFi

Posted by monewwq1 on 23 October 2011 - 12:57 AM in Project Showcase

Andy, The firmware update program is called gs_flashprogram.exe. It is simple to use. Let me know how it goes. Nick



#19651 Netduino - WiFi

Posted by monewwq1 on 23 October 2011 - 06:43 PM in Project Showcase

I did try different baud rates. No luck. I also thought I saw in either the datasheet or the manual that you can use a PC to talk to it. I'm going straight from the serial port of my laptop to the module. I don't know what the voltage is, I will double check that. Tx and Rx are connected properly. What program to you use to transfer your AT commands?



Oops. You cannot connect directly from a PC serial port to the module. You will need to get 3.3V logic levels, and a standard serial port on a computer is not 3.3V. See how serial ports work. A USB-to-3.3V TTL converter works fine, and that is what I use.



#18887 Netduino - WiFi

Posted by monewwq1 on 07 October 2011 - 02:36 AM in Project Showcase

I'm using the gainspan 1011. I followed your source code and have tcp working nicely, thanks! I'm trying to get the httpsend feature working to send an http post. I setup a php script that accepts two fields and I've verified it works using putty. So far, the php script is telling me I'm sending an empty message. So, I'm definitely talking to the server, just not sending any data. I think maybe I've got the escape sequence incorrect. Here's the relevant commands I'm sending the gainspan:

at+httpconf=20,User-Agent: Mozilla/4.0\r
at+httpconf=3,keep-alive\r
at+httpconf=11,<myhost>\r
at+httpconf=7,application/x-www-form-urlencoded\r
at+httpopen=<myhostip>\r
at+httpsend=0,3,10,/test_post.php,23\r\x1BHname=myName&info=myInfo

Any suggestions? I'm not sure what to try next.


Hi, unfortunately I have not used the built-in http features of the Gainspan. For my Gainspan projects I rolled my own http communications.



#15804 Netduino - WiFi

Posted by monewwq1 on 23 July 2011 - 03:18 AM in Project Showcase

Hi all,

The project files are attached. There are comments in the project indicating how to connect the Gainspan module to the Netduino. The code contains very little error handling, as this is currently in the experimental stage.

Here are links to the documents I consulted to put this together:




#15795 Netduino - WiFi

Posted by monewwq1 on 22 July 2011 - 07:14 PM in Project Showcase

Yes, no problem. I will post the code in a few hours this weekend. I'll provide some details on how to connect it as well.



#15840 Netduino - WiFi

Posted by monewwq1 on 24 July 2011 - 12:01 AM in Project Showcase

Hi, I re-factored the code today. There were issues with the DataReceived event and commands processed way too slowly. Now the commands are near-instantaneous to respond. This also adds the ability for multiple clients to control the LED, and I also added a small PC fan to the circuit, controllable via one of the PWM outputs on the Netduino Plus. The code update is attached.



#15965 Netduino - WiFi

Posted by monewwq1 on 27 July 2011 - 12:52 PM in Project Showcase

Dumb question. Can this be used with a regular Netduino (not Plus)?


Yes, this can be used with the regular Netduino as well.



#16998 Netduino - WiFi

Posted by monewwq1 on 24 August 2011 - 02:45 AM in Project Showcase

Hi Nick,

I ordered a GainSpan module from SparkFun, and thanks to your code was up and running quickly. I haven't done any systematic measurements yet, but got the impression that the module's throughput is rather low.

I thought of using bulk mode transfers, which may be faster, but the documentation (Serial_to_WiFi_Adapter_Guide ver 5_3.pdf) appears inconsistent. I tried the command AT+BDATA=1 to enable bulk mode, and then ESC 'Z' for sending data, but got error messages. My module's firmware version is 2.2.4, btw.

Do you have experience regarding the module's throughput?

Thanks and best regards

Cuno


Hi Cuno,

I am glad to hear you were able to get the Gainspan module communicating. To enable bulk data mode, you need version 2.3.1 of the Gainspan firmware. To obtain version 2.3.1, you would need to sign an NDA with Gainspan for the firmware update. When you say the throughput is low, do you mean the Wi-Fi to serial conversion? You might try adjusting the Baud Rate of the serial connection. Please update me on how you're doing with it. Good luck.



#16132 Netduino - WiFi

Posted by monewwq1 on 01 August 2011 - 01:09 AM in Project Showcase

Hi all, For those interested, just an update on this Gainspan module- please note that in order to obtain the newest firmware and future updates, you will need to sign a mutual Non-Disclosure Agreement with Gainspan. I wasn't real happy about having to do this, but it was relatively painless and the new firmware opened up a world of more possibilities. It took me 8 days to get my NDA approved.



#19278 Netduino - WiFi

Posted by monewwq1 on 16 October 2011 - 11:43 PM in Project Showcase

Hi,

I have just got a gainspan module from sparkfun, and I wondered if you could help...

Firstly can you tell me which version of the firmware do I need (I have the NDK now), I have downloaded both but am not sure which one to use; the Mxp or MEE?

Also how do I then update the firmware?

Finally do you have an example web script as I have not really done much with websites before and don't really know where to begin with that side?

Many thanks,

Andy


Andy,

Out of the box, you do not need to update the firmware. If you need the current functionality, such as Bulk Data mode and others, you'll need to update the firmware.

The part number should be written on the device. Mine is a GS1011MIP, so I would use the MxP firmware. The part number just indicates whether it uses an internal or external Power Amplifier (PA) and whether it uses an external or PCB antenna. For example, an MIP has an internal PA with PCB antenna. An MEE has an external PA with External antenna. See also http://www.gainspan....e/s_modules.php

I update the firmware using a 3.3v USB-to-TTL adapter and the communication software provided with the Gainspan software download. I can't remember the name of the software at the moment but it is included in the download, as long as you have a login and have signed the non-disclosure agreement. Just plug the USB end of the adapter into the computer and wire the 3.3V, Tx, Rx, and Gnd from the ttl adapter to the corresponding pins on the Gainspan module, with Tx to Rx, and Rx to Tx.

As for the example web script, maybe describe what you're trying to do exactly and I can try to help.

Nick



#19989 Monitor & Control your Garage Door with Android App

Posted by monewwq1 on 30 October 2011 - 02:52 AM in Project Showcase

I exclude a problem in my LAN because if I browse the ip of the router (192.168.0.1) from android, I have no problem. The strange thing is that from any other pc on my lan, all works fine... the problem is only from my android smartphone. Any suggest?



Just because you can browse the ip of the router does not mean that there is not a router configuration problem. Perhaps the router is blocking requests to port 80 or whatever TCP port you have configured for your web server. So if you go to http://192.168.0.1, all is fine because the Android phone is connected to the same router connection as your other computers (192.168.0.1 is probably the Default Gateway IP address) and the router is configured to allow local connections to its configuration pages. But if you go to http://192.168.0.7/relay_on, the router is internally blocking that request. I would check the port forwarding and firewall configuration of the router and make sure it is not blocking certain port requests from your Android phone. Some routers have internal log files that you can view to see if that is happening.



#18195 High resolution light measurement

Posted by monewwq1 on 19 September 2011 - 02:30 PM in General Discussion

Hi NickDuino,

I'm just picking up on this thread now, but are you using InputPort to meeasure the time in managed code instead of using InterruptPort (which passes a fairly precise timestamp of the original event)?


Hi Chris,

I am using InterruptPort:

                // the pin is expected to interrupt on rising edges
                InterruptPort _dataOutInterruptPort = 
                    new InterruptPort(Pins.GPIO_PIN_D2, false,
                                       Port.ResistorMode.Disabled,
                                       Port.InterruptMode.InterruptEdgeHigh);

                // add an interrupt handler to the pin
                _dataOutInterruptPort.OnInterrupt += 
                    new NativeEventHandler(_dataOutInterruptPort_OnInterrupt);

And in the event handler _dataOutInterruptPort_OnInterrupt, I am simply counting the pulses with a long variable:

            private void _dataOutInterruptPort_OnInterrupt(uint port, uint state, DateTime time)
            {
                _pulseCount++;
            }

I'm then using the _pulsecount to determine the frequency and then using some additional math to get the irradiance. If I cover the TSL sensor with a black cloth, I do get a few readings from the Netduino, but after that, my Interrupt stops firing. If I shine a bright light on the TSL sensor, I never get any readings and the Netduino becomes "busy" and unresponsive to the IDE.

Perhaps there is too much code in my interrupt routine. I am going to write a real simple version that does not do any irradiance calculations and only prints a very limited amount to the Debug console. I will post the code to this thread later today.



#18126 High resolution light measurement

Posted by monewwq1 on 17 September 2011 - 07:52 PM in General Discussion

Yes, if an Arduino can interface with this sensor, I find it hard to believe that a Netduino cannot.

This is the wiring I am using right now:

TSL235R ------ Netduino
======= ---- ========
GND(1) ---- GND
Vcc(2) ------ +5V
Out(3) ------ Digital I/O pin 2

I also have a 0.1uF cap wired from Vcc to GND, as mentioned in the TSL235R datasheet.

This does not work, and when I try to load my C# via USB, it says: "An error occurred: Please check your hardware." Edit: If I remove the TSL235R from the Netduino, I do not get the hardware error. I have no other devices plugged in to the Netduino.

I also tried wiring it to 3.3V on the Netduino and that does not work either.

Does anyone know what is wrong with my wiring?



#18119 High resolution light measurement

Posted by monewwq1 on 17 September 2011 - 04:37 PM in General Discussion

I am under the impression that I can use an InterruptPort on the Netduino without the need for additional components. Perhaps code like this would work with the TSL235R? I will give it a try and let you know the results.



#18116 High resolution light measurement

Posted by monewwq1 on 17 September 2011 - 02:50 PM in General Discussion

I am trying to find a suitable component that would allow me to measure the brightness of an image appearing on a computer monitor. Specifically, the computer is set up to flash different colored images and I want my Netduino to read and interpret the brightness values of those images. I bought this light-to-frequency converter: http://www.sparkfun.com/products/9768, which looks promising. Does anyone have any other suggestions for suitable components? I suppose I could use a standard photodiode, but I am looking for a large resolution, and I need a fast response time because the colors on the monitor will flash on and off quickly. I am thinking that having a large resolution will allow me to set up a larger range of commands that could occur depending on the light frequency that the Netduino reads. The end goal is to be able to allow a user to program certain aspects of my Netduino using the variances of light frequencies coming from images on a web page. In effect, a "'dark" frequency might represent a "1", and a "light" frequency might represent a "0". A company called Aniomagic has an e-textile product called "Sparkle" that allows you to program it by holding it up to your computer monitor, but I have much bigger plans for this basic idea. You can see "Sparkle's" program page here: http://www.aniomagic...program/?hl=en. Do you think the light-to-frequency converter would work for a Netduino project like this?



#18129 High resolution light measurement

Posted by monewwq1 on 17 September 2011 - 11:29 PM in General Discussion

Ok, this code works, using the wiring method I mentioned in my other reply above:

using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;

namespace TSL235R
{
    public class Program
    {
        // Constants
        const ulong period = 10000;			   // Number of light frequency measurements
        const float area = 0.0092F;			 // Sensing area of TSL235R device (cm2)
        // Variables
        static ulong pulses = 0;		  // Counter of measurements of the TSL235R
        static ulong frequency;		   // Read the frequency from the digital pin (pulses/second)
        static float irradiance;			    // Calculated irradiance (uW/cm2)

        private static InputPort TSL235R_Pin = new InputPort(Pins.GPIO_PIN_D7, false, Port.ResistorMode.Disabled);

        static int readCount = 0;
        static bool result = false;
        static bool prev_result = false;
        public static void Main()
        {
            while (true)
            {
                while (readCount < 10000)
                {
                    result = TSL235R_Pin.Read();
                    if (result == true && prev_result == false) // Rising
                        pulses++;
                    if (result == false)
                        prev_result = false;
                    if (result == true)
                        prev_result = true;          
                    readCount++;
                }
                getfrequency();			    
                Debug.Print("Frequency:  ");
                Debug.Print(frequency.ToString() + " pulses/second");		 
                getirradiance();			  
                Debug.Print("Irradiance: " + irradiance.ToString() + " uW/cm2");		
                readCount = 0; 
                pulses = 0;		
               Thread.Sleep(1000);        
            }
        }

        static ulong getfrequency () {
            frequency = pulses/(period/10000);    // Calculate the frequency (pulses/second)
            return (frequency);
        }

        static float getirradiance()
        {
            irradiance = frequency / area;	// Calculate Irradiance (uW/cm2)
            return (irradiance);
        } 
    }
}

Example results from debug console:

Frequency:  
1786 pulses/second
Irradiance: 194130.438 uW/cm2
Frequency:  
1790 pulses/second
Irradiance: 194565.219 uW/cm2
Frequency:  
1932 pulses/second
Irradiance: 210000 uW/cm2
Frequency:  
2375 pulses/second
Irradiance: 258152.172 uW/cm2
Frequency:  
2478 pulses/second
Irradiance: 269347.812 uW/cm2
Frequency:  
2640 pulses/second
Irradiance: 286956.5 uW/cm2
Frequency:  
2435 pulses/second
Irradiance: 264673.906 uW/cm2
Frequency:  
3001 pulses/second
Irradiance: 326195.656 uW/cm2
Frequency:  
2720 pulses/second
Irradiance: 295652.156 uW/cm2
Frequency:  
2540 pulses/second
Irradiance: 276086.938 uW/cm2
Frequency:  
2104 pulses/second
Irradiance: 228695.641 uW/cm2
Frequency:  
2742 pulses/second
Irradiance: 298043.469 uW/cm2

There are two problems here though:
  • I am not using an InterruptPort, because it did not work properly for me.
  • I do not know if the readings I am getting are really accurate irradiance measurements.

Regarding Point 1, if anyone knows how to modify this code to use an InterruptPort, please reply and let me know. I tried to add InterruptPort code, but it causes my Netduino to lock up and become non-responsive to my C# IDE.

Regarding Point 2, I put a black piece of felt cloth over the sensor, and the reading went way down. I then shined a bright light onto the sensor and the reading went way up, so I know I am getting semi-valuable readings. However, the readings fluctuate by about 20 to 50 values while I am at a particular light level, and I am uncertain why. The readings do go up and down as expected, but they also "jump" while they are within that range. How can I fix this? Perhaps there is nothing wrong. I wonder if shadows are causing the "jumps".



#18171 High resolution light measurement

Posted by monewwq1 on 19 September 2011 - 01:38 AM in General Discussion

Can an Atmel AT91SAM7X512 microcontroller support the functions of the Taos TSL235R?

I am still not convinced that I need to throw more components at this problem. Netduino has an ARM7 48MHz processor- why should we deny that there is plenty of speed right on this development board? If I were to remove the processor from the Netduino and program it directly, or remove the .Net firmware and run C/C++ on it, I am sure that this sensor would run fine. I've read in these forums that version 4.1.2 of the Netduino firmware is supposed to offer run-time native code interop. I've also read about someone's project called "Fluent", which runs code something like 20 to 30 times faster than the managed code. I've also read that you can run FreeRTOS on the Netduino platform. Can't you run a quadrocopter with FreeRTOS? Isn't that real-time?

Does version Netduino 4.1.2 have runtime native code interop? If not, when will it have this functionality? Where can I get this "Fluent" project? Where can I find resources on how to run my own C/C++ on this board?

I understand the opinion that more tools will help me solve this problem, but I would rather use what I have instead of having to then deal with connecting, learning, and powering these other pieces.



#18207 High resolution light measurement

Posted by monewwq1 on 19 September 2011 - 06:23 PM in General Discussion

P.S. A quick way to help determine if the Netduino's memory is getting filled with events is printing out the avaiable memory using Debug.Print(Debug.GC(true)); in your loop (not the event -- Debug.Print will slow down your event).



Here's the Debug.GC(true) output, and I ran this from the main loop, not the event:

27888
27000
27912
31056
32796
32796
32796
32796
32796
32796
32796
32796
32796
32796
32796
32796
32796
32796
32532
20472

After the 20472, I lose connection with the IDE. I am using a Netduino Plus by the way. If I turn off networking, would that help? I see that with networking turned off, I should have 60k of RAM. If so, how do I turn off networking? If that won't help, what else can I do?



#18204 High resolution light measurement

Posted by monewwq1 on 19 September 2011 - 05:48 PM in General Discussion

Chris, et. al, Here is the simple version of my code: [



#18211 High resolution light measurement

Posted by monewwq1 on 19 September 2011 - 07:11 PM in General Discussion

The c




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.