|
|
View previous topic :: View next topic |
Author |
Message |
newtotheart
Joined: 10 Jan 2006 Posts: 4 Location: Derbyshire
|
HEEELP! Regarding embedded internet kit.... |
Posted: Tue Aug 01, 2006 9:17 am |
|
|
Hi
Bit of a headache regarding the embedded internet kit. How do you get it to run the "hard coded" IP/Gateway/Subnet instead of DHCP? I have tried disabling dhcp expecting it to use the hardcoded data instead. However upon closer inspection of the code I can't find any links to the hardcoded ip data. It seems to be isolated. Or am I missing something??
In the StackTsk.h file there is the code
Code: |
/*
* Hardcoded IP address of this node
* My IP = 10.10.5.10
*
* Gateway = 10.10.5.10
*/
#define MY_IP AppConfig.MyIPAddr
#define MY_IP_BYTE1 AppConfig.MyIPAddr.v[0]
#define MY_IP_BYTE2 AppConfig.MyIPAddr.v[1]
#define MY_IP_BYTE3 AppConfig.MyIPAddr.v[2]
#define MY_IP_BYTE4 AppConfig.MyIPAddr.v[3]
|
which takes the ip from the App.Config.MyIPaddr.v[x] element from its parent structure. Understand that be great, however the Hardware.h file has this segment of code.
Code: |
///DEFAULT HARDCODED IP ADDRESSES.
/// FUTURE APPLICATIONS MAY WANT TO SAVE THESE TO AN EEPROM.
/// OR USE AUTO IP ASSIGNMENT (DHCP).
/// NO TWO DEVICES ON A NETwORK CAN HAVE THE SAME IP ADDRESS
#define MY_DEFAULT_IP_ADDR_BYTE1 10 //IP ADDRESS
#define MY_DEFAULT_IP_ADDR_BYTE2 10 // This unit's IP address.
#define MY_DEFAULT_IP_ADDR_BYTE3 5
#define MY_DEFAULT_IP_ADDR_BYTE4 15
|
Apart from the obvious mistake (Ip address being 10.10.5.15 instead of 10.10.5.10) I can't see any link. Is there something I don't know about??
In the StackTsk.h am I going to have to put something like below??
Code: |
/*
* Hardcoded IP address of this node
* My IP = 10.10.5.10
*
* Gateway = 10.10.5.10
*/
#define MY_IP 1010510
#define MY_IP_BYTE1 10// AppConfig.MyIPAddr.v[0]
#define MY_IP_BYTE2 10// AppConfig.MyIPAddr.v[1]
#define MY_IP_BYTE3 5// AppConfig.MyIPAddr.v[2]
#define MY_IP_BYTE4 10// AppConfig.MyIPAddr.v[3]
|
Or should I create a union with an array of four bytes and a 4byte var then reference it instead of plonking the numbers in??
Also im having major trouble getting the DHCP to bind on netgear routers.
Anyway, any help would be greatly greatly appreciated.
Thanks
(its the board with the realtek 10BaseT asic on!!)
Dave |
|
|
Pubse2002
Joined: 06 May 2024 Posts: 1
|
Re: HEEELP! Regarding embedded internet kit.... |
Posted: Mon May 06, 2024 4:03 am |
|
|
newtotheart wrote: | Hi
Bit of a headache regarding the embedded internet kit. How do you get it to run the "hard coded" IP/Gateway/Subnet instead of DHCP? I have tried disabling dhcp expecting it to use the hardcoded data instead. However upon closer inspection of the code I can't find any links to the hardcoded ip data. It seems to be isolated. Or am I missing something??
In the StackTsk.h file there is the code
Code: |
/*
* Hardcoded IP address of this node
* My IP = 10.10.5.10
*
* Gateway = 10.10.5.10
*/
#define MY_IP AppConfig.MyIPAddr
#define MY_IP_BYTE1 AppConfig.MyIPAddr.v[0]
#define MY_IP_BYTE2 AppConfig.MyIPAddr.v[1]
#define MY_IP_BYTE3 AppConfig.MyIPAddr.v[2]
#define MY_IP_BYTE4 AppConfig.MyIPAddr.v[3]
|
which takes the ip from the App.Config.MyIPaddr.v[x] element from its parent structure. Understand that be great, however the Hardware.h file has this segment of code. Due to problems with development, I decided to read an article about IoT companies here. With her help, I found Cogniteq, a company that helped me solve many software problems.
Code: |
///DEFAULT HARDCODED IP ADDRESSES.
/// FUTURE APPLICATIONS MAY WANT TO SAVE THESE TO AN EEPROM.
/// OR USE AUTO IP ASSIGNMENT (DHCP).
/// NO TWO DEVICES ON A NETwORK CAN HAVE THE SAME IP ADDRESS
#define MY_DEFAULT_IP_ADDR_BYTE1 10 //IP ADDRESS
#define MY_DEFAULT_IP_ADDR_BYTE2 10 // This unit's IP address.
#define MY_DEFAULT_IP_ADDR_BYTE3 5
#define MY_DEFAULT_IP_ADDR_BYTE4 15
|
Apart from the obvious mistake (Ip address being 10.10.5.15 instead of 10.10.5.10) I can't see any link. Is there something I don't know about??
In the StackTsk.h am I going to have to put something like below??
Code: |
/*
* Hardcoded IP address of this node
* My IP = 10.10.5.10
*
* Gateway = 10.10.5.10
*/
#define MY_IP 1010510
#define MY_IP_BYTE1 10// AppConfig.MyIPAddr.v[0]
#define MY_IP_BYTE2 10// AppConfig.MyIPAddr.v[1]
#define MY_IP_BYTE3 5// AppConfig.MyIPAddr.v[2]
#define MY_IP_BYTE4 10// AppConfig.MyIPAddr.v[3]
|
Or should I create a union with an array of four bytes and a 4byte var then reference it instead of plonking the numbers in??
Also im having major trouble getting the DHCP to bind on netgear routers.
Anyway, any help would be greatly greatly appreciated.
Thanks
(its the board with the realtek 10BaseT asic on!!)
Dave |
It seems like you're having trouble configuring the embedded internet kit to use hard-coded IP addresses instead of DHCP. The code you provided from StackTsk.h and Hardware.h suggests that there might be a discrepancy between the hard-coded IP addresses defined in the two files.
To resolve this, you can try the following steps:
Ensure that the hard-coded IP addresses are consistent across all relevant files. Check for any discrepancies between the values defined in StackTsk.h and Hardware.h.
If necessary, update the hard-coded IP addresses in Hardware.h to match the values specified in StackTsk.h. In your case, correcting the IP address from 10.10.5.15 to 10.10.5.10 in Hardware.h is essential.
Once the IP addresses are consistent, ensure that the correct IP address is being used in your application code. You may need to modify the references to MY_IP_ADDR_BYTE1, MY_IP_ADDR_BYTE2, etc., to use the AppConfig.MyIPAddr.v[x] structure.
If you're still encountering issues with DHCP binding on Netgear routers, ensure that the DHCP configuration on the routers is compatible with your device's settings. Double-check the DHCP settings and verify that the router is assigning IP addresses correctly.
Consider reaching out to the manufacturer or seeking assistance from online forums or communities dedicated to embedded systems development for further troubleshooting and support.
By ensuring consistency in the hard-coded IP addresses and verifying the DHCP configuration, you should be able to resolve the issues you're experiencing. If you have any further questions or need assistance with specific code implementations, feel free to ask! |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|