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

How to deploy over COM


  • Please log in to reply
24 replies to this topic

#1 BanksySan

BanksySan

    Member

  • Members
  • PipPip
  • 28 posts
  • LocationBristol, United Kingdom

Posted 19 April 2012 - 08:34 PM

Hia all, I want to try the USB communications examples, however it seems I have to deploy over COM for this. I haven't got a clue where to start here and there seems to be little information on how it's done. Could anyone point me in the right direction? Thanks all. Dave

#2 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 20 April 2012 - 06:04 AM

I want to try the USB communications examples, however it seems I have to deploy over COM for this.

I haven't got a clue where to start here and there seems to be little information on how it's done. Could anyone point me in the right direction?

There is a thread here if you want to switch to serial deploy to try out the USB HID method of USB communication.

If you want to use serial comms via USB then you do not need to change this. To do this you need a USB->Serial FTDI board or cable. These are relatively cheap and Proto-Pic stock both boards and cables. I use one of these to talk to the Netduino Mini - in this case I bought the 3.3V cable. These just appear as a COM port on the PC.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#3 BanksySan

BanksySan

    Member

  • Members
  • PipPip
  • 28 posts
  • LocationBristol, United Kingdom

Posted 20 April 2012 - 10:01 AM

Hi Mark, Thanks for replying. OK, if I understand correctly. I buy a serial to USB cable, download the MFDeploy (Extra) and use it to change the deployment mechanism. Plug the COM port to the USB on the Netduino, change VS2010 deployment options and go? When it's deployed I can plug the USB back in and debug etc with it? Thanks Dave

#4 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 20 April 2012 - 10:12 AM

I buy a serial to USB cable, download the MFDeploy (Extra) and use it to change the deployment mechanism. Plug the COM port to the USB on the Netduino, change VS2010 deployment options and go?

When it's deployed I can plug the USB back in and debug etc with it?


If you go down the serial deployment route then your debugging is also performed by serial. You will be using the USB as a HID device to talk to the application.

Unless I was specifically targeting a HID application, I'd probably keep the deployment transport as is and use the USB to serial lead to enable serial comms with the application. So, I'd be deploying and debugging by USB and then communicating by serial.

regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#5 BanksySan

BanksySan

    Member

  • Members
  • PipPip
  • 28 posts
  • LocationBristol, United Kingdom

Posted 20 April 2012 - 11:49 AM

Cheers Mark, Yes, I am planning a HID application (http://forums.netdui...top-gui-client/). I want to do away with the TCP/IP comms it's currently using. Problem is, I only just saw the TLA, HID and whilst I know what a serial port is (in that I can point to it on my machine) I have no idea what the practicalities or implications are of deploying using it.

#6 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 20 April 2012 - 11:57 AM

Problem is, I only just saw the TLA, HID and whilst I know what a serial port is (in that I can point to it on my machine) I have no idea what the practicalities or implications are of deploying using it.

Main implication I have seen is speed. USB seems faster. I have a N+ and a Mini and deployment over USB is faster with the N+ than over serial with the Mini.


Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#7 BanksySan

BanksySan

    Member

  • Members
  • PipPip
  • 28 posts
  • LocationBristol, United Kingdom

Posted 20 April 2012 - 01:23 PM

Main implication I have seen is speed. USB seems faster. I have a N+ and a Mini and deployment over USB is faster with the N+ than over serial with the Mini.


Regards,
Mark


Dev-wise, do I still get all my debugging functionality? i suppose I'd either have to connect to the process in VS2010, or do I need to reserve some pins for debugging... or do I have to hack something else together?

Cheers

Dave

#8 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 20 April 2012 - 04:42 PM

Dev-wise, do I still get all my debugging functionality? i suppose I'd either have to connect to the process in VS2010, or do I need to reserve some pins for debugging... or do I have to hack something else together?

Not done this on the N+ but on the Mini you just tell VS to deploy by serial and you also get to debug by serial as well. No hacking etc. required. I cannot imagine that there would be anything different on the N+.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#9 BanksySan

BanksySan

    Member

  • Members
  • PipPip
  • 28 posts
  • LocationBristol, United Kingdom

Posted 23 April 2012 - 10:10 AM

Hi Nevyn, Thanks for all the advise. Just one more question, I think. Assuming I buy a USB to COM converter, and then deploy over COM, as far as the N+ is concerned I'm still using the USB port for deployment, and I want to communicate over it (and debug, if possible). So I assume I'd unplug the COM and plug the USB -> USB back in after deployment? Once I've done that (if I'm supposed to do that) how do I attach the debugger to the N+?

#10 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 23 April 2012 - 04:29 PM

Hi Nevyn,

Thanks for all the advise. Just one more question, I think.

Assuming I buy a USB to COM converter, and then deploy over COM, as far as the N+ is concerned I'm still using the USB port for deployment, and I want to communicate over it (and debug, if possible). So I assume I'd unplug the COM and plug the USB -> USB back in after deployment?

Once I've done that (if I'm supposed to do that) how do I attach the debugger to the N+?

There are two scenarios for using the USB connector on the Netduino:
- Deployment and debugging
- HID device

USB for deployment and debugging
In this scenario you will be unable to deploy and debug using the USB connector AND have a HID device over USB. This is how the deployment works at the moment.

Use USB connector for HID application
You now dedicate the USB connector for HID communication between the Netduino and your application. You change the settings on the Netduino to tell it to accept deployment and debug commands over serial. You also change your settings in Visual Studio to deploy and debug over serial. The FTDI board effectively converts one of your USB ports on your PC into a COM port.

Personally, I'd look at how much data is being transferred and if it is reasonable then I'd look at using serial to communicate with the PC application. I've done this in the past (using Bluetooth) and it works fine. This has the advantage that you do not need to worry about changing deployment methods etc.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#11 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 23 April 2012 - 11:54 PM

Hey Banksy

Notice you put Brizzletown down as you location, Maplins by the arches had some quote cheap usb to rs232 conververters last time i was in approx ~£10 for a dual port one, so might be worth a look

I can also recommend these leadsif you want a general purpose rs232 ports (i use the quad port one daily at work for everything from from flashing and driving POS printers, to doing direct TTL flashing of various MCU's, seems to have avoided the usual trap with these usb to rs232 leads of not providing enough voltage to flash properly.

If you go for the RS232 DB9 sockets make sure you get some Female DB9 sockets then you can solder on some wires (i find a bit of CAT5 network cable make a perfect lead) and either poke into the socket or if you plan on making a lot of use of the com interface (and your previous posts make me think you will if you want to do USB HID stuff) then making up a plug to go on the other end with some of these and some of these works very well (if you buy a crimper as well saves you a fortune in jump leads for bread boarding as well as you can use cheapo non solid core wire and just crimp a male plug on the end and get perfect connections everytime...)

#12 BanksySan

BanksySan

    Member

  • Members
  • PipPip
  • 28 posts
  • LocationBristol, United Kingdom

Posted 24 April 2012 - 10:43 PM

Nice one, aye I know that Maplins, seems they charge £20 now. I have, however, just bought a bunch of stuff from Amazon.

Would this fit the bill? USB to Serial Cable and USB Adapter.

#13 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 25 April 2012 - 06:35 AM

Would this fit the bill? USB to Serial Cable

Bear in mind that if you buy this adapter you then need to get a serial to TTL convertor. I think in one thread you have looked at a USB to TTL convertor (i.e. FTDI). So this gives two options:

- USB to serial plus a serial to TTL convertor.
- USB to TTL convertor plus a USB lead (if you are lik me you have plenty of leads around the place)

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#14 lor3

lor3

    Member

  • Members
  • PipPip
  • 12 posts

Posted 19 November 2012 - 05:42 PM

Is there an updated MFDeploy+ that uses the new WinUsb drivers? I would just use the NetMF ones but they don't seem to work on Windows 8!

#15 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 November 2012 - 06:43 PM

Hi lor3,

Is there an updated MFDeploy+ that uses the new WinUsb drivers? I would just use the NetMF ones but they don't seem to work on Windows 8!

The MFDeploy in the .NET MF 4.2 QFE2 SDK works with WinUSB drivers under Windows 8.

The WinUSB driver links are configured by the Netduino 4.2.1 SDK installer.

Chris

#16 lor3

lor3

    Member

  • Members
  • PipPip
  • 12 posts

Posted 19 November 2012 - 06:47 PM

Hi Chris, But the MFDeploy that comes with the SDK doesn't have the Deployment Transport in the configuration menu as far as I can see. Am I missing something obvious? I'm wanting do deploy via COM by the way (using netmf 4.2).

#17 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 November 2012 - 07:03 PM

Hi lor3,

But the MFDeploy that comes with the SDK doesn't have the Deployment Transport in the configuration menu as far as I can see. Am I missing something obvious? I'm wanting do deploy via COM by the way (using netmf 4.2).

Oh, sorry, I misunderstood the question. I haven't used COM deployment in NETMF 4.2, but I'm not aware of any reason why it wouldn't work. If it doesn't work for you, we definitely want to add support.

Can you try adding SecretLabs.NETMF.Diagnostics.dll as a reference to your project? And then running the following line of code (deployed via WinUSB)?

SecretLabs.NETMF.Diagnostics.Transport.SetInterface(TransportInterface.Com1);
Chris

#18 lor3

lor3

    Member

  • Members
  • PipPip
  • 12 posts

Posted 19 November 2012 - 08:07 PM

Can you try adding SecretLabs.NETMF.Diagnostics.dll as a reference to your project? And then running the following line of code (deployed via WinUSB)?

SecretLabs.NETMF.Diagnostics.Transport.SetInterface(TransportInterface.Com1);
Chris


Done this, the N+ now has the ethernet lights and the blue LED flashing every 5 seconds and the USB device isn't recognised. I'm using a 3.3V TTL <-> Usb cable plugged into D3/4 (and ground), tried swapping the two around in case I had RX/TX the wrong way around but am unable to ping with MfDeploy either way.

#19 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 November 2012 - 09:18 PM

Hi lor3,

Done this, the N+ now has the ethernet lights and the blue LED flashing every 5 seconds and the USB device isn't recognised. I'm using a 3.3V TTL <-> Usb cable plugged into D3/4 (and ground), tried swapping the two around in case I had RX/TX the wrong way around but am unable to ping with MfDeploy either way.

If USB is not recognized, that's a good thing. That means the transport has been moved.

Pins D3/D4 are SPI and PWM pins. Please try plugging your TTL->USB cable into pins D0/D1, for COM1.

COM1 = D0/D1
COM2 = D2/D3
COM3 = D7/D8 (Netduino Plus 2 + Shield Base only)
COM4 = SDA/SCL (Netduino Plus 2 only)

Does that get you connected alright?

Chris

#20 lor3

lor3

    Member

  • Members
  • PipPip
  • 12 posts

Posted 19 November 2012 - 10:18 PM

Does that get you connected alright?


Well it helps if the test program doesn't use the COM :-) I've managed to get a response in MFDeploy via serial but it just seems to be resetting constantly. This is the serial output:

DM9161_AutoNegotiate
Valid PHY Found: 31
PHY: Vendor Number Model = 0xA
PHY: Model Revision Number = 0x0
DM9161_DSCSR = 0xF3F0
DM9161_BMCR = 0x3100
DM9161_DSCR = 0x414
Error: AutoNegotiate TimeOut
PHY AutoNegotiate ERROR!
ip address from interface info: 192.168.5.100
.NetMF v4.2.0.0
NetduinoPlus, Build Date:
        Sep 19 2012 17:01:50
ARM Compiler version 410894

TinyCLR (Build 4.2.0.0)

Starting...
Created EE.
Started HasÀ0¼qðCreate TS.
 Loading start at 1542e0, end 16c5dc
   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: SecretLabs.NETMF.Diagnostics (4.2.0.0)
Loading Deployment Assemblies.
Attaching deployed file.
   Assembly: NetduinoApplication1 (1.0.0.0)
Attaching deployed file.
   Assembly: SecretLabs.NETMF.Hardware.NetduinoPlus (4.2.0.1)
Resolving.
Ready.

Then reset. The code is just:

Transport.SetInterface(TransportInterface.Com1);
Thread.Sleep(Timeout.Infinite);





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.