Skip to content

Commit

Permalink
projects: swiot1l: Change default static IP
Browse files Browse the repository at this point in the history
The 169.254.0.0/16 IP range is used for link local communication. Such
addresses are usually assigned by the network stack if a DHCP request
did not receive a response, and should not be assigned manually. Use an
IP in the 192.168.0.0/16 range instead.

Update the network mask variable and the documentation accordingly.

Signed-off-by: Ciprian Regus <[email protected]>
  • Loading branch information
CiprianRegus committed May 2, 2024
1 parent 66c1def commit 18b5609
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions projects/swiot1l/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ SWIOT1L_STATIC_IP = n
endif

ifeq (y,$(strip $(SWIOT1L_STATIC_IP)))
NO_OS_IP=169.254.97.40
NO_OS_NETMASK=255.255.255.0
NO_OS_IP=192.168.97.40
NO_OS_NETMASK=255.255.0.0
NO_OS_GATEWAY=0.0.0.0
endif

Expand Down
4 changes: 2 additions & 2 deletions projects/swiot1l/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ In order to configure and sample data from the SWIOT1L board, you'll have to con

1. Using a T1L -> Ethernet media converter:
- Direct connection to PC:
Build the firmware with the `SWIOT1L_STATIC_IP=y` flag, will result in using `169.254.97.40` as an IP address. This is the fastest way of testing the platform, since it doesn't require the DHCP configuration or DHCP timeout (in case of AutoIP).
Build the firmware with the `SWIOT1L_STATIC_IP=y` flag, will result in using `192.168.97.40` as an IP address. This is the fastest way of testing the platform, since it doesn't require the DHCP configuration or DHCP timeout (in case of AutoIP).
Alternatively, you may omit `SWIOT1L_STATIC_IP=y` (or set it to `n`), in which case, the board will send a DHCP request and try to get an IP that way. If you don't have a DHCP server listening on the PC's network interface (to which SWIOT1L is connected), a link local address (in the 169.254.x.x\16 range) will be used. This may take a while (~10s) the first time you power the board, since there have to be 2 failed DHCP requests.

In case a link local address is used, the user may need to add a static route if the PC has multiple network interfaces up. If using Linux, this can be done by running the following in a terminal:
In case a link local or static IP address is used, the user may need to add a static route if the PC has multiple network interfaces up. If using Linux, this can be done by running the following in a terminal:

`sudo ip route add 169.254.97.40/32 dev if_name`
`if_name` should be replaced with the name of the network interface the SWIOT1L board is connected on.
Expand Down

0 comments on commit 18b5609

Please sign in to comment.