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.

baxter's Content

There have been 63 items by baxter (Search limited from 14-May 23)


By content type

See this member's


Sort by                Order  

#59117 NETMF SerialPort and "BreakState"

Posted by baxter on 09 July 2014 - 05:42 AM in Netduino Plus 2 (and Netduino Plus 1)

Wrong cable ... The one you linked is USB to RS232. I should have been more explicit. What you want is is USB to TTL. Something like this,
(1) http://www.ebay.com/...e-/261101529602
or this,
(2) http://www.mouser.co...j627GFcejHp0Q==
or this,
(3) http://yourduino.com...ct_detail&p=164

 

With the first two, you can plug your jumper wires into the end of the cable and then into the breadboard to bring the signal lines to the breadboard for connections. The third style can plug directly into the breadboard, but be careful that the header pins have enough depth and are not too far offset from the edge of the PCB. Most of my USB to serial TTL are like number (3). The RS232 version you ordered is not of much use for Netduino work. I would cancel your order if you can. The RS232 cable can be used for download with the Netduino Mini.

 

Serial RS232 and TTL are different protocols that are characterized by the logic state voltage. If you measure voltage with no transmission on a TTL TX line, it will be 5V corresponding a logic 1. For RS232, logic 1 will measure at about 2.7V or less. In most cases, USB to RS232 adapters do not conform to the RS232 standard. A further characterization is; TTL idles high and RS232 low..

 

Comment on Fritzing layout
==========================
Last post: Remove the blue wire. Netduino RX doesn't have anything to do with the BREAK.
Next to last post: Correct, but lose the RS232 adapter. See above comments. If you use it, you will need to add add a chip to invert TX and RX from/to the adapter.

 

I will try to dredge up my lost knowledge of Fritzing and try my hand at layout of the breadboard. This is turning into an intriguing problem.




#59149 NETMF SerialPort and "BreakState"

Posted by baxter on 10 July 2014 - 06:07 PM in Netduino Plus 2 (and Netduino Plus 1)

You are not going to be able to talk to the SRF01 from Netduino without the hardware break. I fired up Fritzing, made a schematic and connected the corresponding breadboard wires. The project is here,
https://www.dropbox....NXj2cVZn8bAJjYa

I am pretty sure it's correct, but no guarantees. Starting from a schematic, ratsnest wires are transfered back to the breadboard and you need to connect them up with wires. Fritzing is a work-in-progress and I find it very limited and cumbersome to use. I use Eagle Cad for all of my work.

 

In any case, you need to develop the capability to transfer a schematic to a breadboard. Here is a nice online free application for electronic design work,

http://easyeda.com/




#59155 Can anyone recommend a rock-solid LCD display?

Posted by baxter on 10 July 2014 - 11:38 PM in Netduino Plus 2 (and Netduino Plus 1)

I have been using the BPI-216N/L Serial Text LCD for years. The COM port interface is about as simple as you can get.
http://www.seetron.com/products.html
It's a bit pricey and you can get something better with a serial interface for about the same price (look under Intelligent Display modules),
http://www.4dsystems.com.au/products
http://www.4dsystems...brief_R_1_1.pdf

 

I have the older version of this module and it is a very readable display.




#59163 NETMF SerialPort and "BreakState"

Posted by baxter on 11 July 2014 - 09:01 AM in Netduino Plus 2 (and Netduino Plus 1)

Well I really can't  make out any thing out from your photo. I haven't tested the half-duplex circuit, but it may have problems operating at 3.3V due to the forward voltage drop through the diode and also the resistor value may need to be adjusted. I am pretty certain he designed the circuit for Arduino which has 5V I/O. I suggest you breadboard just the half-duplex circuit. You can then statically test it with your meter. Instantiate COM1 on Netduino and let it idle. You should measure 3.3V on TX and RX. Next, Connect TX and RX of Netduino to TX and RX of the interface circuit.

 

(1) Measure the interface TX/RX; it should be greater than 2.7V.
(2) Apply 0V(GND) to TX/RX. Measure RX; it should be less than 0.5V (0 to 0.5V)
(3) Apply 3.3V to TX/RX. Measure RX; it should be greater than 2.7V.
(4) Disconnect Netduino TX from TX interface. Apply 0V(GND) to TX interface. Measure TX/RX; it should be less than 0.5V (0 to 0.5V)

 

If your measurements do not conform to (1)-(4), then the circuit will not work with 3.3V. The TX line from Netduino will probably need to be level shifted to 5V before connection to the TX interface or the circuit modified.

 

I am more than happy to help you, but if you are just starting out, I would suggest buying a book such as this,
http://www.amazon.co...t/dp/0596153740
This is a very lucid starter book. You don't want to farm your project out to a consultant. Stick with it and you will learn a lot. This is a conceptually simple project; all you are trying to do is talk over a serial line. As I said before, the first step is to get the SRF01 working from your PC with the USB to serial adapter according to the web page instructions.

 

More on logic signal voltage levels:
http://www.allaboutc.../chpt_3/10.html




#59169 New Modules Seen in the Wild

Posted by baxter on 11 July 2014 - 09:27 PM in Netduino Go

 

Mine has sat unused in its box since I excitedly bought one when it first came out. I expect it to stay there.

Mine also 




#59180 NETMF SerialPort and "BreakState"

Posted by baxter on 12 July 2014 - 09:54 PM in Netduino Plus 2 (and Netduino Plus 1)

Success is sweet after a round of failures ...

 

My measurements with a BAT42 diode:

(1) Measure the interface TX/RX; it should be greater than 2.7V. ---> 3.0V
(2) Apply 0V(GND) to TX/RX. Measure RX; it should be less than 0.5V (0 to 0.5V) ---> 0.05V
(3) Apply 3.3V to TX/RX. Measure RX; it should be greater than 2.7V. ---> 2.9V
(4) Disconnect Netduino TX from TX interface. Apply 0V(GND) to TX interface.
     Measure TX/RX; it should be less than 0.5V (0 to 0.5V) ---> 0.03V

There is not a lot of margin on the high side when working with 3.3V, but enough.

 

Here is a Netduino VB 2010 simple serial text terminal I wrote to interact with something connected to the COM port. It's nothing fancy, but it works
https://www.dropbox....al Terminal.zip
You can translate it to C# with one of the online translators,
http://www.developer...t/vb-to-csharp/

 

You might consider the HC-SR04. It will probably be easier to work with than the SRF01 (no Break and no COM port, just an echo line)
https://www.dropbox..../HC-SR04_V1.zip
I translated the original C# to VB. The original link is in the program. I added some smoothing and statistics on the measurements.

 

I am glad that you are finally getting some hardware interaction. If nothing seems to work, it can lead to mountain of frustration.




#59260 NP2 Wireless Button/Switch

Posted by baxter on 16 July 2014 - 07:02 PM in Netduino Plus 2 (and Netduino Plus 1)

433 MHz
http://code.google.com/p/rc-switch/
http://www.amazon.co...r/dp/B00JL30QQU

If you need some intelligence at the remote end look at Pololu Wixels
http://www.pololu.com/product/1336

I have a pair of these and they work quite well up to about 50 ft.

This is a well regarded long range module,
http://shop.ciseco.c...le-xbee-shaped/
You can change the personality of the module by installing the appropriate firmware (Appendix 2: Dual Relay?)
http://openmicros.or...-llap-reference




#59272 NP2 Wireless Button/Switch

Posted by baxter on 17 July 2014 - 01:47 AM in Netduino Plus 2 (and Netduino Plus 1)

The Ciseco XRF has a 1km max range with the supplied whip antenna (300m with chip antenna). Other models with chip antenna are of the order of 100m (max). Cheap 433 MHz modules typically have 20-100m range (mostly toward the lower end) depending upon the power, antenna and obstructions.

 

Reading toward the bottom of the page, that Amazon combo has Specifications:
Transfers distance: 80m (100-200m to the max for open spaces)
Receiving distance: 200m (100-200m to the max for open spaces)
and also, the battery probably costs more than the combo.

Important Note: The remote control does not include battery because of the strict customs inspection. Please prepare a "23A 12V" battery for it. We appreciate your understanding and support. 

 

Edit: While looking at that page, I spotted another remote control (claims 100m),
http://www.amazon.co...13FQECK319ARBPC




#59283 How do I connect Netduino+ to a pc wireless?

Posted by baxter on 17 July 2014 - 05:34 PM in Netduino Plus 2 (and Netduino Plus 1)

I really think the key to getting these pocket routers to work is to assign fixed, but different IP addresses (outside of the main router DHCP range) and disable DHCP on both. The other important ingredient is to let the Edimax establish itself on the network before connecting the Netduino. Ping it and make certain it is in the ARP table. I also find that it works equally well with a network configured Plus 1 or Plus 2.




#59332 change ip address netduino

Posted by baxter on 21 July 2014 - 05:48 PM in General Discussion

Look under:

C:\Program Files(x86)\Microsoft .NET Micro Framework\v4.2\Tools\MFDeploy.exe




#59340 change ip address netduino

Posted by baxter on 22 July 2014 - 06:57 AM in General Discussion

Open MFDeploy --> Menu:Target --> Configuration --> Network --> Network Configuration --> fill in the blanks 

Attached Thumbnails

  • Network Configuration.JPG



#59355 Serial Issues

Posted by baxter on 23 July 2014 - 07:44 PM in Netduino Plus 2 (and Netduino Plus 1)

RS232 uses inverted logic; TX/RX idle logic low. Netduino COM ports idle high. Most PC serial ports are RS232 and they may or may not conform to the RS232 standard (+/- 12V). Measure the TX voltage on your PC serial port. If it is less than about 2.5V, then your problem is inverted logic. You can invert TX/RX with a 74LVC2G14 or a 74HC14 Schmitt trigger Inverter The simplest thing to do is just buy a USB to serial TTL adapter and forget the PC serial port.
 




#59359 How to control netduino plus 2 over the Internet

Posted by baxter on 23 July 2014 - 09:19 PM in Netduino Plus 2 (and Netduino Plus 1)

What about DynDNS,
http://dyn.com/support/wizard/

http://www.tp-link.u...icle/?faqid=297
I haven't used it for a while, but I set it up for a Netduino Plus 1. It's fiddly to get going from behind your router unless you have a smartphone (or use a neighbor's network). Most consumer routers do not have NAT loopback so testing needs to be done from a network external to your local network. Or, in my case, I used a spare router running DD-WRT with NAT loopback for local testing. DynDNS is no longer free, but there are other services.

 

I don't see that this poses a greater security risk than other traffic coming in through your ISP.




#59396 Netduino Unique ID

Posted by baxter on 25 July 2014 - 05:48 PM in Netduino 2 (and Netduino 1)

Assuming that the Netduino is part of some circuit, maybe you could use a 1-wire unique serial number,

http://www.maximinte...cts/DS2411.html




#59416 IE support with this forum software - copy and paste doesn't work

Posted by baxter on 27 July 2014 - 04:28 PM in Netduino Plus 2 (and Netduino Plus 1)

This has been frustrating for me also. Maybe it is both an IE11 and a Forum problem. If I login with Chrome, pasting this this message from Notepad into a  Reply box works just fine.




#59577 Serial port issues

Posted by baxter on 06 August 2014 - 02:29 AM in Netduino 2 (and Netduino 1)

You need to add,

using System.IO.Ports;




#59637 High Resolution Quad Encoder Problem

Posted by baxter on 09 August 2014 - 06:19 PM in General Discussion

I bought a couple of CY8CKIT-049-42xx for $4.00 ea,

http://www.cypress.com/?rID=92146

http://www.digikey.c...-42xx&x=14&y=16

I don't know if I will do any thing with PSoC, but the break-away USB-Serial Controllers will prove useful.




#59722 Netduino Plus 2 for $40

Posted by baxter on 14 August 2014 - 07:41 PM in Netduino Plus 2 (and Netduino Plus 1)

RETROSPARK promotional code doesn't work on this item. I just tried to buy it. The price is $50.




#59735 Netduino Mini $10

Posted by baxter on 16 August 2014 - 02:02 AM in Netduino Mini

Thanks ... Great price, bought one.




#59740 Servers Ultimate Pro Free Android App from Amazon

Posted by baxter on 16 August 2014 - 07:15 PM in General Discussion

Don't know much about it, but may be useful with a Plus 1 or 2.

http://www.amazon.co...e/dp/B00E00C70C
http://slickdeals.ne...free-on-amazon?




#59981 Safe code to convert byte[4] to float

Posted by baxter on 04 September 2014 - 01:06 AM in General Discussion

Here is some VB code to go from an IEEE 754 single to 4 bytes and back to a single. It is indeed the hard way to do it. I wrote this before the "unsafe" bitconverter appeared on the scene, but now use the unsafe BC and have never had problems with it.

Imports Microsoft.SPOT
Imports Microsoft.SPOT.Hardware
Imports SecretLabs.NETMF.Hardware
'Imports SecretLabs.NETMF.Hardware.NetduinoPlus
Imports SecretLabs.NETMF.Hardware.Netduino
Imports System.IO
Imports System.Text
Imports System.Collections
Imports System.Diagnostics
Imports System.Text.RegularExpressions
Imports System.Math

Module Module1

    Sub Main()  
        Dim buf() As Byte
        Dim sing As Single
        Dim svalue As Single = 44411.5625
        buf = SingleToFourByte(svalue)
        sing = FourByteToSingle(buf)
        Debug.Print("value - sing = " & (svalue - sing).ToString) '--> 0
    End Sub
End Module

    Public Function FourByteToSingle(ByVal ByteArray() As Byte) As Single

        Dim bin As String = String.Empty
        Dim denormalized As Boolean = False
        Dim exp, start, coeff As Integer
        Dim mantissa As String
        Dim sum As Double
        Dim TwoPow As Integer = 1
        Dim mult As Double = 1

        'Convert 4 byte array to binary in reverse order 
        '(assumes  given array came from a 32bit little-endian integer)
        '--------------------------------------------------------------
        For i As Integer = ByteArray.Length - 1 To 0 Step -1
            bin &= IntToBin(ByteArray(i))
        Next

        'Split apart the binary string. Assumes IEEE 754 single format
        '-------------------------------------------------------------
        Dim sign As Integer = If(bin.Chars(0) = "1", -1, 1) 'leading bit
        Dim expt As Integer = CInt(BinToInt(bin.Substring(1, 8))) 'biased exponent
        Dim fraction As String = bin.Substring(9)           'fractional part
        Dim TempFraction As Integer = CInt(BinToInt(fraction))    'integer for testing

        'Test for special cases (zero, denormalized, +/-infinity, NaN)
        'a good reference for thes cases: http://steve.hollasch.net/cgindex/coding/ieeefloat.html
        '----------------------------------------------------------------------------------------
        If (expt = 0 And TempFraction = 0) Then Return 0
        If (expt = 0 And TempFraction <> 0) Then denormalized = True
        If (expt = 255 And TempFraction = 0) Then Return CSng(If(sign = 1, 1 / 0, -1 / 0))
        If (expt = 255 And TempFraction <> 0) Then Return 0 / 0

        If (denormalized) Then
            exp = -126
            mantissa = fraction
            start = 0
            sum = 0
        Else
            exp = expt - 127
            mantissa = "1" & fraction
            start = 1
            sum = 1 'implied bit
        End If

        'Convert mantissa to single using double arithmetic to keep full precision
        '-------------------------------------------------------------------------
        For i As Integer = start To mantissa.Length - 1
            TwoPow = 2 * TwoPow
            coeff = If(mantissa.Chars(i) = "0", 0, 1)
            If (coeff = 0) Then Continue For
            sum = sum + 1.0 / TwoPow
        Next

        'scale the power of 2: 2^exp --> [(2^exp)*(10^-pow10)]*(10^pow10)
        '----------------------------------------------------------------
        'Constant to scale away exponent power of 2
        'log(2)/log(10) = 0.30102999566398119521373889472449
        'reqd power of 10 = (power of 2)*(log(2)/log(10))
        Dim ReqPowerOf10Const As Double = 0.3010299956639812

        Dim Pow10 As Integer = CInt(exp * ReqPowerOf10Const)
        Dim Pow2 As Integer = exp - Pow10 'reduce the power of 2 exponent [10^pow10 = (2^pow10)*(5^pow10)]
        mult = (2 ^ Pow2 / 5 ^ Pow10) * 10 ^ Pow10

        Return CSng(sign * sum * mult)
    End Function

    Public Function SingleToFourByte(ByVal singl As Single) As Byte()
        Dim byts(3) As Byte
        Dim test As UInt32 = CUInt(singl)
        Dim SingnOf As Integer = Sign(singl)                ' = -1 if negative
        Dim FracPart As Single
        Dim IntPart As UInt32 = CUInt(Floor(Abs(singl)))    'integer part
        FracPart = CSng(Abs(singl) - CSng(IntPart))         ' fractional part
        Dim FracPartBin As String = String.Empty
        Dim IntPartBin As String = String.Empty
        FracPartBin = DecFracToBin(FracPart)
        IntPartBin = DecIntToBin(IntPart)

        'Normalize
        Dim BinExpt As Integer = IntPartBin.Length - 1  'Highest bit set -1
        Dim Exponent As UInteger = CUInt(BinExpt + 127) ' Biased exponent
        Dim BiasedExpt As String = DecIntToBin(Exponent)

        'Remove most significant bit
        IntPartBin = IntPartBin.TrimStart({"1"c})
        'concatenate the mantissa and pad to 23 bits if necesary
        Dim Mantissa As String = IntPartBin & FracPartBin
        Dim LenMant As Integer = Mantissa.Length
        Dim Pad As String = String.Empty
        Do Until (LenMant = 23)
            Mantissa = Mantissa & "0"
            LenMant = Mantissa.Length
        Loop
        Dim IEEE754 As String = If((SingnOf = -1), "1", "0") & BiasedExpt & Mantissa
        Dim LenIEEE As Integer = IEEE754.Length
        Utility.InsertValueIntoArray(byts, 0, 4, BinToInt(IEEE754))
        Dim k As Integer
        Dim substr As String = String.Empty

        Return byts

    End Function

Function IntToBin(ByVal byt As Byte) As String
        'Convert a byte to a binary string 
        Dim temp As Byte = byt
        Dim binval As String = String.Empty
        Dim count As Integer = 0
        Do
            binval = CStr(temp Mod 2) & binval
            temp = CByte(temp \ 2)
            count += 1
        Loop Until count = 8 'pad leading zeros

        Return binval

    End Function

Public Function BinToInt(bin As String) As UInteger
        'Horner's method to evaluate polynomial
        '01110110 msb, msb-1, ... 0 (e.g. msb to lsb, left to right)
        Dim len As Integer = bin.Length
        Dim temp As UInteger = CUInt(If(bin.Chars(0) = "0", 0, 1))
        For i As Integer = 1 To len - 1
            temp = CUInt(temp * 2 + If(bin.Chars(i) = "0", 0, 1))
        Next
        Return temp
    End Function

Public Function DecFracToBin(frac As Single) As String
        Dim BinFrac As String = String.Empty
        Dim temp As Single
        Dim carry As Integer
        While frac <> 0
            temp = frac * 2
            carry = CInt(Floor(temp))
            BinFrac = CStr(carry) & BinFrac
            frac = temp - carry
        End While
        Return BinFrac
    End Function

    Function DecIntToBin(ByVal Intgr As UInteger) As String
 
        Dim temp As UInteger = Intgr
        Dim binval As String = String.Empty
        Dim count As Integer = 0
        Do
            binval = CStr(temp Mod 2) & binval
            temp = CUInt(temp \ 2)
            count += 1
        Loop Until (temp = 0)

        Return binval

    End Function




#60021 Getting started with Netduino Mini (early instructions)

Posted by baxter on 07 September 2014 - 06:21 PM in Netduino Mini

I would try to update your firmware. Select the TTL zip file since you haxe a TTL cable.
http://forums.netdui...-v420-update-1/




#60035 Getting started with Netduino Mini (early instructions)

Posted by baxter on 08 September 2014 - 01:50 AM in Netduino Mini

Did you first try to erase it by applying 5V to the gold ERASE pad? It's located at the top on the right hand side.
Flashing instructions after erasing are here toward the bottom of the page,
http://forums.netdui...-v420-update-1/




#60115 Netduino 2 and Dfrobot GSM/GPS Shield

Posted by baxter on 14 September 2014 - 06:25 PM in Netduino 2 (and Netduino 1)

I just bought a discounted Seeed Gprs at Radio Sack,
http://www.seeedstud...erface_Function
I now find that Seeed is selling a new model, but the basic functionality is the same as the old one.

 

The serial setup is different from yours, but I think they are doing the same thing. I have mine with the jumpers set to hardware. The shield is plugged in to the Netduino and Netduino is directly talking to the module via COM1. If you want to talk to the module from a PC terminal, configure yours for hardware, but don't plug it in to the Netduino.and take power externally. Then connect a USB-TTL cable to D0, D1 on the shield. The USB to RS232 cable you linked is wrong for this application.  You might look at these depending upon the versatility you want ( you can get a cheaper USB to TTL  adapter on ebay),

 

https://www.sparkfun.../products/12977

https://www.sparkfun.../products/11736

 

My driver in VB seems to working ok with simple commands,

        SeeedGprs.SendReceiveCmd("AT") 'can communicate
        Debug.Print("CmdSent: " & SeeedGprs.CmdSent)
        Debug.Print("CmdAnswer: " & SeeedGprs.CmdResponse)
        Thread.Sleep(400)
        SeeedGprs.SendReceiveCmd("AT+COPS?", , 400) 'Carrier info
        Debug.Print("CmdSent: " & SeeedGprs.CmdSent)
        Debug.Print("CmdAnswer: " & SeeedGprs.CmdResponse)
        Thread.Sleep(400)
        SeeedGprs.SendReceiveCmd("AT(+CSQ)") 'signal quality
        Debug.Print("CmdSent: " & SeeedGprs.CmdSent)
        Debug.Print("CmdAnswer: " & SeeedGprs.CmdResponse)


CmdSent: AT
CmdAnswer:  OK 
CmdSent: AT+COPS?
CmdAnswer: PS: 0,0,"T-Mobile"  OK 
CmdSent: AT(+CSQ)
CmdAnswer: OR 
 

To go much further, I need an activated SIM card. The phones I have use a micro SIM and these modules take a standard size. I guess the answer is to just use the carrier for a micro SIM in in an activation kit.

 




#60137 Windows Phone 8 and BLE

Posted by baxter on 18 September 2014 - 06:20 AM in General Discussion

If other people with 8.1 on their phone run into problems with BLE, it's likely because you have the developer version of 8.1 installed.

 

For now (not sure on long term here), the firmware won't deploy to Nokia devices running the developer version of 8.1. In order to get the firmware (which is required for BLE) you need to revert your device back and install the consumer 8.1.

 

Super inconvenient, sorry. But I want to make sure you have a workaround.

 

Pete

 

A bit off topic, but do you suppose that the following problem that I am having could be related to the developer version of 8.1. My 521 is unlocked, no SIM installed with Win 8.1.1 preview developer edition and is connected to my wireless network. If I type a known site such as Google or Yahoo into IE on the 521, the page display is nearly instantaneous so WiFi works just fine.

 

The problem is I have several devices on my network that are administered by web servers. If I type an IP address such as 192.168.0.166 to access the server it is necessary to login with a user name and a password. I can login from any computer on my network, but not with the Lumia 521. With the 521, the login page comes up and I enter the correct user/password, but it is always rejected.

 

I bought the Lumia 521 specifically to test login to the device servers from the Internet via DynDns. Port forwarding is setup correctly on my router. However, when I insert a T-Mobile SIm in good standing (wiFi, off) and issue <MyDevice>.dyndns.org:8080 from IE on the 521, the same thing happens; the login is rejected.





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.