internal void Close(int socketIndex) { UInt16 socketBaseAddress = (UInt16)(0x400 + (socketIndex * 0x100)); // issue command to close the socket // socket n command register (Sn_CR) WriteRegister((UInt16)(socketBaseAddress + 0x0001), 0x10); while (ReadRegister((UInt16)(socketBaseAddress + 0x0001)) != 0) ; // wait to process the command lock (m_SocketsLock) { m_Sockets[socketIndex] = null; } }
- Netduino Forums
- → klotz's Content
klotz's Content
There have been 60 items by klotz (Search limited from 29-April 23)
#3383 Experimental Drivers for Wiznet-based Ethernet Shields
Posted by klotz on 02 October 2010 - 04:03 AM in Beta Firmware and Drivers
#3345 Experimental Drivers for Wiznet-based Ethernet Shields
Posted by klotz on 01 October 2010 - 10:51 AM in Beta Firmware and Drivers
klotz--any interest in helping get uIP up and running on the Netduino Plus? I might be able to get you one of the lab units. We only have a few, but if you were serious about helping... pascal06 is leading the project.
Chris
Sure. I would be willing. I did want to get around to a Neduino plus when they start shipping again and if this is a way to make sure the network is up and running I'll do my part.
Just need some pointers to the code base and away we go
#3328 Experimental Drivers for Wiznet-based Ethernet Shields
Posted by klotz on 01 October 2010 - 04:38 AM in Beta Firmware and Drivers
Chris add me to your list of volunteers. I have worked on a project were we implemented uIP on an HC12 using the enc... chip so I have some experience with networking in sockets. (though I will admit to being a newbie at C# I have extensive experience in C++). I just spent the last 2 hours getting bind and listen implemented and ran into a glitch on accept so I do want to help.Ooh, we always love volunteers
Let's keep the Wiznet drives in C# for now, and then translate them to C++ later. They'll be faster as native code, but there are fewer "gotchas" and somewhat more portability if we create them in C#.
If you'd like a copy of the Wiznet communication spec, just PM me your e-mail address and I'll send over a copy. We could create a CodePlex project pretty easily.
All that said, finishing the Wiznet drivers will probably take about 5-10 more days of work. The easiest/fastest solution is probably to have us focus on fleshing out the implementation next week...and to have you and hari test and help resolve any bugs... Interested?
Chris
#3285 Wait...what's this?
Posted by klotz on 30 September 2010 - 03:13 PM in Netduino Plus 2 (and Netduino Plus 1)
#3239 Power Questions - i.e. Voltage
Posted by klotz on 30 September 2010 - 02:19 AM in General Discussion
I have run the Netduino, and Parallax boe bot chassis on 4 AA batterys. ( 4 x 1.5 = 6Vdc)You can step the voltage all you want, but it will come as a cost of current. 6V probably would power the Netduino, not 100% on that though, I haven't looked at the schematics yet.
I have been using the same batteries for over a week and had several test runs of the chassis. So I would say, 6VDC will just make it.
Remember you lose about 0.6-1.0 volts to a regulator and the Netduino wants a solid 3.3 Vdc for main power and 5Vdc +- 10% so your can get by.
#3216 netduino harness
Posted by klotz on 29 September 2010 - 10:21 PM in Netduino 2 (and Netduino 1)
#3215 How to use the SD card and StreamWriter
Posted by klotz on 29 September 2010 - 10:10 PM in Netduino Plus 2 (and Netduino Plus 1)
If we get SDHC support the buffers may need to be at least 1024 since that is the sector size of the HC device.On the memory issues:
1. We haven't found any memory leaks...this is good.
2. The FAT file system was creating up to about 8 2KB caches when data was read. We're tuning this down quite a bit. The memory was reclaimed when the SD card was unmounted--but a total cache size of 2KB is probably more appropriate for this type of device.
3. The StreamReader uses 4KB buffers by default; we're tuning these down to 512 bytes. ReadToEnd() and ReadLine() read data in chunks of 4KB -- and had to create new buffers of at least 8KB whenever they needed to read more data.
We'll post a beta update for the Netduino Plus firmware (v4.1.0.4 beta 1) with these changes by the end of the week.
Chris
#3172 Experimental Drivers for Wiznet-based Ethernet Shields
Posted by klotz on 29 September 2010 - 04:49 AM in Beta Firmware and Drivers
Some routers don't like the one from the test code--which is interesting. We'll start using a "reserved test MAC address"--probably the one I just posted--in test code going forward.
Chris
I did a quick check of the standard, maybe the problem is that the first byte has the least significant bit set which means broadcast. Routers generally will not propagate a broadcast by default, for many good reasons. I don't know why I didn't notice it before, must be because it is getting late.
Since my network here at home is three tiered, my first jump would have been blocked. I was just luck that my pc and the 'duino were on the same segment(switch).
#3171 Experimental Drivers for Wiznet-based Ethernet Shields
Posted by klotz on 29 September 2010 - 04:42 AM in Beta Firmware and Drivers
That is a good suggestion. However, you may want to be careful about using an address that will be on the same network segment as the shield. Some ethernet devices count on all the addresses on the same segment being unique.I don't understand it, but it ALSO works when I use the physical address of my PC!? So you can try that.
Open a command prompt on your PC, type ipconfig /all
You should see Physical Address listed for each ethernet card on your PC, it should look like XX-XX-XX-XX-XX-XX, pick one, and convert it to 0xXX, 0xXX, etc.
Also confusing is that my NKC Ethernet Shield does not seem to care what I put as Physical Address. It works even with the physical address of the Arduino Ethernet shield.
Another good source of unique mac addresses would be defunct or dead network devices you may have laying around. MAC addresses are generally printed on the serial number label and if they are truly defunct/dead you can be certain that the address is unique.
#3168 Experimental Drivers for Wiznet-based Ethernet Shields
Posted by klotz on 29 September 2010 - 04:23 AM in Beta Firmware and Drivers
Thanks alot Chris, That was the ticket! It works now. When I get to work in the morning I will get a MAC address from my allocation.klotz,
Try the following MAC address; it's an official Secret Labs MAC address (and one we use for testing).
5C-86-4A-00-00-09
Chris
Just out of curiosity, any idea why the default one in the test code would not work?
#3163 Experimental Drivers for Wiznet-based Ethernet Shields
Posted by klotz on 29 September 2010 - 04:00 AM in Beta Firmware and Drivers
I fixed that error by updating PhysicalAddress initialization in the sample program with the MAC address printed on sticker on the back of my Ethernet Shield.
Replace the bytes in red with your actual MAC address.
networkInterface.PhysicalAddress = new byte[] { 0x01, 0x23, 0x45, 0x67, 0x89, 0x01 };
Good luck!
I have an Arduino Ethernet shield and there is no MAC address printed on it anywhere. Does the Wiz5100 have one "programmed" into it? If so how do I get it?
#3160 Experimental Drivers for Wiznet-based Ethernet Shields
Posted by klotz on 29 September 2010 - 03:47 AM in Beta Firmware and Drivers
I had read that DNS was not working, but I thought that was the purpose of the proxy in the following segment from the Wiznet test posted in this forum.Looking at your error code again... DNS is not supported yet. We put that in the release notes next to the download link, but maybe we need to make that more obvious. Can you try connecting via direct IP and see if that works?
Chris
string url = "http://www.secretlabs.com/default.htm"; // NOTE: since this experimental release does not support DNS yet, we must use the IP address of the web server as the proxy address. string proxy = "174.143.45.105"; // ip address of secretlabs.com // If the device must go through a proxy server, then set proxy to the // fqdn or ip of the proxy server. try { String html = GetWebPage(proxy, url, 80); Debug.Print(html); } catch (SocketException se)
BTW I don't require a proxy server to access the net.
#3158 Experimental Drivers for Wiznet-based Ethernet Shields
Posted by klotz on 29 September 2010 - 03:19 AM in Beta Firmware and Drivers
#3149 Experimental Drivers for Wiznet-based Ethernet Shields
Posted by klotz on 29 September 2010 - 01:22 AM in Beta Firmware and Drivers
#2783 Stay close to your computer (or come to MakerFaire)...
Posted by klotz on 24 September 2010 - 05:58 PM in General Discussion
I noticed the spec's http://www.netduino....oplus/specs.htm say the microSD holds up to 2Gb. Is this because the Plus uses SPI to talk to the SD card or is it a software limit?Yes, and it's bedtime for sure
Chris
#2422 Controlling a LED Intensity
Posted by klotz on 18 September 2010 - 01:03 PM in General Discussion
#2411 Buzz a piezo speaker?
Posted by klotz on 18 September 2010 - 04:02 AM in Netduino 2 (and Netduino 1)
Try
var period = (uint)(1000000 / frequency); pwm.SetPulse(period, period/2);
I used the same buzzer and I just checked my code and the period is in microseconds like I remembered.
#2408 Getting off to a good start with Netduino
Posted by klotz on 17 September 2010 - 10:23 PM in General Discussion
EDITTED---
I purchased an AdaFruit Protoshield and that's all build and piggybacking my Netduino. What's not clear to me is how the various buttons on the shield relate to the Netduino. For example, I have two LEDs on the protoshield and two buttons. How are these addressable through code (given that the Netduino only has one of each)?
EDITTED AGAIN--
What I'd like to do as a next step is control a 5v motor, attached to the shield, and have its speed adjusted with a photoresister. Pretty basic, eh? :-) I'm not clear on how/where I'd hook up the motor to the shield (which pins) and also where the photresistor fits into the picture (on the shield in series with the motor, presumably, but what voltages should I use)?
And again
Thanks.
Mark
I hope you don't mind I didn't quote your entire post since I am going to start by answering the easy parts . But here goes:
One of the buttons (the one labeled RESET) is tied to the reset on your board and that is all it can do for you.
The other button and the two LEDs are not assigned to any function instead they are tied to ground on one end and the other is to a pad you can route to any of the DIO ports. The LEDS have a current limiting resister on them so they are safe. You just have to make sure you define the DIOs used with the LEDs as outputports and the button as an input port with a pullup. You can view the schematic here: http://www.ladyada.n...v5schematic.png
#2330 Analog Input problem
Posted by klotz on 15 September 2010 - 10:55 AM in Netduino 2 (and Netduino 1)
My guess: CadSoft Eagle (?)
Yep, I use Cadsoft Eagle. But don't ask me for help with it. I am just returning to doing hardware after 40 years and am trying to catch up.I just kindof hack away with Eagle until something works.
#2321 Analog Input problem
Posted by klotz on 15 September 2010 - 12:49 AM in Netduino 2 (and Netduino 1)
The fun is just beginingThank you for explaining now i understand. Time to play with my netduino!
The next thing you want to do is check out the projects page.
#2318 Analog Input problem
Posted by klotz on 14 September 2010 - 11:41 PM in Netduino 2 (and Netduino 1)
First you need to know what the resistance of the photo resister is. Mine was 25k full dark.I'm confused would it look like
AREF+3.3v->resistor(what resistance?)->ground?->photo resistor->A0?
Second you need to decide if you want it to pull-up or pull-down. I used mine in a pull-up.
Then choose a resitance to give you some kind of reasonable current limit, I chose 10K since I just wanted to play.
So using the attached schematic, I put the photoresister in a R1, a 10k in R2, you can try it either way and pick the one you like.
#2316 Analog Input problem
Posted by klotz on 14 September 2010 - 11:19 PM in Netduino 2 (and Netduino 1)
I just got my netduino and I'm starting to try to get analog input and I always get 0 when I read my pin(A0). Do you see anything I did wrong?
My setup looks like this
3.3->AREF
A0->Photo Resistor->GND
public class Program { public static void Main() { // write your code here InterruptPort tester = new InterruptPort(Pins.GPIO_PIN_A0, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth); tester.Dispose(); AnalogInput apin0 = new AnalogInput(Pins.GPIO_PIN_A0); apin0.SetRange(0, 100); int test = 0; while (true) { Thread.Sleep(250); test = apin0.Read(); Debug.Print("Test: " + test); } } }
You would need another resister to 3.3Vdc to develop a voltage divider. There is no pull-up in the An-in.
#2145 Compatible Shields and Accessories
Posted by klotz on 12 September 2010 - 12:03 AM in Netduino 2 (and Netduino 1)
#2144 Compatible Shields and Accessories
Posted by klotz on 11 September 2010 - 11:52 PM in Netduino 2 (and Netduino 1)
#1080 Netduino servo class
Posted by klotz on 22 August 2010 - 06:52 PM in Netduino 2 (and Netduino 1)
So it was a problem with the way I created the project, not the source at all. Once I went to References under the solution explorer and added the Microsoft.SPOT.Hardware, it build just fine.Did you include the Microsoft.SPOT.Hardware reference? You probably also need SecretLabs.NETMF.Hardware and SecretLabs.NETMF.Hardware.Netduino
Like I said I am still a nubie when it comes to C#.
BTW: That and SecretLabs.NETMF.Hardware. Oops.
Thanks.
- Netduino Forums
- → klotz's Content
- Privacy Policy