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.

Hans75's Content

There have been 12 items by Hans75 (Search limited from 21-April 23)


By content type

See this member's

Sort by                Order  

#32141 webservice?

Posted by Hans75 on 17 July 2012 - 01:23 PM in Netduino Plus 2 (and Netduino Plus 1)

HTTPClient is a typo on my part, it should be HTTP_Client.

Also the IntegratedSocket creator is wrong it should be:

new IntegratedSocket("http://xxx", 80)

//not 

new IntegratedSocket("http://xxx, 80")

Probably should proof posts more whilst i am at work :P

Nak.


Thanks anyway.. otherwise i wouldn learn anything., its always the debugging process where you pick up most ofthe knowledge ;-)
the quote error was easy to find... but i got lost in the integratedsocket.. but found out i can live without it completely, just passing the URL.. (dont ask me why ;-))



#32140 webservice?

Posted by Hans75 on 17 July 2012 - 01:18 PM in Netduino Plus 2 (and Netduino Plus 1)

And Integratedsocket renamed itself into SimpleSocket?


Got it Working!... thanks again a step furtter... now i can log data and communicate to my own asp.net webservice,

HTTP_Client WebSession = new HTTP_Client("myrestwebserviceurl");
// Requests the latest source
HTTP_Client.HTTP_Response Response = WebSession.Get("/Service1.svc/pooldata/2");
if (Response.ResponseCode != 200)
{
Debug.Print("Invalid Response");
}
R = Response.ToString();
Debug.Print(Response.ResponseCode.ToString());
Debug.Print®;



#32135 webservice?

Posted by Hans75 on 17 July 2012 - 12:40 PM in Netduino Plus 2 (and Netduino Plus 1)

Interesting, I can't recall I renamed that class once. But it should be HTTP_Client indeed.


And Integratedsocket renamed itself into SimpleSocket?



#32133 webservice?

Posted by Hans75 on 17 July 2012 - 12:29 PM in Netduino Plus 2 (and Netduino Plus 1)

Check that inbound port 80 is allowed, outbound port 80 is always open, but inbound is nearly always closed unless you have explicitly opened it.
Where is the computer located that you are trying to connect to?

If you want a simple to use HTTP client for your netduino i would recommend the one in Stefan's netmf toolbox. Then you can use simple code like this:



using System;
using System.IO.Ports;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using Microsoft.SPOT.Net.NetworkInformation;
using SecretLabs.NETMF.Hardware.NetduinoPlus;
using Toolbox.NETMF.NET;
namespace HTTPClient {
 public class Program {
  var webClient = new HttpClient(new IntegratedSocket(http://xxx, 80));
  var response = webClient.Get("/Pool/add?a=1&b=4");
  if(response.ResponseCode != 200) {
	Debug.Print("Invalid Response");
  }
  Debug.Print(response.ResponseBody);
  Thread.Sleep(Timeout.Infinite);
 }
}

Nak.


I still have the same issue::
using System;
using System.IO.Ports;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using Microsoft.SPOT.Net.NetworkInformation;
using SecretLabs.NETMF.Hardware.NetduinoPlus;
using Toolbox.NETMF.NET;

namespace HTTPClient {

public class Readservice {
public static void Main()
{
var webClient = new HttpClient(new IntegratedSocket("http://xxx, 80"));

it cant find HttpClient!
Error 1 The type or namespace name 'HttpClient' could not be found (are you missing a using directive or an assembly reference?)
Error 2 The type or namespace name 'IntegratedSocket' could not be found (are you missing a using directive or an assembly reference?) E:\VS2010\Netduino\georgiposted\Readserver.cs

in the Toolbox.NETMF.NET there is a only a Http_Client...



#32092 webservice?

Posted by Hans75 on 17 July 2012 - 06:54 AM in Netduino Plus 2 (and Netduino Plus 1)

That's pretty much all their is to it, however that snippet you posted is using port 81 not port 80.

Also have you opened the relevant ports on your windows firewall?

By default you need to allow all traffic on port 80 (for http) to your windows box for your web service to connect

Nak.


guess port 80, for http, is always open.. thats not my issue...
i am struggling and confused with all the drivers/dll to be used, and how they relate to each other..
System.Net, System.Net.Sockets System.Threading Microsoft.SPOT Microsoft.SPOT.Hardware, SecretLabs.NETMF.Hardware SecretLabs.NETMF.Hardware.NetduinoPlus?

i was getting close.. i get the message that .GetResponse is not recognized.. and should be .GetBeginResponse which, after googling, opened a few pages of additional code i dont understand.



#32032 webservice?

Posted by Hans75 on 15 July 2012 - 12:05 PM in Netduino Plus 2 (and Netduino Plus 1)

BTW, you could call the RESTful web service like this from the Netduino:

  HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("http://xxx:81/Pool/add?a=1&b=4");
  myReq.Method = "GET";
  HttpWebResponse WebResp = (HttpWebResponse)myReq.GetResponse();


Does anyone have an complete example of this?.. I cant get it to work..(been fiddling all weekend..), managed to get a REST webservice on asp.net up and running,
but cant read it with my netduino.



#31701 LCD support

Posted by Hans75 on 07 July 2012 - 11:12 AM in Visual Basic Support

It worked!.. thanks again



#31503 LCD support

Posted by Hans75 on 02 July 2012 - 06:24 PM in Visual Basic Support

Thanks a lot very much. will certainly give it a try... :-)



#31404 LCD support

Posted by Hans75 on 01 July 2012 - 10:30 AM in Visual Basic Support

This is the way to connect it:
http://arduino.cc/en...l/LiquidCrystal

Thanks a lot.. i think, thats what i am looking for..

The LCD driver also has another provider included for GPIOs as well, have you found that one?

have no clue what you mean... i am completely new to arduino's and netduino's. so please forgive me..



#31366 LCD support

Posted by Hans75 on 30 June 2012 - 02:02 PM in Visual Basic Support

It's possible to do it without shift register, just another schematic and uses more pins.


do you have link where to find this?..



#31322 LCD support

Posted by Hans75 on 29 June 2012 - 10:26 AM in Visual Basic Support

Hi and welcome to the forums!


At this moment there are no VB drivers available, or at least not from me.
But the C# drivers can be used in VB. See more about that at http://forums.netdui...ivers-in-vbnet/


thanks.. that should shall and will work indeed..
too bad, i didnt realize i needed that shift register chip for the lcd...,



#31319 LCD support

Posted by Hans75 on 29 June 2012 - 06:17 AM in Visual Basic Support

thanks very much... this is great stuff... I just got my NetduinoPlus, and just joined this forum searching for some good examples, to get components connected and interacting.. I am still struggling with my "LCD 16x2", which is still a mystery to me.. you have some good advice or drivers for that too?




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.