Skip to main content
Topic: Need help with static Ip setup (Read 16256 times) previous topic - next topic

Re: Need help with static Ip setup

Reply #15
Hi Masud
I just analysised the trace you sent again as I was puzzled by your comment
Quote
if i unplugged IP phone all network stop.

Now I understand why. In the completion of the DHCP protocol the lease time (the time that the client is allowed to use the IP address given). Is one minute or 60 seconds this is very short. According to the DHCP protocol the client will try to get an new lease typical around half the lease time or in your case 30 seconds. So If you disconnect the DHCP server (IPhone) networking will stop within 30 seconds of you doing this. Which is what you see in your case.

Quote
Stop using the DHCP server and sort out the static IP addressing

Keep up the battle I think you have almost won.
Cheer
Ron

Re: Need help with static Ip setup

Reply #16
Mausd
Just quick comfirmation post. I disabled the use of DHCP and set the IP address and Netmask in the TCPIPConfig.h file and built and deployed it to the web plaform I was able to ping it and connect to using IE 6 web browser. This shows that all need to do to get your 4 web platforms to work is to make sure each web plaform has a different MAC address. This shows that you can use static IP addresses basically as Ian told you.
Cheers
Ron

Re: Need help with static Ip setup

Reply #17
yes its work. many many thanks. i am comming with all my error. after 14 hour deep sleep. i an now fresh.

 

Re: Need help with static Ip setup

Reply #18
Its  my fault. I dint check my Lan card ip setup. when i change wp ip to similar (not same)with my Lan card. its work without IPphone. its a basic error.  so sorry for that. but i learned more. but i cant write step by step. because Ronz point out . about my english.  i am not an tcp/ip expert. i am working on power environment. now its time to go for freedom of web platform. Thanks Ian , Ronz,  Trev ,  another request to Ian, Please Change Dangerous. because  its hurt me when i was go for custom clear. anyway many many thanks.

Re: Need help with static Ip setup

Reply #19
Mausd
Excellent news, well done, go and celebrate as your culture permits.
Ron

Re: Need help with static Ip setup

Reply #20
Thanks for the update and photo, I'm glad you got it going.

RonZ - Thanks for the great troubleshooting. You gave great info, and I really enjoyed following your posts.
Got a question? Please ask in the forum for the fastest answers.

Re: Need help with static Ip setup

Reply #21
Thanks

our culture didnt permits enjoy alone. you are all invited. now i am going for webpage template. which is compatible with wp all io pin. on/off switch with status call back. i want to control array of  relay and one adc . any idea ? 

Re: Need help with static Ip setup

Reply #22
Masud
Ok understood re the celebration in New Zealand we say go and have a beer you deserve it. But that our culture not yours. I hope now you can concentrate on getting the monitoring and control working. The power of collaboration via the internet ably demonstrated. Good luck in completing the project.

Ian
No problem happy to help. I've got a Web Platform and Logic Analyzer direct from seed studios, also go a bus pirate made local here in Wellington New Zealand I've found it a useful tool. I must admit to feeling a bit guilty not supporting you after I bought the bus pirate but I wanted the Web Platform and Logic Analyzer any way so I felt better after at least supporting DP and being able to help
Ron

Re: Need help with static Ip setup

Reply #23
Quote
also go a bus pirate made local here

Do you have a link, or a picture? I love to see the design in the wild, I never dreamed it would go so far!
Got a question? Please ask in the forum for the fastest answers.

Re: Need help with static Ip setup

Reply #24
Ian
Ok I'll organize a photo in the next day or two and post it in a new thread. It came with a perspex case for NZ$45. Im off to bed as its 11:30pm here in New Zealand (GMT +13 hours) otherwise I do it now its not difficult. I've also made a crude case for the Web Platform I'll include it as well.  The Bus Pirate a copy of version v2go and a New Zealand company mindkits also sells Bus Pirates for NZ$50. They are the ones from Sparkfun http://www.mindkits.co.nz/store/prototyping/Bus-Pirate is the link.
 
Ron

Re: Need help with static Ip setup

Reply #25
[quote author="masud58"]
now i am going for webpage template. which is compatible with wp all io pin. on/off switch with status call back. i want to control array of  relay and one adc . any idea ?
[/quote]

How many relays? I used the default Microchip demo web page LEDs to control 4 relays connected to the I/O1 header. I believe all I changed was:

In MainDemo.c

Code: [Select]
//setup LEDs
LED0_TRIS = 0;
LED1_TRIS = 0;
LED2_TRIS = 0;
LED3_TRIS = 0;  // TR addition
LED4_TRIS = 0;  // TR addition
LED0_IO = 1;
LED1_IO = 1;
LED2_IO = 1;
LED3_IO = 1;    // TR addition
LED4_IO = 1;    // TR addition

In HardwareProfile.h

Code: [Select]
#define LED0_TRIS       TRISAbits.TRISA8        // LD1
#define LED0_IO         LATAbits.LATA8
#define LED1_TRIS       TRISAbits.TRISA9        // LD2 (IO1)
#define LED1_IO         LATAbits.LATA9         
#define LED2_TRIS       TRISCbits.TRISC3        // IO2
#define LED2_IO         LATCbits.LATC3
#define LED3_TRIS       TRISCbits.TRISC4        // IO3
#define LED3_IO         LATCbits.LATC4
#define LED4_TRIS       TRISCbits.TRISC5        // IO4
#define LED4_IO         LATCbits.LATC5
#define LED5_TRIS       TRISCbits.TRISC5        //map these bits to the same pin
#define LED5_IO         LATCbits.LATC5          //as we don't have more leds
#define LED6_TRIS       TRISCbits.TRISC5       
#define LED6_IO         LATCbits.LATC5
#define LED7_TRIS       TRISCbits.TRISC5       
#define LED7_IO         LATCbits.LATC5

I/O1 Header
IO1  = Control line for to relay 1 (inline 220K resistor to avoid transients during (re)boot as shared with LD2)
IO2  = ditto relay 2
IO3  = ditto relay 3
IO4  = ditto relay 4
IO9  = Gnd to relay board
IO10 = 3V3 to relay board

IO5-8 are still unused.

Re: Need help with static Ip setup

Reply #26
Hello all.

I have customize code above for my requirement.
7 IO for relay(led). 1 IO for heartbeat. i have also edit demo web page with password protection.

in HardwareProfile

Code: [Select]
// dsPIC33F processor
#define GetSystemClock() 80000000 //Hz
#define GetInstructionClock() (GetSystemClock()/2)
#define GetPeripheralClock() GetInstructionClock()

#define LED0_TRIS TRISAbits.TRISA8
#define LED0_IO LATAbits.LATA8
#define LED1_TRIS TRISAbits.TRISA9
#define LED1_IO LATAbits.LATA9
#define LED2_TRIS TRISCbits.TRISC3
#define LED2_IO LATCbits.LATC3
#define LED3_TRIS TRISCbits.TRISC4
#define LED3_IO LATCbits.LATC4
#define LED4_TRIS TRISCbits.TRISC5
#define LED4_IO LATCbits.LATC5


#define LED5_TRIS TRISBbits.TRISB6
#define LED5_IO LATBbits.LATB6
#define LED6_TRIS TRISBbits.TRISB5
#define LED6_IO LATBbits.LATB5
#define LED7_TRIS TRISBbits.TRISB8
#define LED7_IO LATBbits.LATB8


//#define BUTTON0_TRIS TRISBbits.TRISB6
//#define BUTTON0_IO PORTBbits.RB6
//#define BUTTON1_TRIS TRISBbits.TRISB5
//#define BUTTON1_IO                       PORTBbits.RB5
//#define BUTTON2_TRIS TRISBbits.TRISB8
//#define BUTTON2_IO PORTBbits.RB8
//#define BUTTON3_TRIS TRISBbits.TRISB7
//#define BUTTON3_IO PORTBbits.RB7

#define LED_GET() (0)
#define LED_PUT(a)


in CustomHTTPApp

Code: [Select]
/****************************************************************************
  Section:
GET Form Handlers
  ***************************************************************************/
 
/*****************************************************************************
  Function:
HTTP_IO_RESULT HTTPExecuteGet(void)

  Internal:
  See documentation in the TCP/IP Stack API or HTTP2.h for details.
  ***************************************************************************/
HTTP_IO_RESULT HTTPExecuteGet(void)
{
BYTE *ptr;
BYTE filename[20];

// Load the file name
// Make sure BYTE filename[] above is large enough for your longest name
MPFSGetFilename(curHTTP.file, filename, 20);

// If its the forms.htm page
if(!memcmppgm2ram(filename, "forms.htm", 9))
{
// Seek out each of the four LED strings, and if it exists set the LED states


ptr = HTTPGetROMArg(curHTTP.data, (ROM BYTE *)"led7");
if(ptr)
LED7_IO = (*ptr == '1');


ptr = HTTPGetROMArg(curHTTP.data, (ROM BYTE *)"led6");
if(ptr)
LED6_IO = (*ptr == '1');


ptr = HTTPGetROMArg(curHTTP.data, (ROM BYTE *)"led5");
if(ptr)
LED5_IO = (*ptr == '1');


ptr = HTTPGetROMArg(curHTTP.data, (ROM BYTE *)"led4");
if(ptr)
LED4_IO = (*ptr == '1');

ptr = HTTPGetROMArg(curHTTP.data, (ROM BYTE *)"led3");
if(ptr)
LED3_IO = (*ptr == '1');

ptr = HTTPGetROMArg(curHTTP.data, (ROM BYTE *)"led2");
if(ptr)
LED2_IO = (*ptr == '1');

ptr = HTTPGetROMArg(curHTTP.data, (ROM BYTE *)"led1");
if(ptr)
LED1_IO = (*ptr == '1');
}

// If it's the LED updater file

[attachment=1]
[attachment=0]

Re: Re: Need help with static Ip setup

Reply #27
Nice work, thanks for sharing your code changes.
Got a question? Please ask in the forum for the fastest answers.