i want to call a webpage from my FezPanda (issue a GET request to a url).
I’ve developed some basic app’s from Visual Studio 2010 (.Net MF 4.18) so i know my Fez board is working.
What i want to do now is to send a GET request to a webpage/url, but i can’t get it to work.
I’ve read that you should configure the network settings first, via the MFDeploy tool. But, when connected in the MFDeploy tool, when i select the menu option to open that window, i get an error (invalid configuration) from the MFdeploy tool.
So now i’ve tried to setup the network settings myself, with the code from the ‘internet book of things’ (the example where you host a socket listener / webserver on the Fez.)
But this didn’t work either: when i want to read the content of the response of the HttpWebClient ( or the WebClient) i get a ‘NotSupportedException’.
But i don’t know what is not supported?
I’ve read that it is the DNS resolver giving me a problem, but i also tried a piece of code (man did i try a lot of code examples…) where the DNS was set on a different way and it could actualy resolve the IPAddres of the url, but i got the same notsupportedexception.
I’ve also seen an example which sends an email via a socket connection, but i did not understand enough of it to rewrite it that the code would send a GET request and not some mail commands…
Can anyone proivde me with some sample code?
I also reflashed the FEZ but the MFeploy still didn’t let me open up the network settings (and besides that, it struck me as weird that i had to use an external tool to setup the network parameters, that i can not do it from code?)
[quote]I’ve read that you should configure the network settings first, via the MFDeploy tool. But, when connected in the MFDeploy tool, when i select the menu option to open that window, i get an error (invalid configuration) from the MFdeploy tool.
[/quote]
That is the case on everything except panda, which has limited virtual stack that is built in C# to use Wiznet chipset.
[quote]So now i’ve tried to setup the network settings myself, with the code from the ‘internet book of things’ (the example where you host a socket listener / webserver on the Fez.)
But this didn’t work either: when i want to read the content of the response of the HttpWebClient ( or the WebClient) i get a ‘NotSupportedException’.
[/quote]
The examples as is give exception? They should run fine if not modified.
The book you are using has many examples and there are more on codeshare but I recommend the book fist as it is targeted for your setup.
[quote]I also reflashed the FEZ but the MFeploy still didn’t let me open up the network settings (and besides that, it struck me as weird that i had to use an external tool to setup the network parameters, that i can not do it from code?)
[/quote]
MFDeploy does not work with panda, beside fro ping and check firmware version.
The question is, how are you connecting your panda to the network? Do you own a FEZ Connect (discontinued product)?
i’m using 4.18
I think i’ve read that my device is too old to be updated to version 4.2
(GHI Electronics – Where Hardware Meets Software):
USBizi (panda/domino): 4.1 and undecided on 4.2 support
I’m using the firmware which was installed on my disk by the SDK.
I’ve executed most of the examples from ‘the internet of things’
@ Gus -
Thanks for letting me know the MFDeploy does not work, that wil save me hours of retrying tonight
To be more clear about the example: the example itself from ‘the internet of things’, namely the hosting of the webserver, works as a charm.
The Fez acts as a webserver and i can connect to it on my local LAN from my PC.
About connecting to the ‘outside world’: i’ve read the book ‘the internet of things’ back and forward, but i couldn’t find an example to issue a GET request to an external server, did i overlook anything?
The only example i saw was about sending an email, but that was via a socket and as i wrote earlier i could not get that rewritten to issue a GET request to and external server
@ Architect -
I was crossing fingers, hopes were up and all sort of things… but unfortunately no luck.
It did however produce the same error as yesterday.
I did notice however that 4.18 as versionumber which is mentioned was not the correct, you can see the right versions in the output.
One thing about the code: the was one small compile issue, i had to provide a hostname to this line of code: Dhcp.EnableDhcp(mac);
I changed it to: Dhcp.EnableDhcp(mac,“”);
The debug output:
Rebooting…
Create TS.
Loading start at 4eb34, end 56d0c
Attaching file.
Assembly: mscorlib (4.1.2821.0) (3880 RAM - 33236 ROM - 19134 METADATA)
Loading Deployment Assemblies.
Attaching deployed file.
Assembly: Microsoft.SPOT.IO (4.1.2821.0) (740 RAM - 4620 ROM - 2522 METADATA)
Assembly: Microsoft.SPOT.Net.Security (4.1.2821.0) (264 RAM - 1220 ROM - 606 METADATA)
Assembly: Microsoft.SPOT.Net (4.1.2821.0) (704 RAM - 5060 ROM - 2452 METADATA)
Attaching deployed file.
Assembly: System.Http (4.1.2821.0) (2976 RAM - 38160 ROM - 12831 METADATA)
Assembly: GHIElectronics.NETMF.Hardware (4.1.8.0) (1268 RAM - 8732 ROM - 5109 METADATA)
Assembly: Microsoft.SPOT.Hardware (4.1.2821.0) (1752 RAM - 11440 ROM - 7371 METADATA)
Assembly: FEZ Panda II Application (1.0.0.0) (484 RAM - 2704 ROM - 1030 METADATA)
Assembly: GHIElectronics.NETMF.W5100.Dhcp (4.1.8.0) (448 RAM - 4936 ROM - 1093 METADATA)
Assembly: System (4.1.2821.0) (872 RAM - 5992 ROM - 3206 METADATA)
Assembly: System.Net.Security (4.1.2821.0) (664 RAM - 4544 ROM - 1943 METADATA)
Assembly: Microsoft.SPOT.Native (4.1.2821.0) (1144 RAM - 6516 ROM - 4479 METADATA)
Assembly: FEZPanda_II_GHIElectronics.NETMF.FEZ (4.1.8.0) (304 RAM - 904 ROM - 495 METADATA)
Assembly: GHIElectronics.NETMF.W5100 (4.1.8.0) (1028 RAM - 11556 ROM - 4106 METADATA)
Assembly: GHIElectronics.NETMF.System (4.1.8.0) (488 RAM - 2496 ROM - 1465 METADATA)
Total: (14836 RAM - 142116 ROM - 67842 METADATA)
The debugging target runtime is loading the application assemblies and starting execution.
Ready.
@ Architect - When i remove the System.Http reference, the using System.Net; can not be found, and from that missing using, the HttpWebRequest can not be found…
when i add only the usings from the code example
using System;
using System.IO;
using System.Text;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.FEZ;
using GHIElectronics.NETMF.Net;
using GHIElectronics.NETMF.Net.NetworkInformation;
You made me, and my wife who had to put up with me being grumpy very happy!
It was this reference which i was missing:
GHIElectronics.NETMF.W5100.Http
And normally i’m a big fan of resharper, but this time it was too eager to satisfy my needs, because when it saw a webrequest defined, it immediately suggested the System.Http.
And me, being happy that the object was found, accepted the suggestion, and so that reference cam into my project, and i did not see any need to look further for another dll for another webrequest class.
Thank you VERY much for all the effort you spent on my question!