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.

tknman0700's Content

There have been 26 items by tknman0700 (Search limited from 30-March 23)


By content type

See this member's


Sort by                Order  

#30030 Serial Port Problems

Posted by tknman0700 on 31 May 2012 - 04:09 AM in Netduino Plus 2 (and Netduino Plus 1)

not sure I follow the .flush() reference. Would you do this before you read from the port?



#30029 Netduino Plus 1 Firmware v4.1.0 (update 6)

Posted by tknman0700 on 31 May 2012 - 03:40 AM in Netduino Plus 2 (and Netduino Plus 1)

are there updated drivers for running this firmware? Visual Studio crashing all the time when debug.



#30028 VS2010 Crash on debug

Posted by tknman0700 on 31 May 2012 - 03:37 AM in Visual Basic Support

Same problem here.. vb development crashing visual studio left and right anytime I try to set a break point and investigate variable.



#30022 Serial Port Problems

Posted by tknman0700 on 31 May 2012 - 02:04 AM in Netduino Plus 2 (and Netduino Plus 1)

Ok I am still a bit confused.. I am doing this.

Private Sub serialPort_DataReceived(ByVal sender As Object, ByVal e As SerialDataReceivedEventArgs)
        ' Check if Chars are received

        Dim ReadBuffer As Byte() = New Byte(sp.BytesToRead - 1) {}
        If e.EventType = SerialData.Chars Then
            ' Create new buffer

            sp.Read(ReadBuffer, 0, ReadBuffer.Length)

            If ReadBuffer.Length > 0 And (ReadBuffer(ReadBuffer.Length - 1) = 10 OrElse ReadBuffer(ReadBuffer.Length - 1) = 0) Then
                ' New line or terminated string.
                output.Append(GetUTF8StringFrombytes(ReadBuffer))
                Debug.Print("Recieved : " & output.ToString())
                output.Clear()
              Else
                Try
                    output.Append(GetUTF8StringFrombytes(ReadBuffer))
                Catch ecx As Exception
                    Debug.Print("Cannot parse : " & ecx.StackTrace)
                End Try
            End If
        End If

    End Sub

The problem is that when I "read" from the bus I also see what I just sent to the bus.

I have added the above as a handler....

AddHandler sp.DataReceived, New SerialDataReceivedEventHandler(AddressOf serialPort_DataReceived)

But I am not sure why I see the stuff I just sent to the serial bus in addition to the data that the device placed on the bus. Like i said I am new to hardware interfacing but not .net development. I think I am just missing a few connections here to really taking good advantage of this prototyping kit.

Any direction for handling serial data is appreciated...

This is code I have adapted from a few sources online as starters...

Thanks



#29999 Serial Port Problems

Posted by tknman0700 on 30 May 2012 - 04:27 PM in Netduino Plus 2 (and Netduino Plus 1)

Ok thank you for your advice... I left out that line. I have it working now but I am trying to better understand how to write and read from serial ports generally speaking. How to know when the data is done being "read" on the serial port etc. Thank you



#29957 Serial Port Problems

Posted by tknman0700 on 29 May 2012 - 09:37 PM in Netduino Plus 2 (and Netduino Plus 1)

I am interfacing with this GPRS board and on their wiki the reference setting the serial port mode to be swserial but when I set it like that I cannot seem to read any data from teh serial port. I have jumpers set to xduino and I get data but it is just echo data of what I send to the port. Sorry there may be something very obvious here but I am not sure what I am doing wrong.



#29956 Serial Port Problems

Posted by tknman0700 on 29 May 2012 - 09:08 PM in Netduino Plus 2 (and Netduino Plus 1)

That for sure fixed my error... now on the next problem and probably my bigger problem. I dont know how to debug serial port communication on this thing. Are there any samples you can point me to for help on getting data back from a serial port? In other words once I print to the serial port how do I see what came back? This may seem stupid but I am very new to hardware interfacing - not .net development but I need some pointers. Thanks



#29952 Netduino Firmware v4.2.0 RC5 (Netduino + Netduino Plus)

Posted by tknman0700 on 29 May 2012 - 08:51 PM in Beta Firmware and Drivers

There is a comment here:

Before deploying the attached firmware, you should erase your board completely and flash the v4.2 RC5 bootloader (included in the attached ZIP file).


Can you tell me how I might go about that? It isnt in your details unless I am missing it.



#29951 Serial Port Problems

Posted by tknman0700 on 29 May 2012 - 08:48 PM in Netduino Plus 2 (and Netduino Plus 1)

ClrInfo.targetFrameworkVersion: 4.2.0.0 SolutionReleaseInfo.solutionVersion: 4.2.0.0 SolutionReleaseInfo.solutionVendorInfo: Netduino Plus (v4.2.0.0 RC4) by Secret Labs LLC SoftwareVersion.BuildDate: Feb 2 2012 SoftwareVersion.CompilerVersion: 410713 FloatingPoint: True SourceLevelDebugging: True ThreadCreateEx: True LCD.Width: 0 LCD.Height: 0 LCD.BitsPerPixel: 0 AppDomains: True ExceptionFilters: True IncrementalDeployment: True SoftReboot: False Profiling: False ProfilingAllocations: False ProfilingCalls: False IsUnknown: False



#29949 Serial Port Problems

Posted by tknman0700 on 29 May 2012 - 08:31 PM in Netduino Plus 2 (and Netduino Plus 1)

I am trying to get my head around serial ports using VB and having problems here. I am interfacing with SeeedStudio GSM board.

Here is my code....

Dim awatingResponseString As String = ""
Dim awaitingResponse As Boolean = False
Dim sp As SerialPort

Public Sub Main()
        Dim sp As New SerialPort(SerialPorts.COM1, 19200, Parity.Odd, 8, StopBits.One)
        SendSMS("18005551212", "test")
    End Sub

Public Sub PrintLine(ByVal line As String, Optional ByVal awaitResponse As Boolean = False, Optional ByVal awaitResponseString As String = "")
        If Not awaitResponseString.Equals("") Then
            awatingResponseString = awaitResponseString
            While Not awatingResponseString.Equals("")
                Thread.Sleep(1000)
            End While
        End If
        Print(line)
        If awaitResponse Then
            awaitingResponse = True
            While awaitingResponse
                Thread.Sleep(100)

            End While
        End If
    End Sub

    Private Sub Print(ByVal line As String)
        Dim encoder As New System.Text.UTF8Encoding()
        Dim bytesToSend As Byte() = encoder.GetBytes(line)
        sp.Write(bytesToSend, 0, bytesToSend.Length)
    End Sub

    Public Sub SendSMS(ByVal msisdn As String, ByVal message As String)
        'PrintLine("");
        PrintLine("AT+CMGF=1", True)
        PrintLine("AT+CMGS=""" & msisdn & """", False)
        PrintLine(message)
        Thread.Sleep(100)
        PrintEnd()
        Thread.Sleep(500)
        'Debug.Print("SMS Sent!");
    End Sub

    Private Sub PrintEnd()
        Dim bytesToSend As Byte() = New Byte(0) {}
        bytesToSend(0) = 26
        sp.Write(bytesToSend, 0, 1)
        Thread.Sleep(200)
    End Sub

In the Print() function I get this error:

An unhandled exception of type 'System.NullReferenceException' occurred in Netduino Power Control.exe

And I get this error when I issue the sp.write.
I am trying understand how to test and debug with serial port but keep bumping my head here.
Can anyone offer help?

Thanks



#29449 Serial Terminal

Posted by tknman0700 on 20 May 2012 - 10:56 PM in General Discussion

In arduino we are able to interface a pc based terminal application to the serial ports on the board and thus talk to shields directly from the pc for debugging purposes. Would anyone have sample code to do the same in Netduino? Thanks



#29327 GPRS/SMS shield help please

Posted by tknman0700 on 17 May 2012 - 11:44 AM in General Discussion

Hi group I am trying to use netduino and the seeed studio board an having problems. It seems that there is a comment about disabling the pin code on the sim card. Can anyone tell me why that means? I have a t Mobile prepaid card with text message capability assigned. Can anyone help me with the basic idea here of wht I need to do to make this work? I have tried to run the library but get exceptions on serial port initializer step.



#28412 Netduino Plus and Seedstudio GPRS Shield

Posted by tknman0700 on 02 May 2012 - 01:41 AM in Netduino Plus 2 (and Netduino Plus 1)

Can anyone give me direction with how to get support here?



#28235 Netduino Plus and Seedstudio GPRS Shield

Posted by tknman0700 on 27 April 2012 - 09:38 PM in Netduino Plus 2 (and Netduino Plus 1)

I am very new to the concept of netduino development and I must admit there are a few hurdles I need to cross. My background is in windows application development and my formal eduaction is in microprocessor and fw design with some emphasis in PLC implementation. I say all of this to say that I have some exposure to the idea of hardware development and am comfortable with the Visual Studio design environment.

I am however struggling with this device

http://www.seeedstud...l?cPath=132_134

I have located this helper wiki:
http://www.seeedstud...RS_Shield_v0.9b

I have located a helper library here:
http://netduino2seedgsm.codeplex.com/

I have downloaded the helper library and have tried to post simple SMS messages with no real luck. It seems that when I insert my break points into simple code like this Visual Studio simply dies when I try to watch a variable or even mouse over an object.

'static int bufferLength = 0;
        Public Sub New(Optional ByVal portName As String = SerialPorts.COM1, Optional ByVal baudRate As Integer = 19200, Optional ByVal parity__1 As Parity = Parity.Odd, Optional ByVal dataBits As Integer = 8, Optional ByVal stopBits__2 As StopBits = StopBits.One)
            serialPort = New SerialPort(portName, baudRate, parity__1, dataBits, stopBits__2)
            serialPort.ReadTimeout = -1
            serialPort.WriteTimeout = 10
            serialPort.Handshake = Handshake.XOnXOff
            serialPort.Open()

            AddHandler serialPort.DataReceived, New SerialDataReceivedEventHandler(AddressOf serialPort_DataReceived)
        End Sub

My question is this... are there any good reference links to getting started with serial communication using the netduino Plus?

Secondly if anyone has experience developing with this shield and is interested in making some contract money I will pay for the work to be done - I have all the control logic built I am just struggling to get around the communication piece of this.

Thank you in advance for your consideration.



#28051 BlinkyVB -- first Netduino app using Visual Basic

Posted by tknman0700 on 24 April 2012 - 07:32 PM in Visual Basic Support

Ok it is because the code was in a class... this code now runs.

Imports Microsoft.SPOT
Imports Microsoft.SPOT.Hardware
Imports SecretLabs.NETMF.Hardware
Imports SecretLabs.NETMF.Hardware.NetduinoPlus

Module Module1
    Dim ledStatus As Boolean = False
    Dim led As New OutputPort(Pins.ONBOARD_LED, ledStatus)
    Public WithEvents boardButton As New InterruptPort(Pins.ONBOARD_SW1, False, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth)

    Public Sub Main()
        Thread.Sleep(Timeout.Infinite)
    End Sub



    Private Sub boardButton_OnInterrupt(ByVal data1 As UInteger, ByVal data2 As UInteger, ByVal time As DateTime) Handles boardButton.OnInterrupt

        ledStatus = Not ledStatus
        led.Write(ledStatus)
    End Sub

End Module

I am not sure I understand why this matters but it seems to run well now and demonstrates responding to event as opposed to sleep and timer.



#28050 BlinkyVB -- first Netduino app using Visual Basic

Posted by tknman0700 on 24 April 2012 - 07:29 PM in Visual Basic Support

I have had that too once. I deployed Microsoft.SPOT.Hardware.PWM to it by accident (it's not compatible with 4.2RC4). I had to re-flash my device, but since then, it works just fine.



Ok I reflased and it seems to at least let me deploy now but I dont understand what is wrong with my code trying to handle events.



#28049 Netduino Firmware v4.2.0 RC4 (Netduino + Netduino Plus)

Posted by tknman0700 on 24 April 2012 - 07:24 PM in Beta Firmware and Drivers

I decided to go through the entire process again. MFDeploy says: Pinging... TinyCLR HalSystemInfo.halVersion: 4.2.0.0 HalSystemInfo.halVendorInfo: Netduino Plus (v4.2.0.0 RC4) by Secret Labs LLC HalSystemInfo.oemCode: 34 HalSystemInfo.modelCode: 177 HalSystemInfo.skuCode: 4097 HalSystemInfo.moduleSerialNumber: 00000000000000000000000000000000 HalSystemInfo.systemSerialNumber: 0000000000000000 ClrInfo.clrVersion: 4.2.0.0 ClrInfo.clrVendorInfo: Netduino Plus (v4.2.0.0 RC4) by Secret Labs LLC ClrInfo.targetFrameworkVersion: 4.2.0.0 SolutionReleaseInfo.solutionVersion: 4.2.0.0 SolutionReleaseInfo.solutionVendorInfo: Netduino Plus (v4.2.0.0 RC4) by Secret Labs LLC SoftwareVersion.BuildDate: Feb 2 2012 SoftwareVersion.CompilerVersion: 410713 FloatingPoint: True SourceLevelDebugging: True ThreadCreateEx: True LCD.Width: 0 LCD.Height: 0 LCD.BitsPerPixel: 0 AppDomains: True ExceptionFilters: True IncrementalDeployment: True SoftReboot: False Profiling: False ProfilingAllocations: False ProfilingCalls: False IsUnknown: False The problem now is that I can get my code to it but it seems VS cannot attach a debugger or something because my break points are not working. I put the simple blnky vb code on it and it still seems like the debugger is a bit peculiar - not attaching all the time, etc. In fact if I am debugging inside VS and pull teh USB cord our my computer instantly reboots... thats a nice feature. ; )



#28045 BlinkyVB -- first Netduino app using Visual Basic

Posted by tknman0700 on 24 April 2012 - 06:49 PM in Visual Basic Support

More info... MFDeploy now says "Pinging... Error: No response from device" when I try to ping it. Hmm....



#28040 BlinkyVB -- first Netduino app using Visual Basic

Posted by tknman0700 on 24 April 2012 - 06:26 PM in Visual Basic Support

Ok update - I decided to change USB ports on my laptop. No idea why but that made it show up as Netduino as expected. Now I hit F5 and it says preparing to deploy assemblies to the device for a few minutes... and does nothing. Then I get tired of watching it do nothing and unplug the netduino. Any ideas?



#28039 BlinkyVB -- first Netduino app using Visual Basic

Posted by tknman0700 on 24 April 2012 - 06:19 PM in Visual Basic Support

Thank you for your response.. I am not having a good day here. Yes I have it flashed to 4.2 and run MFDeploy with no errors. Previously when connect to my USB port it would show up... now when I am VS and trying to change the deployment to USB and select my device my device is not listed. Additionally when I run MFDeploy it does not see my device at all. I think my problems are compounding. ; )



#28029 BlinkyVB -- first Netduino app using Visual Basic

Posted by tknman0700 on 24 April 2012 - 04:26 PM in Visual Basic Support

Any idea why I cannot figure out how to make the button blink the LED using event handler?

Any help is appreciated.


Namespace NetDuinoTogglePower
    Public Class Program
        Shared ledStatus As Boolean = False
        Shared led As New OutputPort(Pins.ONBOARD_LED, ledStatus)
        Public WithEvents boardButton As New InterruptPort(Pins.ONBOARD_SW1, False, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth)

        Public Shared Sub Main()
            Thread.Sleep(Timeout.Infinite)
        End Sub



        Private Shared Sub boardButton_OnInterrupt(ByVal data1 As UInteger, ByVal data2 As UInteger, ByVal time As DateTime) Handles boardButton.OnInterrupt
            ledStatus = Not ledStatus
            led.Write(ledStatus)
        End Sub

    End Class
End Namespace

This is my first vb program when I hit F5 VS tells me the target it not initialized rebooting... it does this every time. Is there something to this? I dont recall seeing this before.

Thanks



#28027 Netduino Firmware v4.2.0 RC4 (Netduino + Netduino Plus)

Posted by tknman0700 on 24 April 2012 - 04:12 PM in Beta Firmware and Drivers

Having issues with the SDK giving compile errors when using vb and referencing reserved words like vbcr vbcrlf vblf. Solution is to reference them as Constants.vbCr Thank you



#28023 Netduino Firmware v4.2.0 RC3 (all editions)

Posted by tknman0700 on 24 April 2012 - 03:27 PM in Beta Firmware and Drivers

The very first step says: 1. Download and unzip the attached file to a directory on your computer. Where is this attached zip file you speak of?



#28021 How to install (or upgrade to) .NET Micro Framework v4.2 SDK

Posted by tknman0700 on 24 April 2012 - 03:19 PM in Beta Firmware and Drivers

How does one upgrade netduino plus to 4.2 flash? Thanks



#28020 Seeduino GPRS / GSM shield

Posted by tknman0700 on 24 April 2012 - 03:08 PM in Netduino 2 (and Netduino 1)

well I made progress... I figured out you need to follow the links here to update to 4.2 http://forums.netdui...?showtopic=2768 I am now still getting errors in the helper library. The type or namespace name 'SMS' could not be found (are you missing a using directive or an assembly reference?) Any ideas are appreciated.




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.