- Netduino Forums
- → Nobby's Content
Nobby's Content
There have been 66 items by Nobby (Search limited from 29-June 23)
#37294 Yet another diagnostic question
Posted by
Nobby
on 16 October 2012 - 11:43 PM
in
General Discussion
#30581 Netduino Reset Button Issues
Posted by
Nobby
on 12 June 2012 - 08:05 AM
in
Netduino Plus 2 (and Netduino Plus 1)
#38170 Low Latency Wireless Comms
Posted by
Nobby
on 29 October 2012 - 10:39 AM
in
General Discussion
#32850 Take a dirty picture for me
Posted by
Nobby
on 28 July 2012 - 01:48 PM
in
Netduino Plus 2 (and Netduino Plus 1)
sorry, the topic is not going to be that interesting.
![]()
I've got my NP hooked up to a serial camera and i want to take a pic and then push it on a webserver.
By the looks of it im getting a outofmemory exception. Is there any efficient way of do this with out using lots of memory?
Is the camera data compressed into JPEG or is it full-frame RGB/YUV pixel data? Either way, image resolution of most cameras these days will exceed the runtime RAM of the Netduino. To test the full functionality of your project(i.e. take pic, get data from camera, post to webserver), try and set the camera to its lowest resolution if possible.
If you don't have those kind of configuration options for your camera, you'll have to go the whole-hog from the beggining. Adopt a block-data processing model. Take the picture and read small amounts of data from the camera at a time. You'll have to send or store(SD card) that data then leave it for the GC to pick up or force the GC to free the memory. Read the next block of data, rinse and repeat.
Are you using a POST method to a web URL? If so, you can define the Content-Length HTTP header property before you stream the data to the webserver(only if you know the datasize of the image before-hand). This will allow you to block process the data, as long as you don't exceed the webserver's timeout. If you can't determine the size of the pic data before you read it from the camera, stream it to a file on an SD card in the Netduino and then read the file-size.
Good luck
#34082 InterruptPort, NativeEventHandler & data1
Posted by
Nobby
on 23 August 2012 - 03:25 AM
in
General Discussion
#34083 InterruptPort, NativeEventHandler & data1
Posted by
Nobby
on 23 August 2012 - 03:39 AM
in
General Discussion
#32675 Does Netduino Software software getting cleared over time?
Posted by
Nobby
on 26 July 2012 - 12:21 AM
in
General Discussion
#36993 Runtime Memory Usage
Posted by
Nobby
on 10 October 2012 - 11:45 PM
in
General Discussion
#34469 Probelms In Sockets??
Posted by
Nobby
on 30 August 2012 - 10:28 PM
in
Netduino Plus 2 (and Netduino Plus 1)
- You close the socket
- Have a ReadTimeout value set on the socket
Either way, an exception will be thrown on the PC application. Make the buffer smaller to match the length of the data or provide an amount to read. In your case, the PC application will try to read 1000 bytes all-up.
On the Netduino side of things, I never simply use Socket.Send(). I always tell it was data range to use from the array so that I know I have full control over safe execution. This doesn't mean that the Netduino exception is being caused by this.
#35267 Interfacing netduino with an alarm clock
Posted by
Nobby
on 15 September 2012 - 08:22 AM
in
General Discussion
#32652 SD card trouble
Posted by
Nobby
on 25 July 2012 - 08:20 AM
in
Netduino Plus 2 (and Netduino Plus 1)
- The file test.txt already exists on the SD card
- The name of the root directory isn't \SD\
It may seem long-winded but I always query
VolumeInfo[] drives = VolumeInfo.GetVolumes();
It serves to ensure there is an SD card inserted(there are also other ways to check this). The objects also indicate the name of the root directory.
I haven't looked up the reference to Directory.GetCurrentDirectory for Micro Framework. It's standard usage is to return the current working directory which only applies to application domains running normal .Net Framework applications on a PC etc. Since the Netduino executes code from Flash rather than a virtualised application domain run from media, it doesn't use working directories.
#32165 Netduino Plus Network Interface Controller
Posted by
Nobby
on 18 July 2012 - 02:33 AM
in
Netduino Plus 2 (and Netduino Plus 1)
#38704 Visual Studio 2012 & Netduino Projects
Posted by
Nobby
on 08 November 2012 - 06:00 AM
in
General Discussion
#38284 Tenda 3G611R+ 3G router issues
Posted by
Nobby
on 31 October 2012 - 09:19 AM
in
Netduino Plus 2 (and Netduino Plus 1)
#37011 Runtime Memory Usage
Posted by
Nobby
on 11 October 2012 - 04:32 AM
in
General Discussion
Hi Nobby,
Try:
int freemem = Microsoft.SPOT.Debug.GC(...);
You can optionally pass in true, forcing a garbage collection, giving you the full amount of memory available.
Chris
That worked a treat, thanks Chris
![:o](http://forums.netduino.com/public/style_emoticons/default/ohmy.png)
#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.
#32510 Netduino Plus Network Interface Controller
Posted by
Nobby
on 23 July 2012 - 08:02 AM
in
Netduino Plus 2 (and Netduino Plus 1)
#32090 GPS shield odd results. Novice user.
Posted by
Nobby
on 17 July 2012 - 06:30 AM
in
Netduino Plus 2 (and Netduino Plus 1)
Sometimes the data can contain characters which are non punctuation, letters, numbers etc because certain bytes are acutally bit-fields of configuration and satelite data. String constructors might return NULL based on these non-alpha numeric characters. Instead, make a string, use a for/foreach loop and append each byte onto the string but cast it as a char.
change this
Debug.Print(new string(Encoding.UTF8.GetChars(buffer)));
to this
string dataString = ""; foreach(byte b in buffer) dataString+=(char)b; Debug.Print(dataString);
Good luck
#38211 Wireless contact switch
Posted by
Nobby
on 30 October 2012 - 12:31 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)
#32163 Multiple questions from someone thinking about picking up a netduino
Posted by
Nobby
on 18 July 2012 - 02:21 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
#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!!
#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).
- Netduino Forums
- → Nobby's Content
- Privacy Policy