HTTPInterface

190 views
Skip to first unread message

Sander Lagrand

unread,
Feb 13, 2016, 1:33:16 AM2/13/16
to souliss
Back again after a long time of absence...


Im trying to setup the HTTPIntertface, but it is giving me hard time.

I hope someone can help me out.

Gr Sander 


This is the error:

In file included from C:\Users\Gebruiker\Documents\Arduino\libraries\souliss/Souliss.h:225:0,

                 from C:\Users\GEBRUI~1\AppData\Local\Temp\arduino_0509852c4bda6e1ddef75eb01e63272e\e01_HelloWorld.ino:30:

C:\Users\GEBRUI~1\AppData\Local\Temp\arduino_0509852c4bda6e1ddef75eb01e63272e\e01_HelloWorld.ino: In function 'void loop()':

C:\Users\Gebruiker\Documents\Arduino\libraries\souliss/base/SpeakEasy.h:303:56: error: 'HTTPServer' was not declared in this scope

 #define Run_HTTPServer()          HTTPServer(memory_map)

                                                        ^

C:\Users\GEBRUI~1\AppData\Local\Temp\arduino_0509852c4bda6e1ddef75eb01e63272e\e01_HelloWorld.ino:71:13: note: in expansion of macro 'Run_HTTPServer'

             Run_HTTPServer(); 

             ^

exit status 1
Fout bij compileren.

This is my sketch:

/**************************************************************************
    Souliss - Hello World
    
    This is the basic example, control one LED via a push-button or Android
    using SoulissApp (get it from Play Store).  
    
    Run this code on one of the following boards:
      - Arduino Ethernet (W5100) 
      - Arduino with Ethernet Shield (W5100)
      
    As option you can run the same code on the following, just changing the
    relevant configuration file at begin of the sketch
      - Arduino with W5200 Ethernet Shield
      - Arduino with W5500 Ethernet Shield
        
***************************************************************************/
// Let the IDE point to the Souliss framework
#include "SoulissFramework.h"

// Configure the framework
#include "bconf/StandardArduino.h"          // Use a standard Arduino
#include "conf/ethW5100.h"                  // Ethernet through Wiznet W5100
#include "conf/Gateway.h"                   // The main node is the Gateway, we have just one node


// Include framework code and libraries
#include <SPI.h>

/*** All configuration includes should be above this line ***/ 
#include "Souliss.h"
#include "conf/HTTPinterface.h"

// Define the network configuration according to your router settings
uint8_t ip_address[4]  = {192, 168, 254, 77};
uint8_t subnet_mask[4] = {255, 255, 255, 0};
uint8_t ip_gateway[4]  = {192, 168, 254, 254};

// This identify the number of the LED logic
#define MYLEDLOGIC          0               

void setup()
{   
    Initialize();

    // Get the IP address from DHCP
    GetIPAddress();                          
    SetAsGateway(myvNet_dhcp);       // Set this node as gateway for SoulissApp  
    
    Set_SimpleLight(MYLEDLOGIC);        // Define a simple LED light logic

    Init_HTTPServer();
    
    // We connect a pushbutton between 5V and pin2 with a pulldown resistor 
    // between pin2 and GND, the LED is connected to pin9 with a resistor to
    // limit the current amount
    pinMode(2, INPUT);                  // Hardware pulldown required
    pinMode(9, OUTPUT);                 // Power the LED
}

void loop()
    // Here we start to play
    EXECUTEFAST() {       
              
        UPDATEFAST();   
             
        FAST_50ms() {   // We process the logic and relevant input and output every 50 milliseconds
            DigIn(2, Souliss_T1n_ToggleCmd, MYLEDLOGIC);            // Use the pin2 as ON/OFF toggle command
            Logic_SimpleLight(MYLEDLOGIC);                          // Drive the LED as per command
            DigOut(9, Souliss_T1n_Coil, MYLEDLOGIC);                // Use the pin9 to give power to the LED according to the logic
            Run_HTTPServer(); 
        } 
              
        // Here we handle here the communication with Android, commands and notification
        // are automatically assigned to MYLEDLOGIC
        FAST_GatewayComms();                                        
        
    }

Di Maio, Dario

unread,
Feb 14, 2016, 8:27:26 AM2/14/16
to sou...@googlegroups.com

Hi Sander,

in your sketch, read the comment on the line above #include "Souliss.h" and you will get your answer :)

Dario.

From Mobile.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/690e0150-bcd3-4404-b4b9-f0978e145793%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sander Lagrand

unread,
Feb 14, 2016, 3:18:28 PM2/14/16
to souliss
Hi Dario,

Thnx for your response.

As soon as I move the #include line before the #include "Souliss.h" line, my IDE bursts out in errors during compilation.
For example:
-NetworkSetup.cpp:212:16: error: 'ip' was not declared in this scope
-NetworkSetup.cpp:209:2: error: 'IPAddress' was not declared in this scope
-NetworkSetup.cpp:208:2: error: 'Ethernet' was not declared in this scope
-And loads of errorrs regarding the cmdbuff_header.
Is there a working example of this interface?

Gr Sander


Op zondag 14 februari 2016 14:27:26 UTC+1 schreef Dario Di Maio:

Yuri Kutovoy

unread,
Jul 22, 2016, 9:35:42 AM7/22/16
to souliss
Hi Sander, Dario
Im trying to setup the HTTPIntertface as Sander and get number compilation errors
IF I copy some defs from "XMLServer.h" to "HTTP.h"
#define MAXVALUES 5 // Number of values into a single URL, comma separated

#define CMDBUFF_NO 5
#define CMDBUFF_HEADER (5*CMDBUFF_NO) // Length of the header structure
#define CMDBUFF_VALS (5*CMDBUFF_NO) // Length of the vals area

typedef struct
{
U16 address; // Node Address
U8  slot; // Node Slot
} CommandBufferHeader;

I've paste it after 
#define NULLID 0xFF // This ID value is assumed as Null


And sketch compiled, but it seems doesn't work, server return only  
"HTTP/1.1 200 OK\n\rContent-Type: text/html\n\r\n\r"

Please help 

Yuri Kutovoy

unread,
Jul 22, 2016, 10:12:13 AM7/22/16
to souliss
Here is some comments about HTTPInterface

Di Maio, Dario

unread,
Jul 22, 2016, 3:27:04 PM7/22/16
to sou...@googlegroups.com

Hi Yuri,

does it work if you send commands? Is supposed to do only that.

Regards,
Dario.

From Mobile.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.

Yuri Kutovoy

unread,
Jul 23, 2016, 3:35:41 PM7/23/16
to souliss
Thanks, yes it's works, but I've try only togglecmd on single node with single device, and there is no any response only http header.

Di Maio, Dario

unread,
Jul 24, 2016, 4:13:54 AM7/24/16
to sou...@googlegroups.com

That's the way is it designed.

Dario.

From Mobile.

On 23 Jul 2016 21:35, "Yuri Kutovoy" <ykut...@gmail.com> wrote:
Thanks, yes it's works, but I've try only togglecmd on single node with single device, and there is no any response only http header.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages