nakchak - Viewing Profile: Likes - 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.

nakchak

Member Since 27 Feb 2012
Offline Last Active Dec 12 2013 11:48 AM
-----

#52032 Windows 8.1 on Surface Pro. Debugging issue.

Posted by nakchak on 07 August 2013 - 08:22 PM

Very odd if MFDeploy works, have you tried changing the deployment method from USB to serial in your VS project settings, save the changes then change back to usb and save your project settings again, then try deploying.

 

Nak.

 

Ahh just saw you fixed it :)

 

Glad all is working for you now.




#34910 How to read from a pin that gets a PWM signal

Posted by nakchak on 09 September 2012 - 01:15 PM

afaik you can't directly access the timers as they are being used by the netmf runtime. Paul's suggestion of sampling the time would probably work, however the accuracy may be questionable, could you use the adc to derrive the average voltage I.e. 100% duty would be 3.3v etc. Nak.


#34905 Netduino plus with nitgen fingerprint scanner(fim5360)

Posted by nakchak on 09 September 2012 - 11:56 AM

I think the lvcmos is a different part from what the sheet says that said I would be surprised if it outputted 12v as it said it had a 5v supply... Personally I would use a hex inverter to buffer the rx and TX and see what happens, if needed I would use a max232 and opto isolator to be on the safe side... Nak.


#34174 More GoBus news: through-hole GoPort IDC Headers

Posted by nakchak on 24 August 2012 - 07:30 PM

Any chance of getting the Eagle part for the two headers published as a library? Either that or a pointer to the part name and library would help - I've not been able to find the part in Eagle's libraries.

Regards,
Mark


Im currently building a netduino library for design spark
Currently contains:
  • Shield headers (at correct spacing)
  • STM32F4
  • STM32F0
  • STM8S (will add dip varient as well)
  • Go sockets
  • Handful of common components
Its not eagle i know, but i have used pulsonix (which shares the same core) in the past, and its free with no layer or pad limit.
Any way i was considering porting the lib to Eagle and Kicad as well, if there is enough interest i will see what i can do.

Nak.


#34072 Seven Segment Display Module

Posted by nakchak on 22 August 2012 - 11:30 PM

Hi Matt In the past i have always used an led to indicate overflow, but i guess thats not an option with the current display design, that said could you illuminate one of the decimal points to indicate overflow? Nak.


#32336 Problem Detect the presence of SD in Netduino Plus

Posted by nakchak on 20 July 2012 - 08:07 AM

Hi

Try adding a reference to Microsoft.SPOT.IO

Also you could use the events in the RemovableMedia object to detect insert and eject

i.e.
public static void Main(){
 RemovableMedia.Insert += new InsertEventHandler(RemovableMedia_Insert);
 RemovableMedia.Eject += new EjectEventHandler(RemovableMedia_Eject);
 Thread.Sleep(Timeout.Infinite);
}
void RemovableMedia_Eject(object sender, MediaEventArgs e) {
 Debug.Print("Ejected");
}

void RemovableMedia_Insert(object sender, MediaEventArgs e) {
 Debug.Print("Inserted");
}

Nak.


#32204 SIM900 Library for Netduino

Posted by nakchak on 18 July 2012 - 03:28 PM

Hi s0n1k I Assume you mean one of these? http://imall.iteadst...m120417009.html If so then there must be an existing .net driver as the FEZ Panda II is listed as compatible, and if it builds for one netmf device it should build for all. By the looks of that particular board you should be able to configure the serial interface to match the pins on the ND+ using the "UART multiplexer" jumpers you would want to either use D0 and D1 or D2 and D3, after that as its controlled by AT codes, just send the relevant strings over the ND's serial port and your in business. Nak.


#32178 Netduino Go with MMA7361 Accelerometer

Posted by nakchak on 18 July 2012 - 09:23 AM

Hi Hoquet Looks like you have the hard parts sorted :) I would suggest some normalised sampling, i.e. report the average of 5 readings, or take delta's between each reading, the delta should be able to give some indications of magnitude and direction of movement i.e. -ve number indicates movement in one direction, +ve movement in the other and 0 = no movement. If you round your results to fewer decimal places you will see that all the numbers remain static i.e. your X measurement is 0.49 for each of the posted responses which would indicate that it is at rest on a flat surface. Now as for translating the readings into degree's i would imagine that their is details in the datasheet for the accelerometer for translation into standard units... Nak.


#30527 Socket error #10055 (WSAENOBUFS)

Posted by nakchak on 11 June 2012 - 01:57 PM

Maybe (I did not test this) it helps to check first if the socket it ready to send data:

if (Connection.Poll(-1, SelectMode.SelectWrite)) {
   Connection.Send( yourData );
}


Doesn't seem to make any difference for me I'm afraid :(

However the plot thickens...

I do not need the thread.sleep at all if and only if the message i am sending is > 21 bytes in length.... Quite why such an arbitrary length works is any ones guess, which leads to workaround #4

If the line is less than 21chars long pad with spaces to make it 21 chars long

Here is the code i got going, as you can see i simply added spaces to the end of the string and tested the ANSI codes work with a padded string by setting the background to red and it seems to work ok, admittedly I have done nothing about the formatting but that was never the issue here

using System.Net;
using System.Net.Sockets;
using Microsoft.SPOT;
using Microsoft.SPOT.Net.NetworkInformation;

namespace NetworkTest {
	public class Program {
    	public static void Main() {
        	// Prints out all IP addresses
        	NetworkInterface[] Ips = NetworkInterface.GetAllNetworkInterfaces();
        	for(int i = 0; i < Ips.Length; ++i)
            	Debug.Print(Ips[i].IPAddress.ToString());

        	// Listens on the port 23
        	Socket Listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
        	Listener.Bind(new IPEndPoint(IPAddress.Any, 23));
        	Listener.Listen(1);
        	// Accepts the first connection
        	Socket Connection = Listener.Accept();
        	// Stops further listening
        	Listener.Close();

        	// ANSI modes: Normal, Forecolor: White, Backcolor: Red ( as String(): "\x1b[00;37;41m" )
        	byte[] AnsiData = { 27, 91, 48, 48, 59, 51, 55, 59, 52, 49, 109, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 };
        	// Text ( as String(): "Hello World!\r\n" )
        	byte[] TextData = { 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 32, 32, 32, 32, 32, 32, 32, 13, 10 };

        	while(true) {
            	Connection.Send(AnsiData);
            	Connection.Send(TextData);
        	}
    	}
	}
}

Forgot to copy code to notepad first so lost all formatting and got a load of RTF color coding instead :(

Nak.


#30519 Socket error #10055 (WSAENOBUFS)

Posted by nakchak on 11 June 2012 - 12:08 PM

Hi Stefan

I have managed to repro the issue on a netduino here.
Having played with the demo code it does appear that the Send method is returning before the ND+ has actually finished transmitting to the endpoint.
Adding a Thread.Sleep(100) between each send seemed to fix the issue for me, so i hypothesise that some sort of delay is required to allow the ND+ to shift the data out. Given that this is a telnet server i wouldn't expect this to be much of a problem due to the relatively slow response times between messages...

That said i think a bit of a change in architecture would make a more useful as you could add reading to the network comms thread as well, then just lock and sync a pair of queue's between the main and network comms thread.

using System;
using System.Collections;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Net.NetworkInformation;

namespace NetworkTest {
	public class Program {

    	#region Private Member Variables
    	
    	private static readonly object QueueSyncObject = new object();
    	private static readonly Queue ResponseQueue = new Queue();
    	private static Socket _connection;
    	private static Thread NetworkCommsThread = new Thread(NetworkCommsProcessor);
    	private static byte[] AnsiData = { 27, 91, 48, 48, 59, 51, 55, 59, 52, 48, 109 };
    	private static byte[] TextData = { 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 13, 10 };
    	#endregion

    	#region Application Methods

    	public static void Main() {
        	// Prints out all IP addresses
        	NetworkInterface[] Ips = NetworkInterface.GetAllNetworkInterfaces();
        	for(int i = 0; i < Ips.Length; ++i) {
            	Debug.Print(Ips[i].IPAddress);
        	}
        	// Listens on the port 23
        	Socket Listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
        	Listener.Bind(new IPEndPoint(IPAddress.Any, 23));
        	Listener.Listen(1);

        	// Accepts the first connection
        	_connection = Listener.Accept();
        	NetworkCommsThread.Start();
        	// Stops further listening
        	Listener.Close();
        	var toggle = true;
        	while(true){
            	lock(QueueSyncObject){
                	ResponseQueue.Enqueue((toggle) ? AnsiData : TextData);
            	}
            	toggle = !toggle;
        	}
    	}

    	private static void NetworkCommsProcessor() {
        	while(true) {
            	lock(QueueSyncObject) {
                	if(ResponseQueue.Count <= 0) {//No messages to send, so skip the loop
                    	continue;
                	}
                	var bytesToSend = (byte[])ResponseQueue.Dequeue();
                	try {
                    	_connection.Send(bytesToSend);
                	}
                	catch(SocketException ex) {
                    	switch(ex.ErrorCode) {
                        	case 10054://Safe to ignore client has just disconnected
                            	//Add additional safe to ignore expected exceptions
                            	break;
                        	default:
                            	throw;
                    	}
                	}
                	catch(Exception ex) {
                    	//Something really weird has happened here... :-/
                    	throw;
                	}
                	//Although there still is a thread sleep its not in the main thread so 
                	//shouldnt stop additional work happening :-)
                	Thread.Sleep(100);
            	}
        	}
    	}
    	#endregion

	}
}



#30425 Public repository for Firmware

Posted by nakchak on 08 June 2012 - 03:41 PM

Hi All Is there a public repository for ND firmwares? netduino.codeplex.com seems to be pretty much dead in terms of commits I would really like to be able checkout firmwares in the same way as I can with netmf, especially with the possibility of GCC compilable firmwares for the GO I think the amount of interest in the firmware source will increase. Also it would be really neat to be able to fork customised firmwares i.e. GO firmware with OpenSSL enabled or similar. It is the one aspect of netduino that i find to be quite blackbox, i.e. i would love to move over to using 4.2 due to the GC and memory management fixes more than anything else, but I cant as my immediate project relies on a firmware modification for acceptable performance. However as it stands i can only use the latest production firmware as that's the only source I can find released. Also wouldn't an issue tracker be a more suitable place to report bugs and feature requests than this forum? Sorry if it sounds like a bit of a winge i'm just banging my against another system.outofmemory exception i know disappears with 4.2 (tested codebase with 4.2 all works flawlessly apart from the low level SPI hack I implemented in the firmware which is really needed to achieve acceptable performance) Nak.


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.