EV3 is connected to internet via USB cable to laptop.
Tested with :
Laptop: Ethernet plug-in connection to internet
EV3 : usb cable to laptop sharing laptop's internet
Use ssh to log into the EV3DEV (id: robot password: maker)
Started with: Determine Your Private and Public IP Addresses from the Command Line but needed to replace eth0 with usb1
Displaying private IP addresses
Note: Host laptop has different private IP address$ hostname -I
Result: 192.168.137.3
$ /sbin/ifconfig
Result: usb1 Link encap:Ethernet HWaddr 22:16:53:51:62:2f
inet addr:192.168.137.3 ...
$ /sbin/ifconfig usb1 | grep Mask
Result: inet addr:192.168.137.3 Bcast:192.168.137.255 Mask:255.255.255.0 .....
$ ip addr show usb1
result:
3: usb1: ....
link/ether...
inet 192.168.137.3/24 ....
....
$ ip addr show usb1 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/'
result: 192.168.137.3
Displaying the public IP address
Note: Host laptop has same public IP addresshttp://www.ifconfig.me (etc)
[curl not installed on ev3dev]
$ wget -qO- ifconfig.me
search for ip_address
No comments:
Post a Comment