- Netduino Forums
- → Nobby's Content
Nobby's Content
There have been 66 items by Nobby (Search limited from 18-May 23)
#32581 Passing Servo's to another thread.
Posted by Nobby on 24 July 2012 - 12:03 AM in Netduino Plus 2 (and Netduino Plus 1)
#32011 Timing Accuracy Issues
Posted by Nobby on 14 July 2012 - 08:44 AM in General Discussion
#33833 .NET Micro Framework 4.3 Roadmap
Posted by Nobby on 17 August 2012 - 03:33 PM in General Discussion
#31948 Any plans for have ParameterizedThreadStart available in the MF?
Posted by Nobby on 13 July 2012 - 03:41 AM in General Discussion
Good day everyone.
Any plans to have ParameterizedThreadStart available in the MF?
Thanks
You can use lambda expressions in conjunction with the standard ThreadStart class. It allows you to have type-safe targets as well.
class MyClass { Thread myThread = null; public MyClass() { this.myThread = new Thread(() => MyClass.threadFunc(this)); this.myThread.Start(); } private static void threadFunc(MyClass myClassObject) { //do stuff here } }
Target delegate doesn't have to be static either
#32654 Controlling Netduino from PC
Posted by Nobby on 25 July 2012 - 10:48 AM in General Discussion
#32088 Netduino Plus Socket Server Help
Posted by Nobby on 17 July 2012 - 06:16 AM in Netduino Plus 2 (and Netduino Plus 1)
#38173 Out of Memory - Debug.GC(true) says I'm not?!
Posted by Nobby on 29 October 2012 - 11:21 AM in Netduino Plus 2 (and Netduino Plus 1)
#32681 Analog Pins for drive LEDs
Posted by Nobby on 26 July 2012 - 04:04 AM in Netduino Plus 2 (and Netduino Plus 1)
Hi Guys,
As I have exhausted all the Digital Pins for all my pulse counter and communication, now only left with the Analog pins untouched. May I know is there any way I can use the Analog pins for driving a LED (for machine status) purpose? also can it be configure to use to detect button press input?
Thanks in advance.
I have recently used a few of the analog pins for similar reasons as yours. I can confirm you can use them as TTL output pins and almost certainly as TTL inputs.
Just ensure the maximum forward current through each LED doesn't exceed 25mA(maximum pin current).
#37413 PCF8574N inverted outputs?
Posted by Nobby on 19 October 2012 - 06:55 AM in General Discussion
#39788 HTTPS support on N+2?
Posted by Nobby on 21 November 2012 - 06:41 AM in Netduino Plus 2 (and Netduino Plus 1)
The basic run-down is that your device can be a client or a server as far as SSL is concerned so technically you can pull off HTTPs. If you're using basic HTTPS then you only need to store one or two certificates. One to certify your netduino as a secure server and possibly another certificate/cert chain that points to a publicly trusted certification authority(CA). If you don't care about the certificate being trusted and you just want secure communications it's pretty simple.
- Generate and store the SSL certificate for your netduino into RAM at run-time via the CertificateStore class. Put the cert on an SD card and read it off each time you boot up
- Use the SSLStream class for reading and writing data instead of a NetworkStream with the client socket.
- Server authentication via the netduino certificate is mandatory but client authentication with a separate certificate is optional. Use the SSLStream.AuthenticateAsClient and AuthenticateAsServer functions.
- Once authenticated, you use the streams like normal HTTP
#32703 Release COM2 (CTS, RTS)
Posted by Nobby on 26 July 2012 - 12:58 PM in Netduino Plus 2 (and Netduino Plus 1)
Hi Nobby,
wonderful... That clears my doubts.
Just for knowledge, how can I configure PIND7 as RTS, do you have the code for it?
Thanks in advance.
Sorry I've never needed CTS or RTS in any application. I'm fairly sure its only modern use is for UART communications which have multiple devices on the shared three-wire interface and have an address they respond to. There are still some ancient RS232 devices out there which require CTS & RTS for end-to-end comms.
From what I have seen with the .Net framework though, you need to specify hardware flow control on the SerialPort object. It supports XOn/XOff and RequestToSend or a hybrid. You do this through the SerialPort.Handshake property at runtime. I believe once you configure your serial port this way, it will configure the RTS and CTS pins to function with the serial port.
#32673 Release COM2 (CTS, RTS)
Posted by Nobby on 26 July 2012 - 12:13 AM in Netduino Plus 2 (and Netduino Plus 1)
Hi Nobby,
Below is my statement.
m_objCommMgr = New cCommManager("COM2", 9600, Ports.Parity.None, 8, Ports.StopBits.One)
so far, I have not connected RTS and CTS since i am only using 3 wire interface. Since on the board layout, for COM2 it comes with RTS and CTS (derived from GPIO pins), I just wonder if we can disable these RTS and CTS when using COM2. Thus giving my project the much needed GPIO to measure the pulse input.
Care to share how do you initialise your COM2 without RTS & CTS?
Thanks in advance.
The general rule-of-thumb with microcontrollers is that pin assignments aren't always restricted to their architectural labelling. For example, a pin maybe labelled as PWM(Pulse Width Modulator) which would normally tie-in with a hardware clock and hardware interrupts. By default, the pin doesn't function as a PWM unless you actually configure it to be.
Much the same with the CTS and RTS pins, you can configure them as OutputPorts or InterruptPorts. If you try to use them for two purposes, you'll get a runtime exception when trying to initialise the pin for a second use. Example of using the RTS pin as a GPIO pin
SerialPort comPort = (SerialPorts.COM2, 9600, Parity.None, 8, StopBits.One); //Initialise COM2 OutputPort oPort = new OutputPort(Pins.GPIO_PIN_D7, false); //initialise the RTS pin as an output port with logic low as initial value;
#32649 Release COM2 (CTS, RTS)
Posted by Nobby on 25 July 2012 - 07:54 AM in Netduino Plus 2 (and Netduino Plus 1)
#38804 Netduino Stops when switching relay through transistor
Posted by Nobby on 09 November 2012 - 01:03 AM in General Discussion
Hi!
Thanks for help! Finally I found the problem with Nobby's tip. I changed the base resistance from 1k to 6k and it works now in every variations. However I don't understant totally because I think that the relay's inner resistance limits the current to 70mA. So I don't know why is it a problem if the transistor's gain is too high. By the way I use a BC327-40. As I checked the datasheets its gain is above 250.
Now it works, so thank you!
Awesome work!!
250 gain is pretty high for low power circuits and 6k would be a lot better than 47k in your case. When you design in the future, transistor parameters are important. High gain will usually mean a higher forward-bias base current and larger voltage drop from base to emitter which means you'll choose a smaller base resistance etc.
As for the relay, devices like that don't have the capability to regulate/limit current unless they switch off from over-current(built in protection) so it's important to do power calculations for your transistor circuits. The current in simple circuits like this are always determined by the voltage level of your power source (i.e. 5V) and the total resistance/impedance of the circuit path the current is travelling along. If you follow those fundamental rules in design then your systems will function predictably and safely.
#38532 Netduino Stops when switching relay through transistor
Posted by Nobby on 05 November 2012 - 06:09 AM in General Discussion
#32008 RFID Reader
Posted by Nobby on 14 July 2012 - 05:50 AM in General Discussion
Hi,
Just wondering if anyone can recommend an RFID reader that is compatible with the Netduino. I need one that can read from at least 30cm.
Can anyone help?
Thanks
I've used the Texas Instruments RFID readers in the past with AVR based projects. Unfortunately, there's no way you're going to get 30cm read range out of most units. Purely because the most available and popular units are High Frequency RFIDs(used in keycard access etc).
All the long range options are the low frequency devices(cattle tags, anti-theft etc). I can't remember off-hand what those are but the high freq devices operate at 6MHz and the low frequency devices are in the hundreds of kHz.
Either way you go, all communications are TTL/RS232 with a possible USB option.
#32163 Multiple questions from someone thinking about picking up a netduino
Posted by Nobby on 18 July 2012 - 02:21 AM in General Discussion
#38211 Wireless contact switch
Posted by Nobby on 30 October 2012 - 12:31 AM in General Discussion
#32184 StreamReader detect end of file
Posted by Nobby on 18 July 2012 - 11:07 AM in Netduino Plus 2 (and Netduino Plus 1)
string fileLine = ""; while((line=sr.ReadLine())!=null) { Debug.Print(fileLine); } sr.Close();
#32491 Multiple questions from someone thinking about picking up a netduino
Posted by Nobby on 23 July 2012 - 01:50 AM in General Discussion
#32851 Ping works for 2min that quits working (4.2 RC5)
Posted by Nobby on 28 July 2012 - 01:51 PM in Netduino Plus 2 (and Netduino Plus 1)
#32970 Ping works for 2min that quits working (4.2 RC5)
Posted by Nobby on 01 August 2012 - 07:24 AM in Netduino Plus 2 (and Netduino Plus 1)
I hadn't up until you suggested it. I thought I could power it with simply the USB connection. Now that I have added the external power source, the board seems to behaving as expected.
Is there a 'theory of operation' or any documentation around how the systems works together? I seems like the blue led on the board corresponds to the time when the bootloader is available vs when the CLR is running.
Thank you for the suggestion!
According to the Netduino schematic, the USB socket is essentially electrically and logically isolated from the button and LED. My best guess is that you possibly have the Netduino plugged into a standard USB port and there is some sort of power management policy under windows or possibly your BIOS that is cutting power to the Netduino for being idle or some other reason.
Although, I've never come across this problem before except with some models of USB powered hard disc drives. I also connect my Netduino to my PC via a self-powered USB hub and I also have no power management enabled under windows except for turning my screen off after 10 minutes(Performance power profile with hibernation/sleep disabled).
#32651 start multi-projetc's on netduino
Posted by Nobby on 25 July 2012 - 08:04 AM in Netduino Plus 2 (and Netduino Plus 1)
- Add a new project to solution
- Choose "Class Library" instead of "Netduino Plus Application" under Visual C# -> Micro Framework. This what you mean by DLL?
- Write the code in your class library
- Go to your Netduino Plus application project, choose to add a reference
- In the projects tab, choose your new class library as the reference
- You can now use your class library in the Netduino Plus application!!
#35267 Interfacing netduino with an alarm clock
Posted by Nobby on 15 September 2012 - 08:22 AM in General Discussion
#32642 Netduino Plus Network Interface Controller
Posted by Nobby on 25 July 2012 - 02:23 AM in Netduino Plus 2 (and Netduino Plus 1)
---Netduino Software---
A threaded socket listener accepting TCP connection requests. It's a non-blocking approach utilising Socket.Poll to check for pending connection requests before calling Socket.Accept. Detection of NIC being up or down is monitored using the WinSock socket exception code 10050. Once the network status is up, I tried two methods that involve either retaining the existing listening socket object or recreating the listening socket.
- Netduino is using static IP and gateway (192.168.1.95, 255.255.255.0, 192.168.1.1)
- Experiment involved starting a debugger on the netduino with the network cable plugged in or unplugged
- A separate thread does a Debug.Print of the current IP address and default gateway of the Netduino every three seconds
---PC Software---
A simple app which allows you to enter an ip address and port number. A "Connect" button which attempts to create a TCP connection to the remote host at the defined address and port. A "Ping" button which broadcasts an IMCP echo request to the defined address. All connection and ping results displayed in a listBox.
---Results---
Starting the debugger with the network cable initially plugged in produces positive results. The device is pingable and TCP connections can be made. Unplugging the device from the network results in WinSock 10050 exceptions on Socket.Poll as expected. Plugging the Netduino back into the network and recreating the listener socket resumes desirable behaviour. The device is pingable and TCP connections can be made.
Starting the debugger with the network cable initially unplugged is where it all goes wrong. The frequently displayed IP address of the Netduino is correct. After any length of time, the netduino is plugged in, all related link/activity etc lights come on. WinSock 10050 errors cease to occur when calling Socket.Poll as expected. However, the device is unpingable and TCP connections cannot be made to 192.168.1.95. No amount of time changes the conditions of connectivity without restarting the device.
Is anybody familiar with the inner workings of the .Net Microframework runtime startup in the Netduino and how NICs are affected by it? Fortunately, the only vulnerability of the product I'm developing is that it must be plugged in and active at both ends of the network cable before the product is powered up. I would like that to not be a requirement.
This thread http://forums.netdui...?showtopic=3420 alerted me that sometimes the Netduino needs to be rebooted. Is there any other functionality that isn't as brutal as a reboot?
I'm now using Socket.Poll to detect the initial NIC connection state and rebooting the device upon the NIC status changing to up, if it was originally down. I can't exactly do this if the product is in the middle of being used.
- Netduino Forums
- → Nobby's Content
- Privacy Policy