Accessing NTP

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
clocktower
 
Posts: 60
Joined: Sun May 24, 2015 3:10 pm

Accessing NTP

Post by clocktower »

It seems like the BBB can get correct time when I plug it in with ethernet and a power adaptor. But, if I run it on USB, it does not get the time and I think it has trouble sending HTML messages. My LAN is 192.168.1.1 and the ethernet is 192.168.1.177.

The USB is 192.168.7.2. Does that explain why the BBB can't go through my router to the web?

User avatar
clocktower
 
Posts: 60
Joined: Sun May 24, 2015 3:10 pm

Re: Accessing NTP

Post by clocktower »

This is the "interfaces" setup:

# Ethernet/RNDIS gadget (g_ether)
# ... or on host side, usbnet and random hwaddr
# Note on some boards, usb0 is automaticly setup with an init script
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.0
network 192.168.7.0
gateway 192.168.7.1

If I change network and gateway to point to my router, will this get access to the web?

iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.0
network 192.168.1.1
gateway 192.168.1.1

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Accessing NTP

Post by adafruit_support_rick »

Your network is not configured to allow communications between 192.168.7.x and 192.168.1.x. If your BBB is at 192.168.7.2, it will not be able to access the internet gateway at 192.168.1.1.

User avatar
clocktower
 
Posts: 60
Joined: Sun May 24, 2015 3:10 pm

Re: Accessing NTP

Post by clocktower »

So do I need to change the IP of the USB or can I just change the IP of the network and gateway?

User avatar
clocktower
 
Posts: 60
Joined: Sun May 24, 2015 3:10 pm

Re: Accessing NTP

Post by clocktower »

I changed the IP address of the USB port in etc/network/interfaces and it still uses 192.1.68.7.2

iface usb0 inet static
address 192.168.1.189
netmask 255.255.255.0
network 192.168.1.1
gateway 192.168.1.1

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Accessing NTP

Post by adafruit_support_rick »

I don't think I'm following you. You have a USB ethernet adapter? I thought you meant you were powering it from USB.

Do you have the regular ethernet and the USB ethernet plugged in at the same time? Try using one or the other.

User avatar
clocktower
 
Posts: 60
Joined: Sun May 24, 2015 3:10 pm

Re: Accessing NTP

Post by clocktower »

I don't have a USB/ethernet adaptor. I'm communicating with the on-board USB port. But it uses IP address 192.168.7.2 and so cannot communicate to my router. I wish to use the standard USB cable to power the BBB and communicate with the internet.

I tried to reconfigure the BBB file "etc/network/interfaces" so the on-board USB port would use a different IP address, but it has no effect. The BBB continues to come up with IP address 192.168.7.2.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Accessing NTP

Post by adafruit_support_rick »

I'm not super familiar with the BBB, but I don't think there is any ethernet over the USB connector. USB doesn't have an IP address. You have the BBB plugged into your router via USB somehow?

User avatar
clocktower
 
Posts: 60
Joined: Sun May 24, 2015 3:10 pm

Re: Accessing NTP

Post by clocktower »

I feel like I am telling you how to "suck eggs", but when you plug a BBB into your computer to program it, it is assigned an IP address. This is how you communicate with it, by opening shell access (ssh) to Linux through a Terminal window on the host computer. This is how your computer has access to the BBB.

If the BBB were to acquire the IP address 192.168.1.xxx on this USB port, it would be in the same network as my (and many other) routers, and would have access to the internet through that router.

The configuration file for the network interfaces specifies the IP address 192.168.7.2, but changes to this file do not seem to effect an actual change in the operation of the BBB.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Accessing NTP

Post by adafruit_support_rick »

Sorry - I'll have to turn this over to someone who knows more about the BBB.

User avatar
clocktower
 
Posts: 60
Joined: Sun May 24, 2015 3:10 pm

Re: Accessing NTP

Post by clocktower »

That's okay, I have found another answer and you need not bother your people.

The answer:
sudo sh -c "echo nameserver 8.8.8.8 > /etc/resolv.conf"

Locked
Please be positive and constructive with your questions and comments.

Return to “Beagle Bone & Adafruit Beagle Bone products”