Main Parameters

To enable Ethernet communications, you need to set the net.ip, net.gatewayip, and the net.netmask properties. Actually, net.gatewayip and net.netmask are only needed when your device will be establishing outgoing connections to other hosts on the network (perform active opens). If your device will only be accepting incoming connections then you do not have to set the net.gatewayip and the net.netmask.


Strangely, a lot of people hold a passionate belief that default gateway IP and the netmask are necessary always, even for incoming connections. This is not true!

The net object is usually initialized once on startup, like this:

** Tibbo Basic **

sub on_sys_init
 ... some other stuff        

 net.ip = "" 'just an example! May not work on your network!
 net.gatewayip = "" 'just an example! May not work on your network!
 net.netmask= "" 'just an example! May not work on your network!

 ...some other stuff
end sub


On a lot of networks the IP, gateway IP, and the netmask parameters of the hosts are configured automatically, through the use of a special protocol called "DHCP". The net object does not support dhcp directly by we provide a BASIC library that implements DHCP functionality.

One additional read-only property- the net.mac- can be used to extract the MAC address of your device. Your program cannot change the MAC address directly. The MAC is stored in the special configuration area of the EEPROM. Access to the EEPROM is provided by the stor object. To change the MAC address you need to rewrite the data in the EEPROM. For more details, see the Stor Object and Stor.Base Property topics.