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.

ash's Content

There have been 65 items by ash (Search limited from 24-May 23)


By content type

See this member's


Sort by                Order  

#46760 Creating Log Files.

Posted by ash on 06 March 2013 - 02:51 PM in General Discussion

I've a log file which i append to every so often. (Thats the easy bit)

 

What i want to do is if its gets above a certain size then delete the old 1 st line before add the latest line to the bottom of the file.

 

Is there a way of doing this? i cant exactly read the whole file as i will run out memory :(




#46769 Creating Log Files.

Posted by ash on 06 March 2013 - 04:39 PM in General Discussion

Dave thanks very much option b seems to the best and the most easy to implement :)




#43166 Com2 on the plus 2

Posted by ash on 11 January 2013 - 03:47 PM in Netduino Plus 2 (and Netduino Plus 1)

Adafruit was the place we got the plus 2's from because no where in the UK had enough stock and no stock of the plus 1's. We went for the Plus 2 thinking it would be a direct drop in replacement.

 

The funny thing is ive put my shield back on the plus 1 and its working as well as can be expected. Stick on the plus 2 the com2 and debugging is a nightmare.

 

Com 2 is set to 38400 initally until i set up the camera and the camera the baud rate to use is 115200. Then i close the port, change the baud rate and then re-open it. Any other comms after returns 0 bytes to read!




#43156 Com2 on the plus 2

Posted by ash on 11 January 2013 - 03:15 PM in Netduino Plus 2 (and Netduino Plus 1)

            byte[] outbuff = new byte[] { 0x56, 0x00, 0x32, 0x0C, 0x00, 0x0A, 0x00, 0x00, bPos1, bPos2, 0x00, 0x00, bLen1, bLen2, bdelay1, bdelay2 };            int numPackets = imagelength / 496;            if (imagelength > (numPackets * 496)) numPackets += 1;            byte[] imageData = new byte[imagelength];            for (int i = 0; i < numPackets; i++)            {                int pos = i*496;                // Ask for the next packet                outbuff[8] = (byte)(pos >> 8);                outbuff[9] = (byte)(pos & 0xFF);                serialPort.Write(outbuff, 0, outbuff.Length);                int bytesToRead = 506;

 

as soon as you step over the last line, thats it! no more debugging and the program has crashed!




#43151 Com2 on the plus 2

Posted by ash on 11 January 2013 - 02:08 PM in Netduino Plus 2 (and Netduino Plus 1)

compared to plus 1 the com port 2 is not behaving correctly. we got a serial camera attached and it does not get any data when we asked for it  or when we write a buffer it just hangs!!!  (Baud rate 115200)




#43154 Com2 on the plus 2

Posted by ash on 11 January 2013 - 03:12 PM in Netduino Plus 2 (and Netduino Plus 1)

cant test on another com port as its a sheild. Works fine the plus 1 and there are a few deployed at our customers

 

One the plus 2 it seems the debugging is terrible. you step over while bugging and nothing happens!!! its hard to explain

 

I wish i never brought the plus 2 now but no where stocked the plus 1. im a tight dead line and these kind of hassles is not what i need right now!




#43172 Com2 on the plus 2

Posted by ash on 11 January 2013 - 04:17 PM in Netduino Plus 2 (and Netduino Plus 1)

 serialPort = new SerialPort("COM2", 38400, Parity.None, 8, StopBits.One);

hi, sorry. its noting special :P




#43177 Com2 on the plus 2

Posted by ash on 11 January 2013 - 04:28 PM in Netduino Plus 2 (and Netduino Plus 1)

thanks mark but with we need more than 10 and need to get this working on the 2's as it will benefit everyone as there is an issue here. like i said it works fine the np1 and falls over on the np2.




#43173 Com2 on the plus 2

Posted by ash on 11 January 2013 - 04:18 PM in Netduino Plus 2 (and Netduino Plus 1)

changing the baud rate

 public bool ChangeBaudRate(Baud baudRate)        {            byte b1= 0x2A,b2= 0xF2;            switch (baudRate)            {                case Baud.B57600:                    b1 = 0x1C;                    b2 = 0x4C;                    break;                case Baud.B115200:                    b1 = 0x0D;                    b2 = 0xA6;                    break;            }            byte[] outbuff = new byte[] { 0x56, 0x00, 0x24, 0x03, 0x01, b1, b2 };            serialPort.Write(outbuff, 0, 7);            byte[] inbuff = WaitForResponse(5, 50);            if ((inbuff[0] == 0x76) && (inbuff[2] == 0x24))            {                serialPort.Close();                serialPort.BaudRate = 115200;                serialPort.Open();                return true;            }            return false;        }



#43182 Com2 on the plus 2

Posted by ash on 11 January 2013 - 04:49 PM in Netduino Plus 2 (and Netduino Plus 1)

i dont a small project which basically sets up the camera, takes a pic and returns the pic as a byte array and yes the same issue is there.

 

public byte[] GetImageData(int imagelength)        {            byte bdelay1 = 0x00;            byte bdelay2 = 0x0A;            byte bPos1 = 0x00;            byte bPos2 = 0x00;            // datalength of 496. Camera transfer maximum 512 bytes at a time. Each packet has 5 bytes at the start and 5 at the end            // and the datalength must be a multiple of 8. So 496 is the biggest we can have            byte bLen1 = 0x01;            byte bLen2 = 0xF0;            byte[] outbuff = new byte[] { 0x56, 0x00, 0x32, 0x0C, 0x00, 0x0A, 0x00, 0x00, bPos1, bPos2, 0x00, 0x00, bLen1, bLen2, bdelay1, bdelay2 };            int numPackets = imagelength / 496;            if (imagelength > (numPackets * 496)) numPackets += 1;            byte[] imageData = new byte[imagelength];            for (int i = 0; i < numPackets; i++)            {                int pos = i*496;                // Ask for the next packet                outbuff[8] = (byte)(pos >> 8);                outbuff[9] = (byte)(pos & 0xFF);                serialPort.Write(outbuff, 0, outbuff.Length);                int bytesToRead = 506;                if ((imagelength - pos) < 496)                {                    bytesToRead = (imagelength - pos) + 10;                }                WaitForData(bytesToRead, 100, imageData, pos);            }            StopPic();            return imageData;        }

as i step over the code the debug line dissapear when i do a serial.write and it looks like the system has crashed as there is nothing else i can do!




#43382 Com2 on the plus 2

Posted by ash on 14 January 2013 - 12:20 PM in Netduino Plus 2 (and Netduino Plus 1)

I dont think its the com port as i did a loop back test and it seemed ok but 100% sure.

Attached Files




#43148 cant deploy to plus 2

Posted by ash on 11 January 2013 - 11:56 AM in Netduino Plus 2 (and Netduino Plus 1)

got it going but ive got an issue which im not sure about yet but i tried to go back to my plus 1 and now it wont deploy to that!!!! we have devices with version 1 out there :(




#43144 cant deploy to plus 2

Posted by ash on 11 January 2013 - 11:01 AM in Netduino Plus 2 (and Netduino Plus 1)

with have the new batch and ive upgraded to 4.2.2. also updated the netdunino sdk. ive already got the 4.2 qef sdk installed but when i try to deploy my old netdunino plus code to the plus 2 it fails!!!! please help :(




#33590 Camera's

Posted by ash on 14 August 2012 - 01:47 PM in General Discussion

just been playing with a ttl camera based on the OV528 chip. Taking a 640x480 jpg takes about 15 seconds. Is this typical? is there any faster cameras out there?



#33503 Camera Modules for any Netduino

Posted by ash on 13 August 2012 - 07:49 AM in Netduino Plus 2 (and Netduino Plus 1)

i'm using a camera with the OV528 chip and there is a class for it and it works!




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.