Forum: Mikrocontroller und Digitale Elektronik Microchip TCP IP Stack HTTP Server


von Andi (Gast)


Lesenswert?

Hallo,

implementier gerade den tcp ip stack von microchip.

DHCP funktioniert bereits und jetzt will ich den http server zum laufen 
bekommen.

Dazu habe ich eine "mini" html seite geschrieben welche ich mit dem MPFS 
tool in ne .c datei umgewandelt habe.

Bei uC habe ich STACK_USE_HTTP2_SERVER nicht auskommentiert und alle 
erforderlichen files eingebunden sodass ich das projekt kompelieren 
kann.

Beim aufrufen des uC (192.168.0.5) im webbrowser wird mir die HTML seite 
nicht angezeigt.

Was muss ich machen damit der uC mir erstmal nur die simple html seite 
anzeigt (ohne dynamische variablen etc.)???

Gruß
Andi

von Johannes O. (jojo_2)


Lesenswert?

Wie weit kommst du denn überhaupt? Klappt die TCP Verbindung oder 
scheiterts schon davor? Schneide mal mit Wireshark mit und stells hier 
rein.

von heinzhorst (Gast)


Lesenswert?

Du musst die Webseite noch durch das MPFS-Tool jagen. Das macht daraus 
ein Array, das automatisch mit einkompilliert wird oder ein Binary, das 
in einem externen SPI-EEPROM gespeichert werden kann. Wo wird deine 
Webseite gespeichert? Im Flash, auf einem externen EEPROM oder auf 
SD-Card? Wenn sei im Flash gespeichert werden soll muss in der 
TCPIPConfig.h

//#define MPFS_USE_EEPROM

auskommentiert werden. Wenn du eien externen EEPROM für die Webseite 
benutzt musst du das Binary mit der Webseite nach dem Kompillieren noch 
hochladen. Das geht auch mit dem MPFS-Tool.

von Andi (Gast)


Lesenswert?

@Johannes

jo daran hab ich noch gar net gdacht mach ich!

@heinzhorst

habe es bereits durch mpfs "gejackt" und als c-array ausgeben lassen und 
danach im projekt eingebunden (sonst könnt ichs ja nicht mal kompelieren 
;) )... die entsprechenden defines hab ich laut comments entsprechend 
rein bzw. raus kommentiert...

von Andi (Gast)


Lesenswert?

Habe gerade den test mit wireshark gemacht. Der uC reagiert anscheinend 
nur auf nen ping. Bei der anfrage über den browser tut sich nix.

Ich denke das man auch zur anzeige der html startseite den uC 
entsprechend programmieren muss (habe eig vermutet das die startseite 
automatisch geladen wird).

Gruß
Andi

von Andi (Gast)


Lesenswert?

jemand muss sich doch mit dem microchip tcp ip stack auskennen ^^ ist 
doch nix neues?!?

von Johannes O. (jojo_2)


Lesenswert?

Auch wenn ich mich nicht mit dem Microchip TCP/IP Stack auskenne:
Wie weit kommst du eigentlich? Du meintest ja, dass sich bei der Anfrage 
über den Browser nichts tut.
Aber so ein Verbindungsversuch hat mehrere Phasen.
Kommt der SYN beim Controller an? Antwortet der mit einem ACK oder 
bleibt das ACK aus?

von Andi (Gast)


Lesenswert?

Also habe bei wireshark nen filter auf die source adresse vom uC 
(192.168.0.5) gestellt und da kommt dann nur bei nem ping ne antwort. 
Beim HTTP aufruf kommt gar nix bei wireshark von 192.168.0.5. Das 
bedeutet doch das der uC nicht antwortet?!

Ich habe mit sicherheit etwas falsch konfiguriert oder warscheinlich 
eher etwas vergessen zu programmieren...

Ich habe bezüglich HTTP server nichts programmiert außer den stack 
entsprechend konfiguriert (config file angepasst, CustomHTTPFile 
angelegt, webpage über MPFS tool in c code gewandelt und eingebunden 
usw.).

Ich würde gerne einfach in stichworten gesagt bekommen was zu tun ist 
und welche funktionen aufgerufen werden müssen um eine einfache http 
seite auszugeben??? Dann kann ich schauen ob ich etwas vergessen habe...

Gruß
Andi

P.S.: Bitte beachten das der Stack an sich funktioniert da DHCP und ICMP 
(ping) funktioniert.

von Andreas G. (beastyk)


Lesenswert?

Moin Andi,

hier möchte niemand seine Glaskugel rausholen und deshalb halten sich 
viele auch erstmal zurück.
Bitte stelle deinen Code

Andi schrieb:
> (config file angepasst, CustomHTTPFile
> angelegt, webpage über MPFS tool in c code gewandelt und eingebunden
> usw.)


mal hier rein dann können auch alle mal nach einem Fehler suchen!!!

Gruß
Andi

von Simon K. (simon) Benutzerseite


Lesenswert?

Gar keine Antwort auf TCP SYN wird vermutlich ein nicht registrierter 
Port sein im Stack.

von Tiramisu (Gast)


Lesenswert?

>Gar keine Antwort auf TCP SYN wird vermutlich ein nicht registrierter
>Port sein im Stack.

Nope, dann sollte ein (TCP-)RST Paket zu sehen sein, wenn sich
dieser Stack auch nur ansatzweise an das TCP State Diagramm
haelt. (Selbst bei UDP-Verbindungen gibt es bei einem
non-listening socket ein ICMP Port Unreachable zurueck)

Der Wireshark Dump waere schon interessant bzw. ein pcap-File
mit den Rohdaten.

von Johannes O. (jojo_2)


Lesenswert?

Kommt das SYN-Packet überhaupt durch den Switch hin zum Chip?
Zuerst wird ja ein ARP-Request(?) gemacht um die IP in eine MAC-Adresse 
aufzulösen. Evtl. schlägt der schon fehl?

von Tiramisu (Gast)


Lesenswert?

>Zuerst wird ja ein ARP-Request(?) gemacht um die IP in eine MAC-Adresse
>aufzulösen. Evtl. schlägt der schon fehl?

Dann wuerde (auch) ping nicht funktionieren.

von Andi (Gast)


Lesenswert?

ok also mal hier der code:
1
//#include "stdlib.h"
2
//#include "string.h"
3
4
#include "TCPIP Stack/TCPIP.h"
5
6
7
// *****************************************************************************
8
// *****************************************************************************
9
// Section: Configuration bits
10
// *****************************************************************************
11
// *****************************************************************************
12
#pragma config FPLLODIV = DIV_1, FPLLMUL = MUL_20, FPLLIDIV = DIV_2, FWDTEN = OFF, FCKSM = CSECME, FPBDIV = DIV_1
13
#pragma config OSCIOFNC = ON, POSCMOD = XT, FSOSCEN = ON, FNOSC = PRIPLL
14
#pragma config CP = OFF, BWP = OFF, PWP = OFF, ICESEL = ICS_PGx1, DEBUG = ON
15
16
// *****************************************************************************
17
// *****************************************************************************
18
// Section: System Macros
19
// *****************************************************************************
20
// *****************************************************************************
21
/*#define  GetSystemClock()       (80000000ul)
22
#define  GetPeripheralClock()    (GetSystemClock()/(1 << OSCCONbits.PBDIV))
23
#define  GetInstructionClock()    (GetSystemClock())*/
24
// *****************************************************************************
25
static unsigned short wOriginalAppConfigChecksum;  // Checksum of the ROM defaults for AppConfig
26
27
28
static void InitializeBoard(void);
29
static void InitAppConfig(void);
30
31
APP_CONFIG AppConfig; 
32
33
int main(void)
34
{
35
  static DWORD t = 0;
36
37
  InitializeBoard();
38
  TickInit();
39
  InitAppConfig();
40
41
  StackInit();
42
43
44
  while(1)
45
  {
46
        // This task performs normal stack task including checking
47
        // for incoming packet, type of packet and calling
48
        // appropriate stack entity to process it.
49
        StackTask();
50
        // This tasks invokes each of the core stack application tasks
51
        StackApplications();
52
53
  }
54
}


dann hier noch das Config file:
1
/*********************************************************************
2
 *
3
 *  Microchip TCP/IP Stack Demo Application Configuration Header
4
 *
5
 *********************************************************************
6
 * FileName:        TCPIPConfig.h
7
 * Dependencies:    Microchip TCP/IP Stack
8
 * Processor:       PIC18, PIC24F, PIC24H, dsPIC30F, dsPIC33F, PIC32
9
 * Compiler:        Microchip C32 v1.10 or higher
10
 *          Microchip C30 v3.12 or higher
11
 *          Microchip C18 v3.34 or higher
12
 *          HI-TECH PICC-18 PRO 9.63PL2 or higher
13
 * Company:         Microchip Technology, Inc.
14
 *
15
 * Software License Agreement
16
 *
17
 * Copyright (C) 2002-2010 Microchip Technology Inc.  All rights
18
 * reserved.
19
 *
20
 * Microchip licenses to you the right to use, modify, copy, and
21
 * distribute:
22
 * (i)  the Software when embedded on a Microchip microcontroller or
23
 *      digital signal controller product ("Device") which is
24
 *      integrated into Licensee's product; or
25
 * (ii) ONLY the Software driver source files ENC28J60.c, ENC28J60.h,
26
 *    ENCX24J600.c and ENCX24J600.h ported to a non-Microchip device
27
 *    used in conjunction with a Microchip ethernet controller for
28
 *    the sole purpose of interfacing with the ethernet controller.
29
 *
30
 * You should refer to the license agreement accompanying this
31
 * Software for additional information regarding your rights and
32
 * obligations.
33
 *
34
 * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT
35
 * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
36
 * LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A
37
 * PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
38
 * MICROCHIP BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR
39
 * CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF
40
 * PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS
41
 * BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE
42
 * THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, OR OTHER
43
 * SIMILAR COSTS, WHETHER ASSERTED ON THE BASIS OF CONTRACT, TORT
44
 * (INCLUDING NEGLIGENCE), BREACH OF WARRANTY, OR OTHERWISE.
45
 *
46
 *
47
 * Author               Date        Comment
48
 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49
 * Howard Schlunder    10/04/2006  Original
50
 * Ken Hesky            07/01/2008  Added ZG2100-specific features
51
 * SG                   03/25/2009  Added ZGLinkMgrII specific features
52
 ********************************************************************/
53
#ifndef __TCPIPCONFIG_H
54
#define __TCPIPCONFIG_H
55
56
#include "GenericTypeDefs.h"
57
#include "Compiler.h"
58
#define GENERATED_BY_TCPIPCONFIG "Version 1.0.3937.25080"
59
60
// =======================================================================
61
//   Application Options
62
// =======================================================================
63
64
/* Application Level Module Selection
65
 *   Uncomment or comment the following lines to enable or
66
 *   disabled the following high-level application modules.
67
 */
68
//#define STACK_USE_UART          // Application demo using UART for IP address display and stack configuration
69
//#define STACK_USE_UART2TCP_BRIDGE    // UART to TCP Bridge application example
70
//#define STACK_USE_IP_GLEANING
71
#define STACK_USE_ICMP_SERVER      // Ping query and response capability
72
#define STACK_USE_ICMP_CLIENT      // Ping transmission capability
73
//#define STACK_USE_HTTP_SERVER      // Old HTTP server
74
#define STACK_USE_HTTP2_SERVER      // New HTTP server with POST, Cookies, Authentication, etc.
75
//#define STACK_USE_SSL_SERVER      // SSL server socket support (Requires SW300052)
76
//#define STACK_USE_SSL_CLIENT      // SSL client socket support (Requires SW300052)
77
#define STACK_USE_AUTO_IP               // Dynamic link-layer IP address automatic configuration protocol
78
#define STACK_USE_DHCP_CLIENT      // Dynamic Host Configuration Protocol client for obtaining IP address and other parameters
79
//#define STACK_USE_DHCP_SERVER      // Single host DHCP server
80
//#define STACK_USE_FTP_SERVER      // File Transfer Protocol (old)
81
//#define STACK_USE_SMTP_CLIENT      // Simple Mail Transfer Protocol for sending email
82
//#define STACK_USE_SNMP_SERVER      // Simple Network Management Protocol v2C Community Agent
83
//#define STACK_USE_SNMPV3_SERVER      // Simple Network Management Protocol v3 Agent
84
//#define STACK_USE_TFTP_CLIENT      // Trivial File Transfer Protocol client
85
//#define STACK_USE_GENERIC_TCP_CLIENT_EXAMPLE  // HTTP Client example in GenericTCPClient.c
86
//#define STACK_USE_GENERIC_TCP_SERVER_EXAMPLE  // ToUpper server example in GenericTCPServer.c
87
//#define STACK_USE_TELNET_SERVER      // Telnet server
88
//#define STACK_USE_ANNOUNCE        // Microchip Embedded Ethernet Device Discoverer server/client
89
//#define STACK_USE_DNS          // Domain Name Service Client for resolving hostname strings to IP addresses
90
//#define STACK_USE_DNS_SERVER      // Domain Name Service Server for redirection to the local device
91
//#define STACK_USE_NBNS          // NetBIOS Name Service Server for repsonding to NBNS hostname broadcast queries
92
//#define STACK_USE_REBOOT_SERVER      // Module for resetting this PIC remotely.  Primarily useful for a Bootloader.
93
//#define STACK_USE_SNTP_CLIENT      // Simple Network Time Protocol for obtaining current date/time from Internet
94
//#define STACK_USE_UDP_PERFORMANCE_TEST  // Module for testing UDP TX performance characteristics.  NOTE: Enabling this will cause a huge amount of UDP broadcast packets to flood your network on the discard port.  Use care when enabling this on production networks, especially with VPNs (could tunnel broadcast traffic across a limited bandwidth connection).
95
//#define STACK_USE_TCP_PERFORMANCE_TEST  // Module for testing TCP TX performance characteristics
96
//#define STACK_USE_DYNAMICDNS_CLIENT    // Dynamic DNS client updater module
97
//#define STACK_USE_BERKELEY_API      // Berekely Sockets APIs are available
98
//#define STACK_USE_ZEROCONF_LINK_LOCAL  // Zeroconf IPv4 Link-Local Addressing
99
//#define STACK_USE_ZEROCONF_MDNS_SD    // Zeroconf mDNS and mDNS service discovery
100
101
102
// =======================================================================
103
//   Data Storage Options
104
// =======================================================================
105
106
/* MPFS Configuration
107
 *   MPFS is automatically included when required for other
108
 *   applications.  If your custom application requires it
109
 *   otherwise, uncomment the appropriate selection.
110
 */
111
//#define STACK_USE_MPFS
112
#define STACK_USE_MPFS2
113
114
/* MPFS Storage Location
115
 *   If html pages are stored in internal program memory,
116
 *   comment both MPFS_USE_EEPROM and MPFS_USE_SPI_FLASH, then
117
 *   include an MPFS image (.c or .s file) in the project.
118
 *   If html pages are stored in external memory, uncomment the
119
 *   appropriate definition.
120
 *
121
 *   Supported serial flash parts include the SST25VFxxxB series.
122
 */
123
//#define MPFS_USE_EEPROM
124
//#define MPFS_USE_SPI_FLASH
125
126
/* EEPROM Addressing Selection
127
 *   If using the 1Mbit EEPROM, uncomment this line
128
 */
129
//#define USE_EEPROM_25LC1024
130
131
/* EEPROM Reserved Area
132
 *   Number of EEPROM bytes to be reserved before MPFS storage starts.
133
 *   These bytes host application configurations such as IP Address,
134
 *   MAC Address, and any other required variables.
135
 *
136
 *   For MPFS Classic, this setting must match the Reserved setting
137
 *   on the Advanced Settings page of the MPFS2 Utility.
138
 */
139
#define MPFS_RESERVE_BLOCK        (137ul)
140
141
/* MPFS File Handles
142
 *   Maximum number of simultaneously open MPFS2 files.
143
 *   For MPFS Classic, this has no effect.
144
 */
145
#define MAX_MPFS_HANDLES        (7ul)
146
147
148
// =======================================================================
149
//   Network Addressing Options
150
// =======================================================================
151
152
/* Default Network Configuration
153
 *   These settings are only used if data is not found in EEPROM.
154
 *   To clear EEPROM, hold BUTTON0, reset the board, and continue
155
 *   holding until the LEDs flash.  Release, and reset again.
156
 */
157
#define MY_DEFAULT_HOST_NAME      "MCHPBOARD"
158
159
#define MY_DEFAULT_MAC_BYTE1            (0x00)  // Use the default of 00-04-A3-00-00-00
160
#define MY_DEFAULT_MAC_BYTE2            (0x04)  // if using an ENCX24J600, MRF24WB0M, or
161
#define MY_DEFAULT_MAC_BYTE3            (0xA3)  // PIC32MX6XX/7XX internal Ethernet 
162
#define MY_DEFAULT_MAC_BYTE4            (0x00)  // controller and wish to use the 
163
#define MY_DEFAULT_MAC_BYTE5            (0x00)  // internal factory programmed MAC
164
#define MY_DEFAULT_MAC_BYTE6            (0x00)  // address instead.
165
166
#define MY_DEFAULT_IP_ADDR_BYTE1        (169ul)
167
#define MY_DEFAULT_IP_ADDR_BYTE2        (254ul)
168
#define MY_DEFAULT_IP_ADDR_BYTE3        (1ul)
169
#define MY_DEFAULT_IP_ADDR_BYTE4        (1ul)
170
171
#define MY_DEFAULT_MASK_BYTE1           (255ul)
172
#define MY_DEFAULT_MASK_BYTE2           (255ul)
173
#define MY_DEFAULT_MASK_BYTE3           (0ul)
174
#define MY_DEFAULT_MASK_BYTE4           (0ul)
175
176
#define MY_DEFAULT_GATE_BYTE1           (169ul)
177
#define MY_DEFAULT_GATE_BYTE2           (254ul)
178
#define MY_DEFAULT_GATE_BYTE3           (1ul)
179
#define MY_DEFAULT_GATE_BYTE4           (1ul)
180
181
#define MY_DEFAULT_PRIMARY_DNS_BYTE1  (169ul)
182
#define MY_DEFAULT_PRIMARY_DNS_BYTE2  (254ul)
183
#define MY_DEFAULT_PRIMARY_DNS_BYTE3  (1ul)
184
#define MY_DEFAULT_PRIMARY_DNS_BYTE4  (1ul)
185
186
#define MY_DEFAULT_SECONDARY_DNS_BYTE1  (0ul)
187
#define MY_DEFAULT_SECONDARY_DNS_BYTE2  (0ul)
188
#define MY_DEFAULT_SECONDARY_DNS_BYTE3  (0ul)
189
#define MY_DEFAULT_SECONDARY_DNS_BYTE4  (0ul)
190
191
// =======================================================================
192
//   PIC32MX7XX/6XX MAC Layer Options
193
//   If not using a PIC32MX7XX/6XX device, ignore this section.
194
// =======================================================================
195
#define  ETH_CFG_LINK      0    // set to 1 if you need to config the link to specific following parameters
196
                    // otherwise the default connection will be attempted
197
                    // depending on the selected PHY
198
  #define  ETH_CFG_AUTO    1    // use auto negotiation
199
  #define  ETH_CFG_10      1    // use/advertise 10 Mbps capability
200
  #define  ETH_CFG_100      1    // use/advertise 100 Mbps capability
201
  #define  ETH_CFG_HDUPLEX    1    // use/advertise half duplex capability
202
  #define  ETH_CFG_FDUPLEX    1    // use/advertise full duplex capability
203
  #define  ETH_CFG_AUTO_MDIX  1    // use/advertise auto MDIX capability
204
  #define  ETH_CFG_SWAP_MDIX  1    // use swapped MDIX. else normal MDIX
205
206
#define EMAC_TX_DESCRIPTORS    2    // number of the TX descriptors to be created
207
#define EMAC_RX_DESCRIPTORS    8    // number of the RX descriptors and RX buffers to be created
208
209
#define  EMAC_RX_BUFF_SIZE    1536  // size of a RX buffer. should be multiple of 16
210
                    // this is the size of all receive buffers processed by the ETHC
211
                    // The size should be enough to accomodate any network received packet
212
                    // If the packets are larger, they will have to take multiple RX buffers
213
                    // The current implementation does not handle this situation right now and the packet is discarded.
214
215
216
// =======================================================================
217
//   Transport Layer Options
218
// =======================================================================
219
220
/* Transport Layer Configuration
221
 *   The following low level modules are automatically enabled
222
 *   based on module selections above.  If your custom module
223
 *   requires them otherwise, enable them here.
224
 */
225
//#define STACK_USE_TCP
226
//#define STACK_USE_UDP
227
228
/* Client Mode Configuration
229
 *   Uncomment following line if this stack will be used in CLIENT
230
 *   mode.  In CLIENT mode, some functions specific to client operation
231
 *   are enabled.
232
 */
233
#define STACK_CLIENT_MODE
234
235
/* TCP Socket Memory Allocation
236
 *   TCP needs memory to buffer incoming and outgoing data.  The
237
 *   amount and medium of storage can be allocated on a per-socket
238
 *   basis using the example below as a guide.
239
 */
240
  // Allocate how much total RAM (in bytes) you want to allocate
241
  // for use by your TCP TCBs, RX FIFOs, and TX FIFOs.
242
  #define TCP_ETH_RAM_SIZE          (2142ul)
243
  #define TCP_PIC_RAM_SIZE          (0ul)
244
  #define TCP_SPI_RAM_SIZE          (0ul)
245
  #define TCP_SPI_RAM_BASE_ADDRESS      (0x00)
246
247
  // Define names of socket types
248
  #define TCP_SOCKET_TYPES
249
    #define TCP_PURPOSE_GENERIC_TCP_CLIENT 0
250
    #define TCP_PURPOSE_GENERIC_TCP_SERVER 1
251
    #define TCP_PURPOSE_TELNET 2
252
    #define TCP_PURPOSE_FTP_COMMAND 3
253
    #define TCP_PURPOSE_FTP_DATA 4
254
    #define TCP_PURPOSE_TCP_PERFORMANCE_TX 5
255
    #define TCP_PURPOSE_TCP_PERFORMANCE_RX 6
256
    #define TCP_PURPOSE_UART_2_TCP_BRIDGE 7
257
    #define TCP_PURPOSE_HTTP_SERVER 8
258
    #define TCP_PURPOSE_DEFAULT 9
259
    #define TCP_PURPOSE_BERKELEY_SERVER 10
260
    #define TCP_PURPOSE_BERKELEY_CLIENT 11
261
  #define END_OF_TCP_SOCKET_TYPES
262
263
  #if defined(__TCP_C)
264
    // Define what types of sockets are needed, how many of
265
    // each to include, where their TCB, TX FIFO, and RX FIFO
266
    // should be stored, and how big the RX and TX FIFOs should
267
    // be.  Making this initializer bigger or smaller defines
268
    // how many total TCP sockets are available.
269
    //
270
    // Each socket requires up to 56 bytes of PIC RAM and
271
    // 48+(TX FIFO size)+(RX FIFO size) bytes of TCP_*_RAM each.
272
    //
273
    // Note: The RX FIFO must be at least 1 byte in order to
274
    // receive SYN and FIN messages required by TCP.  The TX
275
    // FIFO can be zero if desired.
276
    #define TCP_CONFIGURATION
277
    ROM struct
278
    {
279
      BYTE vSocketPurpose;
280
      BYTE vMemoryMedium;
281
      WORD wTXBufferSize;
282
      WORD wRXBufferSize;
283
    } TCPSocketInitializer[] = 
284
    {
285
      //{TCP_PURPOSE_GENERIC_TCP_CLIENT, TCP_ETH_RAM, 125, 1200},
286
      //{TCP_PURPOSE_GENERIC_TCP_SERVER, TCP_ETH_RAM, 20, 20},
287
      //{TCP_PURPOSE_TELNET, TCP_ETH_RAM, 200, 150},
288
      //{TCP_PURPOSE_TELNET, TCP_ETH_RAM, 200, 150},
289
      //{TCP_PURPOSE_TELNET, TCP_ETH_RAM, 200, 150},
290
      //{TCP_PURPOSE_FTP_COMMAND, TCP_ETH_RAM, 100, 40},
291
      //{TCP_PURPOSE_FTP_DATA, TCP_ETH_RAM, 0, 128},
292
      {TCP_PURPOSE_TCP_PERFORMANCE_TX, TCP_ETH_RAM, 2000, 1},
293
      //{TCP_PURPOSE_TCP_PERFORMANCE_RX, TCP_ETH_RAM, 40, 2000},
294
      //{TCP_PURPOSE_UART_2_TCP_BRIDGE, TCP_ETH_RAM, 256, 256},
295
      //{TCP_PURPOSE_HTTP_SERVER, TCP_ETH_RAM, 1500, 1500},
296
      //{TCP_PURPOSE_HTTP_SERVER, TCP_ETH_RAM, 1500, 1500},
297
      //{TCP_PURPOSE_DEFAULT, TCP_ETH_RAM, 1000, 1000},
298
      {TCP_PURPOSE_BERKELEY_SERVER, TCP_ETH_RAM, 25, 20},
299
      //{TCP_PURPOSE_BERKELEY_SERVER, TCP_ETH_RAM, 25, 20},
300
      //{TCP_PURPOSE_BERKELEY_SERVER, TCP_ETH_RAM, 25, 20},
301
      //{TCP_PURPOSE_BERKELEY_CLIENT, TCP_ETH_RAM, 125, 100},
302
    };
303
    #define END_OF_TCP_CONFIGURATION
304
  #endif
305
306
/* UDP Socket Configuration
307
 *   Define the maximum number of available UDP Sockets, and whether
308
 *   or not to include a checksum on packets being transmitted.
309
 */
310
#define MAX_UDP_SOCKETS     (10u)
311
#define UDP_USE_TX_CHECKSUM    // This slows UDP TX performance by nearly 50%, except when using the ENCX24J600 or PIC32MX6XX/7XX, which have a super fast DMA and incurs virtually no speed pentalty.
312
313
314
/* Berkeley API Sockets Configuration
315
 *   Note that each Berkeley socket internally uses one TCP or UDP socket
316
 *   defined by MAX_UDP_SOCKETS and the TCPSocketInitializer[] array.
317
 *   Therefore, this number MUST be less than or equal to MAX_UDP_SOCKETS + the
318
 *   number of TCP sockets defined by the TCPSocketInitializer[] array
319
 *   (i.e. sizeof(TCPSocketInitializer)/sizeof(TCPSocketInitializer[0])).
320
 *   This define has no effect if STACK_USE_BERKELEY_API is not defined and
321
 *   Berkeley Sockets are disabled.  Set this value as low as your application
322
 *   requires to avoid waisting RAM.
323
 */
324
#define BSD_SOCKET_COUNT (5u)
325
326
327
// =======================================================================
328
//   Application-Specific Options
329
// =======================================================================
330
331
// -- HTTP2 Server options -----------------------------------------------
332
333
  // Maximum numbers of simultaneous HTTP connections allowed.
334
  // Each connection consumes 2 bytes of RAM and a TCP socket
335
  #define MAX_HTTP_CONNECTIONS  (2u)
336
337
  // Optional setting to use PIC RAM instead of Ethernet/Wi-Fi RAM for
338
  // storing HTTP Connection Context variables (HTTP_CONN structure for each 
339
  // HTTP connection).  Undefining this macro results in the Ethernet/Wi-Fi 
340
  // RAM being used (minimum PIC RAM usage, lower performance).  Defining 
341
  // this macro results in PIC RAM getting used (higher performance, but uses 
342
  // PIC RAM).  This option should not be enabled on PIC18 devices.  The 
343
  // performance increase of having this option defined is only apparent when 
344
  // the HTTP server is servicing multiple connections simultaneously.
345
  //#define HTTP_SAVE_CONTEXT_IN_PIC_RAM
346
347
  // Indicate what file to serve when no specific one is requested
348
  #define HTTP_DEFAULT_FILE    /*"MyWebsite.html"*/ "index.htm"
349
  #define HTTPS_DEFAULT_FILE    /*"MyWebsite.html"*/ "index.htm"
350
  #define HTTP_DEFAULT_LEN    (10u)    // For buffer overrun protection.
351
                        // Set to longest length of above two strings.
352
353
  // Configure MPFS over HTTP updating
354
  // Comment this line to disable updating via HTTP
355
  #define HTTP_MPFS_UPLOAD    "mpfsupload"
356
  //#define HTTP_MPFS_UPLOAD_REQUIRES_AUTH  // Require password for MPFS uploads
357
    // Certain firewall and router combinations cause the MPFS2 Utility to fail
358
    // when uploading.  If this happens, comment out this definition.
359
360
  // Define which HTTP modules to use
361
  // If not using a specific module, comment it to save resources
362
  //#define HTTP_USE_POST          // Enable POST support
363
  //#define HTTP_USE_COOKIES        // Enable cookie support
364
  //#define HTTP_USE_AUTHENTICATION      // Enable basic authentication support
365
366
  //#define HTTP_NO_AUTH_WITHOUT_SSL    // Uncomment to require SSL before requesting a password
367
368
    // Define the listening port for the HTTP server
369
    #define HTTP_PORT               (80u)
370
  
371
    // Define the listening port for the HTTPS server (if STACK_USE_SSL_SERVER is enabled)
372
  #define HTTPS_PORT        (443u)
373
  
374
    // Define the maximum data length for reading cookie and GET/POST arguments (bytes)
375
  #define HTTP_MAX_DATA_LEN    (100u)
376
  
377
    // Define the minimum number of bytes free in the TX FIFO before executing callbacks
378
  #define HTTP_MIN_CALLBACK_FREE  (16u)
379
380
  //#define STACK_USE_HTTP_APP_RECONFIG    // Use the AppConfig web page in the Demo App (~2.5kb ROM, ~0b RAM)
381
  //#define STACK_USE_HTTP_MD5_DEMO      // Use the MD5 Demo web page (~5kb ROM, ~160b RAM)
382
  //#define STACK_USE_HTTP_EMAIL_DEMO    // Use the e-mail demo web page
383
384
// -- SSL Options --------------------------------------------------------
385
386
  #define MAX_SSL_CONNECTIONS    (2ul)  // Maximum connections via SSL
387
  #define MAX_SSL_SESSIONS    (2ul)  // Max # of cached SSL sessions
388
  #define MAX_SSL_BUFFERS      (4ul)  // Max # of SSL buffers (2 per socket)
389
  #define MAX_SSL_HASHES      (5ul)  // Max # of SSL hashes  (2 per, plus 1 to avoid deadlock)
390
391
  // Bits in SSL RSA key.  This parameter is used for SSL sever
392
  // connections only.  The only valid value is 512 bits (768 and 1024
393
  // bits do not work at this time).  Note, however, that SSL client
394
  // operations do currently work up to 1024 bit RSA key length.
395
  #define SSL_RSA_KEY_SIZE    (512ul)
396
397
398
// -- Telnet Options -----------------------------------------------------
399
400
  // Number of simultaneously allowed Telnet sessions.  Note that you
401
  // must have an equal number of TCP_PURPOSE_TELNET type TCP sockets
402
  // declared in the TCPSocketInitializer[] array above for multiple
403
  // connections to work.  If fewer sockets are available than this
404
  // definition, then the the lesser of the two quantities will be the
405
  // actual limit.
406
  #define MAX_TELNET_CONNECTIONS  (1u)
407
408
  // Default local listening port for the Telnet server.  Port 23 is the
409
  // protocol default.
410
  #define TELNET_PORT        (23u)
411
412
  // Default local listening port for the Telnet server when SSL secured.
413
  // Port 992 is the telnets protocol default.
414
  #define TELNETS_PORT      (992u)
415
416
  // Force all connecting clients to be SSL secured and connected via
417
  // TELNETS_PORT.  Connections on port TELNET_PORT will be ignored.  If
418
  // STACK_USE_SSL_SERVER is undefined, this entire setting is ignored
419
  // (server will accept unsecured connections on TELNET_PORT and won't even
420
  // listen on TELNETS_PORT).
421
  //#define TELNET_REJECT_UNSECURED
422
423
  // Default username and password required to login to the Telnet server.
424
  #define TELNET_USERNAME      "admin"
425
  #define TELNET_PASSWORD      "microchip"
426
427
428
// -- SNMP Options -------------------------------------------------------
429
430
  // Comment following line if SNMP TRAP support is needed
431
  //#define SNMP_TRAP_DISABLED
432
433
  //#define SNMP_STACK_USE_V2_TRAP
434
  #if defined(STACK_USE_SNMPV3_SERVER)
435
    #define SNMP_V1_V2_TRAP_WITH_SNMPV3
436
  #endif
437
438
  // This is the maximum length for community string.
439
  // Application must ensure that this length is observed.
440
  // SNMP module adds one byte extra after SNMP_COMMUNITY_MAX_LEN
441
  // for adding '\0' NULL character.
442
  #define SNMP_COMMUNITY_MAX_LEN    (8u)
443
  #define SNMP_MAX_COMMUNITY_SUPPORT  (3u)
444
  #define NOTIFY_COMMUNITY_LEN    (SNMP_COMMUNITY_MAX_LEN)
445
446
  // Default SNMPv2C community names.  These can be overridden at run time if
447
  // alternate strings are present in external EEPROM or Flash (actual
448
  // strings are stored in AppConfig.readCommunity[] and
449
  // AppConfig.writeCommunity[] arrays).  These strings are case sensitive.
450
  // An empty string means disabled (not matchable).
451
  // For application security, these default community names should not be
452
  // used, but should all be disabled to force the end user to select unique
453
  // community names.  These defaults are provided only to make it easier to
454
  // start development.  Specifying more strings than
455
  // SNMP_MAX_COMMUNITY_SUPPORT will result in the later strings being
456
  // ignored (but still wasting program memory).  Specifying fewer strings is
457
  // legal, as long as at least one is present.  A string larger than
458
  // SNMP_COMMUNITY_MAX_LEN bytes will be ignored.
459
  #define SNMP_READ_COMMUNITIES        {"public", "read", ""}
460
    #define END_OF_SNMP_READ_COMMUNITIES
461
  #define SNMP_WRITE_COMMUNITIES        {"private", "write", "public"}
462
    #define END_OF_SNMP_WRITE_COMMUNITIES
463
#endif
464
465
466
//#define MPFS_USE_FAT    
467
468
#define MDD_ROOT_DIR_PATH    "\\"

und hier noch der wireshark log (filter: ip.src == 192.168.0.5 || ip.dst 
== 192.168.0.5)


No.     Time        Source                Destination           Protocol 
Length Info
     17 4.274695    192.168.0.2           192.168.0.5           ICMP 
74     Echo (ping) request  id=0x0001, seq=17/4352, ttl=128
     18 4.275420    192.168.0.5           192.168.0.2           ICMP 
74     Echo (ping) reply    id=0x0001, seq=17/4352, ttl=100
     21 5.276031    192.168.0.2           192.168.0.5           ICMP 
74     Echo (ping) request  id=0x0001, seq=18/4608, ttl=128
     22 5.276770    192.168.0.5           192.168.0.2           ICMP 
74     Echo (ping) reply    id=0x0001, seq=18/4608, ttl=100
     23 6.277033    192.168.0.2           192.168.0.5           ICMP 
74     Echo (ping) request  id=0x0001, seq=19/4864, ttl=128
     24 6.277780    192.168.0.5           192.168.0.2           ICMP 
74     Echo (ping) reply    id=0x0001, seq=19/4864, ttl=100
     32 7.277985    192.168.0.2           192.168.0.5           ICMP 
74     Echo (ping) request  id=0x0001, seq=20/5120, ttl=128
     33 7.278732    192.168.0.5           192.168.0.2           ICMP 
74     Echo (ping) reply    id=0x0001, seq=20/5120, ttl=100
    162 18.630759   192.168.0.2           192.168.0.5           TCP 
66     nms > http [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=4 SACK_PERM=1
    168 21.630624   192.168.0.2           192.168.0.5           TCP 
66     nms > http [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=4 SACK_PERM=1
    272 27.636531   192.168.0.2           192.168.0.5           TCP 
62     nms > http [SYN] Seq=0 Win=8192 Len=0 MSS=1460 SACK_PERM=1


gruß andi

von Tiramisu (Gast)


Lesenswert?

Vorweg: ich kenne den Stack nicht, aber Netzwerke sind meine
Heimat ;-)

>>66     nms > http [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=4 SACK_PERM=1
>>    168 21.630624   192.168.0.2           192.168.0.5           TCP
>>66     nms > http [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=4 SACK_PERM=1
>>    272 27.636531   192.168.0.2           192.168.0.5           TCP
>>62     nms > http [SYN] Seq=0 Win=8192 Len=0 MSS=1460 SACK_PERM=1

Der TCP/IP Stack muesste entweder mit SYN/ACK oder RST anworten, je
nachdem, ob ein Applikationsprogramm am Port lauscht oder nicht.
Normalerweise macht das der Stack, das Applikationsprogramm ist i.d.R.
(bei Benutzung Socketschnittstelle) bis zum dritten Packet (incl.) (SYN 
--
SYN/ACK -- ACK) nicht involviert. Obige SYN-Versuche sollten etwa noch
1-2 Minuten zu sehen sein und dann meldet der Browser "keine
Verbindung", right!?

Folgende Vorschläge:

>> //#define STACK_USE_HTTP_SERVER      // Old HTTP server
>> #define STACK_USE_HTTP2_SERVER      // New HTTP server with POST, Cookies,...

- Den alten Server probieren. Machmal ist neu nicht besser ;-)
- Debugausgaben einschalten
- rausbekommen, ob Dein Code überhaupt aufgerufen wird, wenn nein,
   wird vermutlich TCP/IP Stack Debugging notwendig :-(

VG, Tiramisu

von Andi (Gast)


Lesenswert?

also habe jetzt den stack mal gedebuggt und mit der funktionierenden 
demo application verglichen die funktion HTTPServer wird zyklisch 
aufgerufen.
1
/*****************************************************************************
2
  Function:
3
  void HTTPServer(void)
4
5
  Summary:
6
  Performs periodic tasks for the HTTP2 module.
7
8
  Description:
9
  Browses through each open connection and attempts to process any
10
  pending operations.
11
12
  Precondition:
13
  HTTPInit() must already be called.
14
15
  Parameters:
16
  None
17
18
  Returns:
19
    None
20
    
21
  Remarks:
22
  This function acts as a task (similar to one in an RTOS).  It
23
  performs its task in a co-operative manner, and the main application
24
  must call this function repeatedly to ensure that all open or new
25
  connections are served in a timely fashion.
26
  ***************************************************************************/
27
void HTTPServer(void)
28
{
29
  BYTE conn;
30
31
  for(conn = 0; conn < MAX_HTTP_CONNECTIONS; conn++)
32
  {
33
    if(httpStubs[conn].socket == INVALID_SOCKET)
34
      continue;
35
    
36
    // If a socket is disconnected at any time 
37
    // forget about it and return to idle state.
38
    // Must do this here, otherwise we will wait until a new
39
    // connection arrives, which causes problems with Linux and with SSL
40
    if(TCPWasReset(httpStubs[conn].socket))
41
    {
42
      HTTPLoadConn(conn);
43
      smHTTP = SM_HTTP_IDLE;
44
45
      // Make sure any opened files are closed
46
      if(curHTTP.file != MPFS_INVALID_HANDLE)
47
      {
48
        MPFSClose(curHTTP.file);
49
        curHTTP.file = MPFS_INVALID_HANDLE;
50
      }
51
      if(curHTTP.offsets != MPFS_INVALID_HANDLE)
52
      {
53
        MPFSClose(curHTTP.offsets);
54
        curHTTP.offsets = MPFS_INVALID_HANDLE;
55
      }
56
57
      // Adjust FIFO sizes to half and half.  Default state must remain
58
      // here so that SSL handshakes, if required, can proceed
59
      TCPAdjustFIFOSize(sktHTTP, 1, 0, TCP_ADJUST_PRESERVE_RX);
60
    }
61
    
62
    // Determine if this connection is eligible for processing
63
    if(httpStubs[conn].sm != SM_HTTP_IDLE || TCPIsGetReady(httpStubs[conn].socket))
64
    {
65
      HTTPLoadConn(conn);
66
      HTTPProcess();
67
    }
68
  }
69
}

Mein Programm kommt nich in den if teil von 
"if(TCPWasReset(httpStubs[conn].socket))" rein. Die Demo Applikation 
schon...

woran liegt das?

Gruß
Andi

von Sascha W. (sascha-w)


Lesenswert?

Andi schrieb:
> Mein Programm kommt nich in den if teil von
> "if(TCPWasReset(httpStubs[conn].socket))" rein. Die Demo Applikation
> schon...
>
> woran liegt das?

dort solltest du ja auch nur reinkommen wenn die Verbindung unterbrochen 
wurde. In der letzten if wird das normale Handling abgewickelt. Wenn 
du dort hinkommst, dann in HTTPProcess() weitersuchen.

Sascha

von Andi (Gast)


Lesenswert?

leider geht er in keine der 2 unteren if anweisungen da er anscheinden. 
Er springt immer in die obige If-Anweisung und bricht die funktion ab. 
Anscheindend ist der socket invalid...

von Andi (Gast)


Lesenswert?

ok ich habe anscheinden bei der tcpip config file etwas versaut. Habe 
diese nochmal über das microchip tool neu erstellen lassen und siehe da, 
es funktioniert... naja fast :)

also der TCP handshake funzt und danach kommt auch die http get anfrage. 
Leider kommt dann en 404 "File not found" error...

Hier der Wireshark loc (am anfang steht noch ein ping):

No.     Time        Source                Destination           Protocol 
Length Info
      4 1.340442    192.168.0.2           192.168.0.5           ICMP 
74     Echo (ping) request  id=0x0001, seq=17/4352, ttl=128
      5 1.340995    192.168.0.5           192.168.0.2           ICMP 
74     Echo (ping) reply    id=0x0001, seq=17/4352, ttl=100
      6 2.341030    192.168.0.2           192.168.0.5           ICMP 
74     Echo (ping) request  id=0x0001, seq=18/4608, ttl=128
      7 2.341758    192.168.0.5           192.168.0.2           ICMP 
74     Echo (ping) reply    id=0x0001, seq=18/4608, ttl=100
      9 3.342251    192.168.0.2           192.168.0.5           ICMP 
74     Echo (ping) request  id=0x0001, seq=19/4864, ttl=128
     10 3.342994    192.168.0.5           192.168.0.2           ICMP 
74     Echo (ping) reply    id=0x0001, seq=19/4864, ttl=100
     11 4.343679    192.168.0.2           192.168.0.5           ICMP 
74     Echo (ping) request  id=0x0001, seq=20/5120, ttl=128
     12 4.344427    192.168.0.5           192.168.0.2           ICMP 
74     Echo (ping) reply    id=0x0001, seq=20/5120, ttl=100
    101 13.005110   192.168.0.2           192.168.0.5           TCP 
66     wusage > http [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=4 
SACK_PERM=1
    102 13.005981   192.168.0.5           192.168.0.2           TCP 
60     http > wusage [SYN, ACK] Seq=0 Ack=1 Win=1501 Len=0 MSS=536
    103 13.006039   192.168.0.2           192.168.0.5           TCP 
54     wusage > http [ACK] Seq=1 Ack=1 Win=65392 Len=0
    104 13.006237   192.168.0.2           192.168.0.5           HTTP 
302    GET / HTTP/1.1
    105 13.007065   192.168.0.5           192.168.0.2           TCP 
60     http > wusage [ACK] Seq=1 Ack=249 Win=2752 Len=0
    106 13.008572   192.168.0.5           192.168.0.2           TCP 
60     [TCP Window Update] http > wusage [ACK] Seq=1 Ack=249 Win=1 Len=0
    107 13.009071   192.168.0.5           192.168.0.2           HTTP 
120    HTTP/1.1 404 Not found
    108 13.009104   192.168.0.2           192.168.0.5           TCP 
54     wusage > http [ACK] Seq=249 Ack=68 Win=65326 Len=0
    109 13.011975   192.168.0.2           192.168.0.5           TCP 
54     wusage > http [FIN, ACK] Seq=249 Ack=68 Win=65326 Len=0
    110 13.012808   192.168.0.5           192.168.0.2           TCP 
60     http > wusage [ACK] Seq=68 Ack=250 Win=1 Len=0

von Andreas G. (beastyk)


Lesenswert?

Kommt 404 Error nicht immer wenn keine Internetseite vorhanden ist?
Muß das nicht immer "Index.html" sein?

Gruß
Andi

von Andi (Gast)


Lesenswert?

ja des habe ich auch schon gelesen aber meine seite heist eig 
"index.html". Diese habe ich dann mit dem MPFS tool als C-Code 
generieren lassen (siehe unten). In der TCPIP Config File ist auch 
"index.html" als standart festgelegt.

Hier der Ausschnitt aus dem TCP Config file:
1
  // Indicate what file to serve when no specific one is requested
2
  #define HTTP_DEFAULT_FILE    "index.html"
3
  #define HTTPS_DEFAULT_FILE    "MyWebsite.html"
4
  #define HTTP_DEFAULT_LEN    (11u)    // For buffer overrun protection.
5
                        // Set to longest length of above two strings.

Hier der generierte C-Code aus dem MPFS Tool:
1
/***************************************************************
2
 * MPFSImg2.c
3
 * Defines an MPFS2 image to be stored in program memory.
4
 *
5
 * NOT FOR HAND MODIFICATION
6
 * This file is automatically generated by the MPFS2 Utility
7
 * ALL MODIFICATIONS WILL BE OVERWRITTEN BY THE MPFS2 GENERATOR
8
 * Generated Freitag, 5. August 2011 16:53:53
9
 ***************************************************************/
10
11
#define __MPFSIMG2_C
12
13
#include "TCPIPConfig.h"
14
#if !defined(MPFS_USE_EEPROM) && !defined(MPFS_USE_SPI_FLASH)
15
16
#include "TCPIP Stack/TCPIP.h"
17
#if defined(STACK_USE_MPFS2)
18
19
20
/**************************************
21
 * MPFS2 Image Data
22
 **************************************/
23
#define DATACHUNK000000 \
24
  0x4d,0x50,0x46,0x53,0x02,0x01,0x01,0x00,0xec,0x46,0x20,0x00,0x00,0x00,0x2b,0x00, /* MPFS.....F ...+. */ \
25
  0x00,0x00,0x7e,0x00,0x00,0x00,0xc5,0x03,0x3c,0x4e,0x00,0x00,0x00,0x00,0x00,0x00, /* ..~.....<N...... */ \
26
  0x69,0x6e,0x64,0x65,0x78,0x2e,0x68,0x74,0x6d,0x6c,0x00,0x3c,0x48,0x54,0x4d,0x4c, /* index.html.<HTML */ \
27
  0x3e,0x20,0x0d,0x0a,0x3c,0x48,0x45,0x41,0x44,0x3e,0x20,0x0d,0x0a,0x3c,0x54,0x49, /* > ..<HEAD> ..<TI */ \
28
  0x54,0x4c,0x45,0x3e,0x54,0x65,0x73,0x74,0x73,0x65,0x69,0x74,0x65,0x3c,0x2f,0x54, /* TLE>Testseite</T */ \
29
  0x49,0x54,0x4c,0x45,0x3e,0x20,0x0d,0x0a,0x3c,0x2f,0x48,0x45,0x41,0x44,0x3e,0x20, /* ITLE> ..</HEAD>  */ \
30
  0x0d,0x0a,0x3c,0x42,0x4f,0x44,0x59,0x3e,0x20,0x0d,0x0a,0x44,0x61,0x73,0x20,0x69, /* ..<BODY> ..Das i */ \
31
  0x73,0x74,0x20,0x6d,0x65,0x69,0x6e,0x20,0x65,0x72,0x73,0x74,0x65,0x72,0x20,0x54, /* st mein erster T */ \
32
  0x65,0x73,0x74,0x20,0x6d,0x69,0x74,0x20,0x3c,0x42,0x3e,0x48,0x54,0x4d,0x4c,0x3c, /* est mit <B>HTML< */ \
33
  0x2f,0x42,0x3e,0x20,0x0d,0x0a,0x3c,0x2f,0x42,0x4f,0x44,0x59,0x3e,0x20,0x0d,0x0a, /* /B> ..</BODY> .. */ \
34
  0x3c,0x2f,0x48,0x54,0x4d,0x4c,0x3e,0x0d,0x0a                                     /* </HTML>..        */
35
36
37
38
/**************************************
39
 * MPFS2 C linkable symbols
40
 **************************************/
41
// For C18, these are split into seperate arrays because it speeds up compilation a lot.  
42
// For other compilers, the entire data array must be defined as a single variable to 
43
// ensure that the linker does not reorder the data chunks in Flash when compiler 
44
// optimizations are turned on.
45
#if defined(__18CXX)
46
  ROM BYTE MPFS_Start[] = {DATACHUNK000000};
47
#else
48
  ROM BYTE MPFS_Start[] = {DATACHUNK000000};
49
#endif
50
51
52
/**************************************************************
53
 * End of MPFS
54
 **************************************************************/
55
#endif // #if defined(STACK_USE_MPFS2)
56
#endif // #if !defined(MPFS_USE_EEPROM) && !defined(MPFS_USE_SPI_FLASH)

Gruß
Andi

von Tiramisu (Gast)


Lesenswert?

Dann gib' doch mal im Browser ein:

     http://192.168.0.5/index.html

Kommt da was?

VG, Tiramusu

von Marc ó (Gast)


Lesenswert?

Probier mal die Webseite hochzuladen. Der Stack benutzt von Haus aus die 
Seite http://.../mpfsupload und da lädst du das binary (*.bin) aus dem 
Tool hoch.
Falls du schon was eingebunden hast erst das mpfs tool laufen lassen 
dann den neu buliden .. flaschen und dann erst .../mpfsupoad.

Gruß Marco hoffe das hilft eventuell

von Andi (Gast)


Lesenswert?

boooooooooooooooom g es tut :)

habs jetzt mal gedebugged und rausgefunden das die Variable "numFiles" 
auf 0 stand... nach der hab ich dann gesucht und rausgefunden das sie 
normalerweise beim initalisieren einen Wert zugewiesen bekommt. Leider 
hat mein code die initalisierungs-funktion MPFS_Init nicht aufgerufen. 
Diese wird in "Stack_init" NICHT automatisch durch defines aufgerufen... 
habe sie dann in main extra aufgerufen und siehe da es tut!! ohne .bin 
und ohne EEPROM :)

danke für eure Hilfe,

Gruß
Andi

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.