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

TristatePort Issue


  • Please log in to reply
19 replies to this topic

#1 QuantumPhysGuy

QuantumPhysGuy

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts
  • LocationKentucky, USA

Posted 09 October 2012 - 12:16 AM

I am trying to get the Parallax Ping))) Sensor working with the Netduino GO and the Shield Base. I am using the Ping class that was created by afulki which can be found here.

Whenever I try to run the code I get an error that states:
An unhandled exception of type 'System.Exception' occurred in GoBusSerialTransport.dll

This is my Program.cs:
        public static void Main()
        {
            ShieldBase shieldbase = new ShieldBase(GoSockets.Socket1);
            Thread.Sleep(5000);
            ParallaxSensors.Ping pPing = new ParallaxSensors.Ping(shieldbase.Pins.GPIO_PIN_D5, 1000, true);

            pPing.RangeEvent += new ParallaxSensors.Ping.RangeTakenDelegate(pPing_RangeEvent);

            Thread.Sleep(Timeout.Infinite);
        }

        public static void pPing_RangeEvent(object sender, ParallaxSensors.PingEventArgs e)
        {
            Debug.Print("Range: " + e.Distance + " cm");
        }

It seems to be failing on line 72 of the code posted by afulki, but I can't figure out why.
_port = new TristatePort(pin, false, false, ResistorModes.Disabled);

This is the stack trace information for the error:

Exception was thrown: System.Exception

GoBus.GoBusSerialTransport::CallFunction
NetduinoGo.ShieldBase::CreateTristatePort
System.Reflection.MethodBase::Invoke
Microsoft.SPOT.Hardware.TristatePort::.ctor
PINGSensor.Program::Main


Does anyone have any ideas?

Edited by QuantumPhysGuy, 09 October 2012 - 12:19 AM.


#2 QuantumPhysGuy

QuantumPhysGuy

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts
  • LocationKentucky, USA

Posted 10 October 2012 - 03:33 AM

I have narrowed it down a bit. It appears what is actually failing is the GoBus.GoBusSerialTransport.CallFunction.

I finally tracked the exception down to line 1098 of GoBusSerialTransport.cs but not 100% sure why it threw an exception.

Line 1098:
if (functionResponse.Exception != null)
{
throw functionResponse.Exception;
}

Any ideas?

#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 10 October 2012 - 03:42 AM

Hi QuantumPhysGuy, Is the pin being used already, by any chance? We're passing exceptions via GoBus--but only the root Exception class. We'll be adding the others soon as well so you can get full exception details. If you create a TristatePort for that pin directly from your code...do you also get the exception? Chris

#4 QuantumPhysGuy

QuantumPhysGuy

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts
  • LocationKentucky, USA

Posted 10 October 2012 - 03:44 AM

Hi QuantumPhysGuy,

Is the pin being used already, by any chance?

We're passing exceptions via GoBus--but only the root Exception class. We'll be adding the others soon as well so you can get full exception details.

If you create a TristatePort for that pin directly from your code...do you also get the exception?

Chris


D5 isn't being used except for trying to create the TristatePort.

Currently this throws the same exception:

TristatePort _port = new TristatePort(shieldbase.Pins.GPIO_PIN_D5, false, false, ResistorModes.Disabled);


#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 10 October 2012 - 03:50 AM

D5 isn't being used except for trying to create the TristatePort.

Currently this throws the same exception:

TristatePort _port = new TristatePort(shieldbase.Pins.GPIO_PIN_D5, false, false, ResistorModes.Disabled);

Okay, that's very interesting. This is with beta 4?

If you create it as an InputPort do you get the same issue?

Chris

#6 QuantumPhysGuy

QuantumPhysGuy

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts
  • LocationKentucky, USA

Posted 10 October 2012 - 03:59 AM

Okay, that's very interesting. This is with beta 4?

If you create it as an InputPort do you get the same issue?

Chris


Yes this is with beta 4, but I was having this same problem with beta 3. The below code worked without error:

InputPort ipPort = new InputPort(shieldbase.Pins.GPIO_PIN_D5, false, Port.ResistorMode.Disabled);


#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 10 October 2012 - 04:28 AM

Okay, we may have introduced a bug with TristatePort with the GoBus 1.5 transition. I know we tested it but I will check our test code to see what we missed... Chris

#8 Nicky

Nicky

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationDenmark

Posted 16 October 2012 - 08:35 AM

I get nearly the same error: this.portOut = new TristatePort(this.pinOut, true, false, Port.ResistorMode.Disabled); Throws System.Exception in GoBusSerialTransport.dll Callstack: GoBusSerialTransport.dll!GoBus.Utility.CRC8.SendDataPacket Line 1009 + 0xcf bytes NetduinoGo.ShieldBase.dll!NetduinoGo.ShieldBase.CreateTristatePort(Microsoft.SPOT.Hardware.Cpu.Pin portId, bool initialState, bool glitchFilter, Microsoft.SPOT.Hardware.Port.ResistorMode resistor) Line 316 + 0x5d bytes [External Code] MyCode The line that throws exception is the closing bracket in SendDataPacket... And this time I checked the dll-versions: Shieldbase Beta 4 GoBusSerialTransport 1.4.1.0 NetduinoGo.Shieldbase 0.3.0.0 GoBus 1.0 Running .NET MF 4.2 QFE2 edit: The pin is not in use. I've tried several different pins - D6, D7, D11, D12 to be specific. edit 2: It's the same scenario when I have nothing else initlialized on the Shieldbase.

ntools
TCP Listener (Beta) · FTP Server (Alpha)
Netduino Plus Go Module · Xml Parser
http://ntools.codeplex.com/


#9 halobox

halobox

    New Member

  • Members
  • Pip
  • 5 posts
  • LocationEurope, Germany

Posted 30 December 2012 - 10:16 PM

Is there any workaround available for this bug right now? Perhaps any kind of beta library?

 

Greetings halobox



#10 halobox

halobox

    New Member

  • Members
  • Pip
  • 5 posts
  • LocationEurope, Germany

Posted 15 January 2013 - 07:57 PM

Is there any news to this bug?

 

Regards

halobox



#11 Lunddahl

Lunddahl

    Advanced Member

  • Members
  • PipPipPip
  • 152 posts
  • LocationEurope, Denmark

Posted 16 January 2013 - 07:08 PM

Is it still there with ShieldBase Beta5 ?

#12 halobox

halobox

    New Member

  • Members
  • Pip
  • 5 posts
  • LocationEurope, Germany

Posted 16 January 2013 - 07:53 PM

Yes it is.

 

halobox



#13 eplaksienko

eplaksienko

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts

Posted 03 May 2013 - 02:12 PM

Chris any news about it?



#14 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 03 May 2013 - 04:54 PM

Hi eplaksienko, No resolution on this one quiet yet. This is in our issue tracking system and on the list but hasn't made it all the way to the top quite yet. Chris

#15 eplaksienko

eplaksienko

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts

Posted 03 May 2013 - 06:10 PM

Chris, is it related to the issue with can not dispose OutportPort?



#16 cgoss

cgoss

    New Member

  • Members
  • Pip
  • 2 posts

Posted 11 May 2013 - 06:43 AM

Chris, do you have any idea on when this will be worked on? I have a DHT22 and DHT11 that I am using the Tristate port to communicate with the device on.

 

Is there another alternative avalible?

 

 

Thanks in advance.



#17 Arron Chapman

Arron Chapman

    Advanced Member

  • Members
  • PipPipPip
  • 289 posts
  • LocationOregon, USA

Posted 15 May 2013 - 12:20 AM

Is there any workaround available for this bug right now? Perhaps any kind of beta library?

 

Greetings halobox

 

 

Is there any news to this bug?

 

Regards

halobox

 

 

Chris any news about it?

 

 

Chris, is it related to the issue with can not dispose OutportPort?

 

 

Chris, do you have any idea on when this will be worked on? I have a DHT22 and DHT11 that I am using the Tristate port to communicate with the device on.

 

Is there another alternative avalible?

 

 

Thanks in advance.

 

I'm sure that the second there is a solution Chris will post about it, until then probing him for updates simply requires him to spend time answering you rather than working to solve the problem.

 

If your needs are pressing I'd like to suggest you have a look at either Netduino, Netduino 2, Netduino Plus, Netduino Plus 2, Netduino Mini or perhaps the ProtoModule.

 

Let me also take this opportunity to remind you all that the Shield Base is a beta product, and clearly labeled as such, don't expect it to work 100% until such time as it is no longer Beta.


When you talk EE use small words, I'm just a Software Developer :)
My Blog/Site and Everything Else

If my post helped you please consider pressing the "Like This" button in the bottom right-hand corner.

 

Oh my. So many things, so little money!!

 


#18 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 15 May 2013 - 12:31 AM

Chris, do you have any idea on when this will be worked on? I have a DHT22 and DHT11 that I am using the Tristate port to communicate with the device on.

 

Is there another alternative avalible?

 

 

Thanks in advance.

Hi cgoss,

 

I'm not by my Shield Base at the moment, but what happens if you create an OutputPort and Dispose it and then create an InputPort when you need to switch (and vice-versa)?

 

This is near the top of our bugfix list.  We're working our way to it, and if anyone else wants to attack it we can pull in that fix...

 

Chris



#19 eplaksienko

eplaksienko

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts

Posted 15 May 2013 - 01:35 AM

Chris I personally first tried to dispose OutputPort with the exception, then I tried to use TristatePort, and get the same kind of unknown exception. I am just trying to play with CharliePlexing 



#20 eplaksienko

eplaksienko

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts

Posted 12 June 2013 - 02:25 PM

Chris, any updates on this issue?






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.