Getting Started with the Internet of Things by Cuno Pfister
#21
Posted 21 September 2011 - 03:26 PM
#22
Posted 21 September 2011 - 07:56 PM
What firmware version do you use? I have heard of similar problems with DHCP, which could be solved using static IP addresses. Apparently should be corrected with newer (beta) firmware releases.Suggestions?
Best regards
Cuno
#23
Posted 21 September 2011 - 08:11 PM
#24
Posted 21 September 2011 - 08:12 PM
#25
Posted 21 September 2011 - 08:17 PM
#26
Posted 22 September 2011 - 06:05 PM
Hi,
is /has anyone else worked through this book yet?
Although it is quite well written with good examples, and I have learnt quite a bit about the netduino plus, I can't get past chapter 10 with the 'Hello Web' example. Is there any one else out there with the same issue?
Yours Simon M.
Not sure if this will help but my basic code that worked.
Also: Try this link at Pachube about projects that worked... http://community.pachube.com/forum/58
Simple code that worked for me
using System; using System.Threading; using Gsiot.PachubeClient; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.NetduinoPlus; // //// This code worked 9/14/11 // public class HelloPachube { public static void Main() { const string apiKey = "YOUR KEY here"; const string feedId = "YOUR feed number here"; const int samplingPeriod = 60000; // 60 seconds const double maxVoltage = 3.3; const int maxAdcValue = 1023; var voltagePort = new AnalogInput(Pins.GPIO_PIN_A1); var lowPort = new OutputPort(Pins.GPIO_PIN_A0, false); var highPort = new OutputPort(Pins.GPIO_PIN_A2, true); while (true) { WaitUntilNextPeriod(samplingPeriod); int rawValue = voltagePort.Read(); double value = (rawValue * maxVoltage) / maxAdcValue; string sample = "voltage," + " Test only"; //string sample = "Data," + value.ToString("f"); Debug.Print("new message: " + sample); PachubeClient.Send(apiKey, feedId, sample); } } static void WaitUntilNextPeriod(int period) { long now = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond; var offset = (int)(now % period); int delay = period - offset; Debug.Print("sleep for " + delay + " ms\r\n"); Thread.Sleep(delay); } } // I included the Gsiot.PachubeClient into my project. I used a Netduino Plus and ethernet. // As a note I did have a initial problem because I was getting an error from Pachube 404 or maybe 402.. // I was using the 'typed name' of my feedID when I should have been using the NUMBER!Good luck!
#27
Posted 24 September 2011 - 04:13 AM
Phil, I ran mine using the free relay site, yaler, and it worked pretty much first go. I have not tried a local only version just yet. If I get a chance I will try it out and let you know. I have a similar networking setup at home myself. I did give the NetDuino Plus a static ip address outside the dynamic range my router can use.
Did you have any issues running the "C:\Program Files\Microsoft .NET Micro Framework\v4.1\Tools\
MFDeploy.exe" tool ?
Phil, where are you at with this problem now ?
Were you able to get the MFDeploy tool to connect and successfully ping your NetDuinoPlus?
I have reserved an ip address on my router and permanently reserved it for the mac address of my NetDuinoPlus. It is inside the DHCP range set in my router.
Using the HelloWebHTML example from the book with only the RelayDomain and RelaySecretKey lines commented out I can connect directly to the static address I assigned. In this case http://192.168.1.101/hello.html and I get the expected web page containing only the "Hello Web at 01/01/2009 00:02:04 " message.
Let me know if you are still having issues or not.
- HawkGT likes this
#28
Posted 12 December 2011 - 01:25 PM
#29
Posted 25 December 2011 - 07:30 AM
#30
Posted 03 May 2012 - 04:42 AM
#31
Posted 22 May 2012 - 02:13 PM
Unfortunately, things keep changingSo I've gotten up to the HelloPachube portion of GSIOT, and found that the account/feed setup on Pachube no longer matches the description in the book at all. I tried to make best guesses when setting everything up, but I've apparently not done it correctly - HelloPachube kicks back 403 (forbidden) errors on every attempt to post data.
One of the things - and maybe this is the only thing hanging me up - is that while GSIOT talks about finding a "private master API key", I can find no mention of that at all. I tried setting up a "secure sharing" key and using that, but I'm thinking it's not the right tool for the job.
Any suggestions?
Thanks,
- Chip
I've tried to use my old GSIoT test feed, and it still works. I then created a completely new account, and created a "secure sharing key" and used that for a new feed. I felt a bit disoriented for a while on the Cosm Web site, but it finally worked:
blog post
If this still does not work, maybe you could try my diagnostic program at http://www.gsiot.inf...ip?t=1309432158
to find out whether you can actually access servers outside of your local network at all.
Cuno
#32
Posted 24 July 2012 - 12:18 AM
Using the HelloWebHTML example from the book with only the RelayDomain and RelaySecretKey lines commented out I can connect directly to the static address I assigned. In this case http://192.168.1.101/hello.html and I get the expected web page containing only the "Hello Web at 01/01/2009 00:02:04 " message.
Thank you so much for that tip! I was just trying the network address (http://192.168.1.101) but omitting the hello.html portion. Somehow I missed that bit from the description given in the book. So thank you for this post; I only wasted one day trying to figure out where I had gone wrong.
#33
Posted 05 February 2013 - 10:55 PM
I am trying to run the HelloWeb example from "Getting Started With The Internet of Things".
Everything compiles and runs, and I get "Base Uri: http://192.168.1.33//" (I'm running on my local network).
When I try to access the server from Chrome or IE nothing happens and I get debug ouput:
#34
Posted 06 February 2013 - 05:59 PM
Any ideas what might be going wrong?
In the current version of Gsiot.Server, there is a bug that prevents you from using it on the local network. It should work with Yaler, though.
I'll put together a new version of Gsiot.Server before the end of the month, at http://www.gsiot.info/download/. As a quick fix, you may make the following changes to Gsiot.Server.cs, i.e., comment out the green line:
public void
Open()
{
Contract.Requires(!IsOpen);
// default configuration for the book - must be removed for use on devices without Ethernet:
StreamListener = new EthernetStreamListener();
[color=rgb(0,128,0);]// comment out this line StreamFactory = new EthernetStreamFactory();[/color]
Note that then Yaler will not work.
Does this help?
Best regards
Cuno
#35
Posted 06 February 2013 - 07:12 PM
Thanks Cuno,
The quick fix worked for HelloWeb and VoltageMonitor. I'm now moving on to the rest of the examples. I'm really enjoying your book! I'll look forward to any future updates.
Thanks again,
Paul
#36
Posted 06 February 2013 - 09:12 PM
Thanks Cuno,
The quick fix worked for HelloWeb and VoltageMonitor. I'm now moving on to the rest of the examples. I'm really enjoying your book! I'll look forward to any future updates.
Thanks again,
Paul
Glad to hear
#37
Posted 22 February 2013 - 10:22 PM
In the current version of Gsiot.Server, there is a bug that prevents you from using it on the local network. It should work with Yaler, though.
I'll put together a new version of Gsiot.Server before the end of the month, at http://www.gsiot.info/download/. As a quick fix, you may make the following changes to Gsiot.Server.cs, i.e., comment out the green line:
public void
Open(){
Contract.Requires(!IsOpen);// default configuration for the book - must be removed for use on devices without Ethernet:
StreamListener = new EthernetStreamListener();
[color=rgb(0,128,0);]// comment out this line StreamFactory = new EthernetStreamFactory();[/color]
Note that then Yaler will not work.
Does this help?
Best regards
Cuno
This fix also worked for me, I had the same exact problem as Capt Paul.
I'd like to say I am also enjoying your book, very informative.
I'd like to ask a question, is there a way to serve up files from an SD card using GSIOT.server?
Regards,
Edmond
#38
Posted 23 December 2013 - 05:55 PM
Cuno or somebody please help..
I am using your gsiot library with np2 and i noticed packet fragmentation that slows web page rendering, i used wireshark and
saw max packet size 128 byte. There is no router between.
How to prevent packet fragmentation?
How to change mtu packet size?
hi from Croatia..
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users