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.
Photo

Strange behavior from Netduino Plus 2

Netduino Plus 2

Best Answer DRMons, 31 October 2013 - 11:03 AM

Hi again Chris,

 

This blocking trouble is solved !

with the log of MFDeploy, I saw the different Threads was not starting in the same order compared with when it's launched by Visual studio

So, I added a function at Thread (IsWorking()) and in the main part, the program wait the previous Thread is finished to load before to load the next one

 

;)

Go to the full post


  • Please log in to reply
4 replies to this topic

#1 DRMons

DRMons

    New Member

  • Members
  • Pip
  • 4 posts

Posted 30 October 2013 - 01:49 PM

Hi,

I'm using Visual C# 2010 Express with Netduino SDK 4.2.1

 

when I try my software by pressing F5 in Visual C#, anyway if it's in Debug or Release

at startup, the Netduino read data from SD card (name, server_ip and server_port)

and it connect to my server, when I push a button on it, the good signal is sended, all work nice

 

but if I disconnect the Netduino Plus 2 and use an external power supply,

the Netduino connect correctly on server, but button is no working any more, no signal receive by server

 

Why my software is only working if launched by Visual Studio and no working in stand alone ?

 

Best regards



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 October 2013 - 04:52 PM

Hi DRMons, If you connect the USB cable and the external power supply and just watch the program output via MFDeploy, do you experience the same issue? The garbage collector may be more/less active when the debugger isn't attached, due to the changed memory usage in the device. If that's the case...be sure that you an event you're counting on isn't tied to an object which has gone out of scope. Does that help point you in the right direction? Welcome to the Netduino community, Chris

#3 DRMons

DRMons

    New Member

  • Members
  • Pip
  • 4 posts

Posted 31 October 2013 - 08:45 AM

Hi Chris,

 

Firstly, thanks for you quick answer ;)

 

So, I connected the USB cable and the power supply as asked, I launched MFDeploy and see the program output but the result is the same.

 

Some details about my netduino program

  it read datas on SD card (machine_name, server_ip, server_port and timer)

  if datas are successfully get, 3 Thread are launched :

  MessageManager

  ProductionManager

  NetworkManager

  the ProductionManager Thread get datas from a Tinkerkit shield

  there are some troubles with network, so, the server connection is not always available

  so, ProductionManager send datas at MessageManager, this one keep datas waiting to be send at server

  when the NetworkManager is started, it look if somes messages are present in MessageManager, if yes, it send it and remove it

  when connected to server, the Netduino sent the initial state get from the TinkerKit (ENG_ON/ENG_OFF and COMP_ON/COMP_OFF)

 

 

On MFDeploy, I saw the following output :

  MessageManager started!

  ProductionManager started!

  NetworkManager started!

  Connected to server!

  MACHINE_NAME=P08

  Sent Message :ENG_ON

  Sent Message :COMP_OFF

 

On server, I see the Netduino connected and the initial state is correct but all seems blocked on the Netduino :(

 

Now, if I launched the program from Visual C# 2010 Express, I get the same but no blocked, so new datas from the TinkerKit continue to be sended to server

 

So, why the Netduino behavior is different depending how I launch the soft ?



#4 DRMons

DRMons

    New Member

  • Members
  • Pip
  • 4 posts

Posted 31 October 2013 - 08:54 AM

Hi again, a log can be nice :) --------------------------------------------------------------- Found debugger! Create TS.  Loading start at 806a988, end 8085288 Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0) Assembly: Microsoft.SPOT.Net (4.2.0.0) Assembly: System (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.SerialPort (4.2.0.0) Assembly: Microsoft.SPOT.IO (4.2.0.0) Assembly: System.IO (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1) Assembly: Microsoft.SPOT.Hardware.Usb (4.2.0.0) Assembly: SecretLabs.NETMF.Diagnostics (4.2.0.0) Assembly: SecretLabs.NETMF.Hardware.Netduino (4.2.1.0) Assembly: Microsoft.SPOT.Hardware.OneWire (4.2.0.0) Assembly: Microsoft.SPOT.Time (4.2.0.0) Loading Deployment Assemblies. Attaching deployed file. Assembly: SecretLabs.NETMF.IO (4.2.0.0) Attaching deployed file. Assembly: ProductionMachine (1.0.0.0) Attaching deployed file. Assembly: SecretLabs.NETMF.Hardware (4.2.0.0) Resolving. Ready. ProductionManager started! NetworkManager starting... NetworkManager started! MessageManager started! ProductionData Started ProductionData Started ProductionData Started ProductionData Started NetworkManager connection initializing... Connected SendMessage - message : CODE=P08 SendMessage - message : ENG_ON SendMessage - message : COMP_OFF NetworkManager connection initialized! IP Address : 192.168.5.96 NetworkManager - message : CODE=P08 NetworkManager - message : ENG_ON NetworkManager - message : COMP_OFF --------------------------------------------------------------- "SendMessage - message :" is when the ProductionManager send a message at MessageManager "NetworkManager - message :" is when the NetworkManager take a message from MessageManager, send it to server and remove it from MessageManager from now, it's blocked :(



#5 DRMons

DRMons

    New Member

  • Members
  • Pip
  • 4 posts

Posted 31 October 2013 - 11:03 AM   Best Answer

Hi again Chris,

 

This blocking trouble is solved !

with the log of MFDeploy, I saw the different Threads was not starting in the same order compared with when it's launched by Visual studio

So, I added a function at Thread (IsWorking()) and in the main part, the program wait the previous Thread is finished to load before to load the next one

 

;)







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.