Digistump Forums

The DigiX => DigiX Support => Topic started by: rholt on August 12, 2014, 08:18:08 pm

Title: Digifi ServerExample - Error Connecting to Nework
Post by: rholt on August 12, 2014, 08:18:08 pm
Below is a bit of generic code to get the Digix to connect to the Server.
I had this running a few weeks ago on two different Digix boards, but the two I have now are bringing me no joy.
I've gone thru the DigiFi Tutorial instructions several times and my notebook & phone can see the setup site, and I've gone thru the setup a few times, making sure no security has been set up.
Still, when I run this code, and enter a letter into the Serial Monitor, all i get is: "Error connecting to network."
Hopefully someone will push me in the right direction & I'll get to move forward tomorrow while I'm @ work.

btw... exactly how do you insert a picture on these postings? I see the icon & when I click on it I get the :
"(http://)" thing, but then what, I've tried dragging a JPG file inbetween the tags, and also copy/paste, but both procedures don't seem to work. I want to start documenting my posts more accurately.

thanks in advance,
Russ from Coral Springs, Fl.


Code: [Select]
/* rjh - this program runs - you must open the http site using the port extension
i.e in the chrome address use: 192.168.100.14:8080
this will bring you to the page that the server has created and
type in the message being sent. */

#include <DigiFi.h>
DigiFi wifi;

void setup()
{
  Serial.begin(9600);
  wifi.begin(9600);

  //DigiX trick - since we are on serial over USB wait for character to be entered in serial terminal
  while(!Serial.available()){
    Serial.println("Enter any key to begin");
    delay(1000);
  } // End While
  Serial.println("Starting");

  while (wifi.ready() != 1)
  {
    Serial.println("Error connecting to network");
    delay(5000);
  } // End While

  Serial.println("Connected to wifi!");
  Serial.print("Server running at: ");
  String address = wifi.server(8080);//sets up server and returns IP
  Serial.println(address);

} //End Setup

void loop()...
(http://)
Title: Re: Digifi ServerExample - Error Connecting to Nework
Post by: defragster on August 12, 2014, 09:08:31 pm
Pictures seem to be by reference...  The have to exist at a url?
http://wiki.simplemachines.org/smf/Basic_Bulletin_Board_Codes (http://wiki.simplemachines.org/smf/Basic_Bulletin_Board_Codes)
This seems to show an img example.
I've found i could upload an image but then i don't see how to link it
Title: Re: Digifi ServerExample - Error Connecting to Nework
Post by: gogol on August 12, 2014, 11:59:47 pm
You need to add the picture as attachment, that is currently the only way, to get an picture into the forum.
(In that thread I have add several attachments: http://digistump.com/board/index.php/topic,1455.0.html)  They will always be at the end of your post.
When you wish to include pictures with the img-tag and if you have no webspace available, you can also do the following trick:  Upload a picture into the right category of the wiki, without linking it there to an article.  You can than reference it with the image tag.
I prefer this method over using some image-space providers, where images will disappear some weeks later, leaving articles with black/white error messages instead of meaningful images.



To your problem: Is the Wifi-Enable jumper connected?
Which IDE version and board layout you are using?
Title: Re: Digifi ServerExample - Error Connecting to Nework
Post by: rholt on August 13, 2014, 01:26:16 pm
Gogol - thanks for the advice on pic's.
IDE version: 1.5.6-r2
board layout: Digistump DigiX (standard)

below is what I have for settings on the DigiX Server:
(http://digistump.com/wiki/?ns=digix%3A&image=digix%3Asystem.jpg&do=media&tab_files=files&tab_details=view)
(http://digistump.com/wiki/?ns=digix%3A&image=digix%3Asta_settings.jpg&do=media&tab_files=files&tab_details=view)
(http://digistump.com/wiki/?ns=digix%3A&image=digix%3Aap_settings.jpg&do=media&tab_files=files&tab_details=view)
(http://digistump.com/wiki/?ns=digix%3A&image=digix%3Awork_mode.jpg&do=media&tab_files=files&tab_details=view)
(http://digistump.com/wiki/?ns=digix%3A&image=digix%3Aother_settings.jpg&do=media&tab_files=files&tab_details=view)

hmm... I'm not seeing the pictures I've added when I go to Preview. I was trying to pop them in after uploading them to Wiki like you adviced. I may not have them in the right place.
anyway, I've added them as attachments, also.

Russ from Coral Springs, Fl