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.

Afshin's Content

There have been 7 items by Afshin (Search limited from 24-April 23)


By content type

See this member's

Sort by                Order  

#61700 Memory Shortage while Loading Assemblies Dynamically

Posted by Afshin on 23 February 2015 - 06:15 PM in Netduino Plus 2 (and Netduino Plus 1)

I have been using https://fabienroyer....ith-a-netduino/ as a guideline for updating my application remotely at runtime on ND+2.

 

However, the problem is that the size of.pe file is about 60KB, and that results in low memory exception when the code reads assembly bytes and copies them into byte array (assmfile.Read, taking 60KB of RAM) and then loads the assembly (Assmbley.Laod, taking another 60KB of RAM). I am aware that I can break down the application into smaller separate assemblies and load them separately. But, I would like to leave it as the last option, since most parts of the application work dependently to each other, and separating them would be a pain.

 

Is there any way that I can somehow combine two said steps together or bypass loading the assembly into byte array to save some spaces?

 

Also, I am wondering if the above technique is the only way to have in-field remote update for applications on Netduino boards.

 

Thanks.




#60192 RS-232 Pins

Posted by Afshin on 22 September 2014 - 09:12 PM in Netduino Mini

Baxter, thanks for the reply.

 

Any idea of the availability of the product in the future?




#60182 RS-232 Pins

Posted by Afshin on 22 September 2014 - 03:03 PM in Netduino Mini

In the technical specification of NetDuino Mini, pins 1 to 4 are mentioned as RS232 pins, specifically pins 1 and 2 for TX and RX. Does this imply that  I can get RS232 connection by simply connecting these pins to corresponding pins on a RS232 cable?

 

I assume for pins 11 and 12 (UART1 TX, RX) a TTL/RS232 adapter is required to convert TTL to RS232 and vice versa. Please correct me if I am wrong.

 

Also, is NetDunio Mini a discontinued product? I see many small and useful applications using this product, and it would be unfortunate, if it is discontinued.

 

Thanks. 

 

 




#59219 Frequent writing into SD card caused lost data in reading from serial port

Posted by Afshin on 14 July 2014 - 06:57 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks SocialSam and liqdfire for the answers, and sorry for the delay in following up with my question, I was away for awhile. 

 

I have read on the forums, it may be caused by the SD card turning interrupts off on the microcontroller when it is doing writes, and the serial port misses putting the data on the buffer.

 

Yes lidfire, it makes sense then, since what I see in those cases are original data with some missed bytes, and the rest is untouched!

I will search more to see if will be able to find a reference for this. Thanks.




#59218 Server to Client Communication

Posted by Afshin on 14 July 2014 - 06:44 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

I have just started to develop a simple home-automation application using Netduino plus 2 boards. 

 

I have no problem developing a client to server application, in the case of a periodic data capturing scenario, in which the board proactively sends the captured data to a server (implemented on PC), and server replies back with some instructions according to the received data.

 

However, I wonder how it is possible to write the code for server sending instruction to clients, without clients requesting a service first and initiating the connection. This is useful for example in controlling lights. Specifically, I would like to have the control from an outside network (WAN), and not only within a LAN.

 

I have found few libraries and protocols for this purpose, like:

- SignalR which I am not sure can be supported by NetDunino board, and

- MQTT 

 

But before digging into any of them, I would like to know, if these are the best suited protocols for this purpose or if there is any other library or protocol that I need to know about. 

 

To be more specific, I am looking for a protocol/library that: 

- can be implemented on and supported by Netduino boards.

- can establish a server to client connection with no initiation of the connection by the client.

- can be implemented on a WAN.

 

Thanks  :)

 




#59217 Server to Client Communication

Posted by Afshin on 14 July 2014 - 06:44 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

I have just started to develop a simple home-automation application using Netduino plus 2 boards. 

 

I have no problem developing a client to server application, in the case of a periodic data capturing scenario, in which the board proactively sends the captured data to a server (implemented on PC), and server replies back with some instructions according to the received data.

 

However, I wonder how it is possible to write the code for server sending instruction to clients, without clients requesting a service first and initiating the connection. This is useful for example in controlling lights. Specifically, I would like to have the control from an outside network (WAN), and not only within a LAN.

 

I have found few libraries and protocols for this purpose, like:

- SignalR which I am not sure can be supported by NetDunino board, and

- MQTT 

 

But before digging into any of them, I would like to know, if these are the best suited protocols for this purpose or if there is any other library or protocol that I need to know about. 

 

To be more specific, I am looking for a protocol/library that: 

- can be implemented on and supported by Netduino boards.

- can establish a server to client connection with no initiation of the connection by the client.

- can be implemented on a WAN.

 

Thanks  :)

 




#58655 Frequent writing into SD card caused lost data in reading from serial port

Posted by Afshin on 09 June 2014 - 10:14 PM in Netduino Plus 2 (and Netduino Plus 1)

Hello,

 

I am experiencing a confusing problem with reading data from the serial port (COM1), and writing some data into a text file on SD card.

 

In my scenario, a serial RF transceiver is connected to COM1. The received data is in the form of few messages per second with the length of 40-50 bytes each. Some processes are done on the received data, and processing results are written into the disk. However, application specification results in a higher amount of data to be written into the disk, compared to the amount of data received and delivered by the RF transceiver, about 100 bytes per 10-20 milliseconds, like a data stream.

 

Having said that, I've made two different threads except the main thread, one to only read data without any processing from the port and store them into a buffer (a byte array), and the other to process the stored data and write the results into the disk (using FileStream and StreamWriter methods).

 

Everything works fine, when the writing into the disk is disabled (using some flags in my code), and all data can be processed properly as I can validate it from the debug display. However, when the writing is active, data are not received completely from the serial port, and some part of messages are lost. This does not happens all the time, but happens frequently enough to degrade the total processing performance. 

 

Considering that I have used two different threads, and given a higher priority to the "serial port reader" thread and a lower priority to a the "Disk Writer" thread, is it possible that a kind of shared buffer in a lower level is used commonly between that Disk I/O and Serial Port I/O that causes overriding somewhere. 

 

any advice is appreciated. Thanks.





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.